Changeset 89 for trunk/src/bindings/scripts
- Timestamp:
- 11/19/08 13:33:15 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp
r57 r89 56 56 uint64 IllidanStormrage; 57 57 58 uint16 BossKilled; 59 58 60 uint64 NajentusGate; 59 61 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 60 70 uint64 IllidanGate; 61 71 uint64 IllidanDoor[2]; 72 62 73 63 74 uint32 Encounters[ENCOUNTERS]; … … 78 89 IllidanStormrage = 0; 79 90 91 BossKilled = 0; 92 80 93 NajentusGate = 0; 81 94 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; 82 103 IllidanGate = 0; 83 104 IllidanDoor[0] = 0; … … 95 116 return false; 96 117 } 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 97 136 98 137 void OnCreatureCreate(Creature *creature, uint32 creature_entry) … … 120 159 { 121 160 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 128 181 IllidanGate = go->GetGUID(); 129 182 go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); 130 183 break; 131 case 186261: // Right door at Temple Summit184 case 186261: // Right door at Temple Summit 132 185 IllidanDoor[0] = go->GetGUID(); 133 186 go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); 134 187 break; 135 case 186262: // Left door at Temple Summit188 case 186262: // Left door at Temple Summit 136 189 IllidanDoor[1] = go->GetGUID(); 137 190 go->SetUInt32Value(GAMEOBJECT_FLAGS,GO_FLAG_NODESPAWN+GO_FLAG_INTERACT_COND); … … 170 223 switch(type) 171 224 { 172 case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break;225 case DATA_HIGHWARLORDNAJENTUSEVENT: Encounters[0] = data; break; 173 226 case DATA_SUPREMUSEVENT: Encounters[1] = data; break; 174 227 case DATA_SHADEOFAKAMAEVENT: Encounters[2] = data; break; … … 182 235 183 236 if(data == DONE) 237 { 184 238 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 } 186 274 187 275 uint32 GetData(uint32 type)