Changeset 89

Show
Ignore:
Timestamp:
11/19/08 13:33:15 (17 years ago)
Author:
yumileroy
Message:

[svn] Black Temple doors script. Patch provided by Blaymoira.

Original author: megamage
Date: 2008-10-21 12:51:53-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp

    r57 r89  
    5656    uint64 IllidanStormrage; 
    5757 
     58       uint16 BossKilled; 
     59 
    5860    uint64 NajentusGate; 
    5961    uint64 MainTempleDoors; 
     62       uint64 ShadeOfAkamaDoor; 
     63       uint64 CommonDoor;//Teron 
     64       uint64 TeronDoor; 
     65       uint64 GuurtogDoor; 
     66       uint64 MotherDoor; 
     67       uint64 TempleDoor;//Befor mother 
     68       uint64 CouncilDoor; 
     69       uint64 SimpleDoor;//council 
    6070    uint64 IllidanGate; 
    6171    uint64 IllidanDoor[2]; 
     72 
    6273 
    6374    uint32 Encounters[ENCOUNTERS]; 
     
    7889        IllidanStormrage = 0; 
    7990 
     91               BossKilled = 0; 
     92 
    8093        NajentusGate    = 0; 
    8194        MainTempleDoors = 0; 
     95               ShadeOfAkamaDoor= 0; 
     96               CommonDoor              = 0;//teron 
     97               TeronDoor               = 0; 
     98               GuurtogDoor             = 0; 
     99               MotherDoor              = 0; 
     100               TempleDoor              = 0; 
     101               SimpleDoor              = 0;//Bycouncil 
     102               CouncilDoor             = 0; 
    82103        IllidanGate     = 0; 
    83104        IllidanDoor[0]  = 0; 
     
    95116        return false; 
    96117    } 
     118 
     119    void OpenDoor(uint64 DoorGUID, bool open) 
     120    { 
     121        if(((InstanceMap*)instance)->GetPlayers().size()) 
     122            if(Player* first = ((InstanceMap*)instance)->GetPlayers().front()) 
     123                if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID)) 
     124                    Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1); 
     125    } 
     126 
     127       void CloseDoor(uint64 DoorGUID, bool close) 
     128       { 
     129               if(((InstanceMap*)instance)->GetPlayers().size()) 
     130            if(Player* first = ((InstanceMap*)instance)->GetPlayers().front()) 
     131                if(GameObject *Door = GameObject::GetGameObject(*first, DoorGUID)) 
     132                    Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0); 
     133       } 
     134 
     135 
    97136 
    98137    void OnCreatureCreate(Creature *creature, uint32 creature_entry) 
     
    120159        { 
    121160            case 185483:                                    // Gate past Naj'entus (at the entrance to Supermoose's courtyards) 
    122                 NajentusGate = go->GetGUID(); 
    123                 break; 
    124             case 185882:                                    // Main Temple Doors - right past Supermoose (Supremus) 
    125                 MainTempleDoors = go->GetGUID(); 
    126                 break; 
    127             case 185905:                                    // Gate leading to Temple Summit 
     161                NajentusGate = go->GetGUID();break; 
     162                       case 185882:                                    // Main Temple Doors - right past Supermoose (Supremus) 
     163                MainTempleDoors = go->GetGUID();break; 
     164                       case 185478: 
     165                               ShadeOfAkamaDoor = go->GetGUID();break; 
     166                       case 185480:  
     167                                       CommonDoor = go->GetGUID();break; 
     168                       case 186153: 
     169                               TeronDoor = go->GetGUID();break; 
     170                       case 185892: 
     171                               GuurtogDoor = go->GetGUID();break; 
     172                       case 185479: 
     173                               TempleDoor = go->GetGUID();break; 
     174                       case 185482: 
     175                               MotherDoor = go->GetGUID();break; 
     176                       case 185481: 
     177                               CouncilDoor = go->GetGUID();break; 
     178                       case 186152://used by council 
     179                               SimpleDoor = go->GetGUID();break; 
     180                       case 185905:                                    // Gate leading to Temple Summit 
    128181                IllidanGate = go->GetGUID(); 
    129182                go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); 
    130183                break; 
    131             case 186261:                                    // Right door at Temple Summit 
     184                       case 186261:                                    // Right door at Temple Summit 
    132185                IllidanDoor[0] = go->GetGUID(); 
    133186                go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); 
    134187                break; 
    135             case 186262:                                    // Left door at Temple Summit 
     188                       case 186262:                                    // Left door at Temple Summit 
    136189                IllidanDoor[1] = go->GetGUID(); 
    137190                go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); 
     
    170223        switch(type) 
    171224        { 
    172             case DATA_HIGHWARLORDNAJENTUSEVENT:   Encounters[0] = data;         break; 
     225            case DATA_HIGHWARLORDNAJENTUSEVENT:   Encounters[0] = data;                        break; 
    173226            case DATA_SUPREMUSEVENT:              Encounters[1] = data;         break; 
    174227            case DATA_SHADEOFAKAMAEVENT:          Encounters[2] = data;         break; 
     
    182235 
    183236        if(data == DONE) 
     237               { 
    184238            SaveToDB(); 
    185     } 
     239                       BossKilled++; 
     240               } 
     241               CheckInstanceStatus(); 
     242    } 
     243 
     244       void CheckInstanceStatus() 
     245       { 
     246               if(BossKilled >= 6) 
     247                       OpenDoor(TempleDoor, true); 
     248               if(Encounters[0] == DONE) 
     249                       OpenDoor(NajentusGate, true); 
     250               if(Encounters[2] == IN_PROGRESS) 
     251                       CloseDoor(ShadeOfAkamaDoor, true); 
     252               else OpenDoor(ShadeOfAkamaDoor, true); 
     253               if(Encounters[3] == IN_PROGRESS) 
     254               { 
     255                       CloseDoor(TeronDoor, true); 
     256                       CloseDoor(CommonDoor, true); 
     257               }else{  
     258                       OpenDoor(TeronDoor, true); 
     259                       OpenDoor(CommonDoor, true); 
     260               } 
     261               if(Encounters[4] == DONE) 
     262                       OpenDoor(GuurtogDoor, true); 
     263               if(Encounters[6] == DONE) 
     264                       OpenDoor(MotherDoor, true); 
     265               if(Encounters[7] == IN_PROGRESS) 
     266               { 
     267                       CloseDoor(CouncilDoor, true); 
     268                       CloseDoor(SimpleDoor, true); 
     269               }else{ 
     270                       OpenDoor(CouncilDoor, true); 
     271                       OpenDoor(SimpleDoor, true);                      
     272               } 
     273       } 
    186274 
    187275    uint32 GetData(uint32 type)