Changeset 98
- Timestamp:
- 11/19/08 13:35:21 (17 years ago)
- Location:
- trunk/src
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp
r90 r98 67 67 68 68 if(pInstance) 69 pInstance->SetData(DATA_GRUULEVENT, 0); 69 { 70 pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); 71 72 GameObject* Door = NULL; 73 Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); 74 if(Door) 75 Door->SetGoState(0); 76 } 70 77 } 71 78 … … 73 80 { 74 81 if(pInstance) 75 pInstance->SetData(DATA_GRUULEVENT, 1); 82 { 83 pInstance->SetData(DATA_GRUULEVENT, DONE); 84 85 GameObject* Door = NULL; 86 Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); 87 if(Door) 88 Door->SetGoState(0); 89 90 } 76 91 } 77 92 … … 80 95 81 96 DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); 97 DoZoneInCombat(); 82 98 83 99 if(pInstance) 84 pInstance->SetData(DATA_GRUULEVENT, 1); 100 { 101 pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); 102 103 GameObject* Door = NULL; 104 Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR)); 105 if(Door) 106 Door->SetGoState(1); 107 } 85 108 } 86 109 -
trunk/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
r90 r98 17 17 /* ScriptData 18 18 SDName: Boss_High_King_Maulgar 19 SD%Complete: 8020 SDComment: Verify that the script is working properly19 SD%Complete: 90 20 SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing 21 21 SDCategory: Gruul's Lair 22 22 EndScriptData */ … … 25 25 #include "def_gruuls_lair.h" 26 26 27 #define SOUND_AGGRO 11367 //"Gronn are the real power in outland." 28 29 #define SOUND_ENRAGE 11368 //"You will not defeat the hand of Gruul!" 30 31 #define SOUND_OGRE_DEATH1 11369 //"You won't kill next one so easy!" 32 #define SOUND_OGRE_DEATH2 11370 //"Pah! Does not prove anything!" 33 #define SOUND_OGRE_DEATH3 11371 //"I'm not afraid of you." 34 #define SOUND_OGRE_DEATH4 11372 //"Good, now you fight me!" 35 36 #define SOUND_SLAY1 11373 //"You not so tough afterall!" 37 #define SOUND_SLAY2 11374 //"Aha ha ha ha!" 38 #define SOUND_SLAY3 11375 //"Mulgar is king!" 39 40 #define SOUND_DEATH 11376 //"Gruul ...will crush you..." 27 //Sounds 28 #define SOUND_AGGRO 11367 //"Gronn are the real power in outland." 29 #define SOUND_ENRAGE 11368 //"You will not defeat the hand of Gruul!" 30 #define SOUND_OGRE_DEATH1 11369 //"You won't kill next one so easy!" 31 #define SOUND_OGRE_DEATH2 11370 //"Pah! Does not prove anything!" 32 #define SOUND_OGRE_DEATH3 11371 //"I'm not afraid of you." 33 #define SOUND_OGRE_DEATH4 11372 //"Good, now you fight me!" 34 #define SOUND_SLAY1 11373 //"You not so tough afterall!" 35 #define SOUND_SLAY2 11374 //"Aha ha ha ha!" 36 #define SOUND_SLAY3 11375 //"Mulgar is king!" 37 #define SOUND_DEATH 11376 //"Gruul ...will crush you..." 41 38 42 39 // High King Maulgar 43 #define SPELL_ARCING_SMASH 39144 44 #define SPELL_MIGHTY_BLOW 33230 45 #define SPELL_WHIRLWIND 33238 46 #define SPELL_ENRAGE 34970 47 48 // Council spells 40 #define SPELL_ARCING_SMASH 39144 41 #define SPELL_MIGHTY_BLOW 33230 42 #define SPELL_WHIRLWIND 33238 43 #define SPELL_BERSERKER_C 26561 44 #define SPELL_ROAR 16508 45 #define SPELL_FLURRY 33232 46 47 // Olm the Summoner 49 48 #define SPELL_DARK_DECAY 33129 49 #define SPELL_DEATH_COIL 33130 50 #define SPELL_SUMMON_WFH 33131 51 52 //Kiggler the Craed 50 53 #define SPELL_GREATER_POLYMORPH 33173 51 54 #define SPELL_LIGHTNING_BOLT 36152 52 55 #define SPELL_ARCANE_SHOCK 33175 53 56 #define SPELL_ARCANE_EXPLOSION 33237 57 58 //Blindeye the Seer 54 59 #define SPELL_GREATER_PW_SHIELD 33147 55 60 #define SPELL_HEAL 33144 61 #define SPELL_PRAYER_OH 33152 62 63 //Krosh Firehand 56 64 #define SPELL_GREATER_FIREBALL 33051 57 65 #define SPELL_SPELLSHIELD 33054 … … 75 83 uint32 Whirlwind_Timer; 76 84 uint32 Charging_Timer; 85 uint32 Roar_Timer; 77 86 78 87 bool Phase2; … … 86 95 Whirlwind_Timer = 30000; 87 96 Charging_Timer = 0; 97 Roar_Timer = 0; 98 88 99 Phase2 = false; 89 100 … … 104 115 //reset encounter 105 116 if (pInstance) 106 pInstance->SetData(DATA_MAULGAREVENT, 0);117 pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); 107 118 } 108 119 … … 122 133 123 134 if (pInstance) 124 pInstance->SetData(DATA_MAULGAREVENT, 0); 125 } 135 { 136 pInstance->SetData(DATA_MAULGAREVENT, DONE); 137 138 GameObject* Door = NULL; 139 Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_MAULGARDOOR)); 140 if(Door) 141 Door->SetGoState(0); 142 } 143 } 144 145 void AddDeath() 146 { 147 switch(rand()%3) 148 { 149 case 0: DoPlaySoundToSet(m_creature, SOUND_OGRE_DEATH1);break; 150 case 1: DoPlaySoundToSet(m_creature, SOUND_OGRE_DEATH2);break; 151 case 2: DoPlaySoundToSet(m_creature, SOUND_OGRE_DEATH3);break; 152 case 3: DoPlaySoundToSet(m_creature, SOUND_OGRE_DEATH4);break; 153 } 154 } 155 126 156 127 157 void Aggro(Unit *who) { StartEvent(who); } … … 146 176 147 177 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 148 pInstance->SetData(DATA_MAULGAREVENT, 1); 178 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 179 180 DoZoneInCombat(); 149 181 } 150 182 … … 182 214 183 215 //Whirlwind_Timer 184 if (Whirlwind_Timer < diff)185 {186 DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);187 Whirlwind_Timer = 55000;188 }else Whirlwind_Timer -= diff;216 if (Whirlwind_Timer < diff) 217 { 218 DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); 219 Whirlwind_Timer = 55000; 220 }else Whirlwind_Timer -= diff; 189 221 190 222 //MightyBlow_Timer … … 200 232 Phase2 = true; 201 233 DoPlaySoundToSet(m_creature, SOUND_ENRAGE); 234 DoCast(m_creature, SPELL_FLURRY); 235 236 m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); 237 m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); 202 238 } 203 239 … … 211 247 if(target) 212 248 DoStartAttackAndMovement(target); 249 DoCast(target, SPELL_BERSERKER_C); 213 250 214 251 Charging_Timer = 20000; 215 252 }else Charging_Timer -= diff; 253 254 //Intimidating Roar 255 if(Roar_Timer < diff) 256 { 257 DoCast(m_creature, SPELL_ROAR); 258 Roar_Timer = 40000+(rand()%10000); 259 }else Roar_Timer -= diff; 216 260 } 217 261 … … 231 275 uint32 DarkDecay_Timer; 232 276 uint32 Summon_Timer; 277 uint32 DeathCoil_Timer; 233 278 234 279 ScriptedInstance* pInstance; … … 238 283 DarkDecay_Timer = 10000; 239 284 Summon_Timer = 15000; 285 DeathCoil_Timer = 20000; 240 286 241 287 //reset encounter 242 288 if (pInstance) 243 pInstance->SetData(DATA_MAULGAREVENT, 0);289 pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); 244 290 } 245 291 … … 249 295 { 250 296 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 251 pInstance->SetData(DATA_MAULGAREVENT, 1); 252 } 253 } 254 255 float DoCalculateRandomLocation() 256 { 257 float Loc; 258 float Rand = rand()%8; 259 260 switch(rand()%2) 261 { 262 case 0: Loc = 0 + Rand; break; 263 case 1: Loc = 0 - Rand; break; 264 } 265 return Loc; 266 } 297 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 298 } 299 } 300 301 void JustDied(Unit* Killer) 302 { 303 if(pInstance) 304 { 305 Creature *Maulgar = NULL; 306 Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); 307 308 if(Maulgar) 309 ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); 310 } 311 } 267 312 268 313 void UpdateAI(const uint32 diff) … … 297 342 if(Summon_Timer < diff) 298 343 { 299 Creature *Add = NULL; 300 Add = DoSpawnCreature(18847, DoCalculateRandomLocation(), DoCalculateRandomLocation(), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); 301 Summon_Timer = 30000; 344 DoCast(m_creature, SPELL_SUMMON_WFH); 345 Summon_Timer = 30000; 302 346 }else Summon_Timer -= diff; 347 348 //DeathCoil Timer /need correct timer 349 if(DeathCoil_Timer < diff) 350 { 351 Unit* target = NULL; 352 target = SelectUnit(SELECT_TARGET_RANDOM, 0); 353 if(target) 354 DoCast(target, SPELL_DEATH_COIL); 355 DeathCoil_Timer = 20000; 356 }else DeathCoil_Timer -= diff; 357 303 358 304 359 DoMeleeAttackIfReady(); … … 315 370 } 316 371 317 uint32 Great herPolymorph_Timer;372 uint32 GreaterPolymorph_Timer; 318 373 uint32 LightningBolt_Timer; 319 374 uint32 ArcaneShock_Timer; … … 324 379 void Reset() 325 380 { 326 Great herPolymorph_Timer = 5000;381 GreaterPolymorph_Timer = 5000; 327 382 LightningBolt_Timer = 10000; 328 383 ArcaneShock_Timer = 20000; … … 331 386 //reset encounter 332 387 if (pInstance) 333 pInstance->SetData(DATA_MAULGAREVENT, 0);388 pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); 334 389 } 335 390 … … 339 394 { 340 395 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 341 pInstance->SetData(DATA_MAULGAREVENT, 1); 342 } 343 } 344 396 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 397 } 398 } 399 400 void JustDied(Unit* Killer) 401 { 402 if(pInstance) 403 { 404 Creature *Maulgar = NULL; 405 Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); 406 407 if(Maulgar) 408 ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); 409 } 410 } 345 411 void MoveInLineOfSight(Unit *who) 346 412 { … … 362 428 { 363 429 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 364 pInstance->SetData(DATA_MAULGAREVENT, 1);430 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 365 431 } 366 432 } … … 390 456 EnterEvadeMode(); 391 457 392 //GreaterPolymorph_Timer / disabled: it makes you fall under the texture / if you've got vmaps feel free to uncomment this393 /*if(GreaterPolymorph_Timer < diff)458 //GreaterPolymorph_Timer 459 if(GreaterPolymorph_Timer < diff) 394 460 { 395 461 Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); … … 398 464 399 465 GreaterPolymorph_Timer = 20000; 400 }else GreaterPolymorph_Timer -= diff; */466 }else GreaterPolymorph_Timer -= diff; 401 467 402 468 //LightningBolt_Timer … … 446 512 //reset encounter 447 513 if (pInstance) 448 pInstance->SetData(DATA_MAULGAREVENT, 0);514 pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); 449 515 } 450 516 … … 454 520 { 455 521 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 456 pInstance->SetData(DATA_MAULGAREVENT, 1); 457 } 458 } 522 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 523 } 524 } 525 526 void JustDied(Unit* Killer) 527 { 528 if(pInstance) 529 { 530 Creature *Maulgar = NULL; 531 Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); 532 533 if(Maulgar) 534 ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); 535 } 536 } 459 537 460 538 void MoveInLineOfSight(Unit *who) … … 477 555 { 478 556 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 479 pInstance->SetData(DATA_MAULGAREVENT, 1);557 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 480 558 } 481 559 } … … 546 624 //reset encounter 547 625 if (pInstance) 548 pInstance->SetData(DATA_MAULGAREVENT, 0);626 pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); 549 627 } 550 628 … … 554 632 { 555 633 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 556 pInstance->SetData(DATA_MAULGAREVENT, 1); 557 } 558 } 559 634 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 635 } 636 } 637 638 void JustDied(Unit* Killer) 639 { 640 if(pInstance) 641 { 642 Creature *Maulgar = NULL; 643 Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR))); 644 645 if(Maulgar) 646 ((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath(); 647 } 648 } 560 649 void MoveInLineOfSight(Unit *who) 561 650 { … … 577 666 { 578 667 pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); 579 pInstance->SetData(DATA_MAULGAREVENT, 1);668 pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); 580 669 } 581 670 } … … 606 695 607 696 //GreaterFireball_Timer 608 if(GreaterFireball_Timer < diff )697 if(GreaterFireball_Timer < diff || m_creature->GetDistance(m_creature->getVictim()) < 30) 609 698 { 610 699 DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL); … … 623 712 if(BlastWave_Timer < diff) 624 713 { 714 Unit *target; 715 std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList(); 716 std::vector<Unit *> target_list; 717 for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) 718 { 719 target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); 720 //15 yard radius minimum 721 if(target && target->GetDistance2d(m_creature) < 15) 722 target_list.push_back(target); 723 target = NULL; 724 } 725 if(target_list.size()) 726 target = *(target_list.begin()+rand()%target_list.size()); 727 625 728 m_creature->InterruptNonMeleeSpells(false); 626 DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE);729 DoCast(target, SPELL_BLAST_WAVE); 627 730 BlastWave_Timer = 60000; 628 731 }else BlastWave_Timer -= diff; -
trunk/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h
r90 r98 13 13 #define DATA_MAULGAREVENT_TANK 6 14 14 #define DATA_OLMTHESUMMONER 7 15 #define DATA_MAULGARDOOR 8 16 #define DATA_GRUULDOOR 9 17 #define DATA_MAULGAR 10 15 18 #endif -
trunk/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp
r90 r98 43 43 uint64 OlmTheSummoner; 44 44 uint64 KroshFirehand; 45 uint64 Maulgar; 46 47 uint64 MaulgarDoor; 48 uint64 GruulDoor; 45 49 46 50 void Initialize() … … 51 55 OlmTheSummoner = 0; 52 56 KroshFirehand = 0; 57 Maulgar = 0; 58 59 MaulgarDoor = 0; 60 GruulDoor = 0; 61 53 62 54 63 for(uint8 i = 0; i < ENCOUNTERS; i++) … … 72 81 case 18834: OlmTheSummoner = creature->GetGUID(); break; 73 82 case 18832: KroshFirehand = creature->GetGUID(); break; 83 case 18831: Maulgar = creature->GetGUID();break; 74 84 } 75 85 } 86 87 void OnObjectCreate(GameObject* go) 88 { 89 switch(go->GetEntry()) 90 { 91 case 184468: MaulgarDoor = go->GetGUID();break; 92 case 184662: GruulDoor = go->GetGUID();break; 93 } 94 } 76 95 77 96 void SetData64(uint32 type, uint64 data) … … 85 104 switch(identifier) 86 105 { 87 case DATA_MAULGAREVENT_TANK: 88 return MaulgarEvent_Tank; 89 case DATA_KIGGLERTHECRAZED: 90 return KigglerTheCrazed; 91 case DATA_BLINDEYETHESEER: 92 return BlindeyeTheSeer; 93 case DATA_OLMTHESUMMONER: 94 return OlmTheSummoner; 95 case DATA_KROSHFIREHAND: 96 return KroshFirehand; 106 case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; 107 case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; 108 case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; 109 case DATA_OLMTHESUMMONER: return OlmTheSummoner; 110 case DATA_KROSHFIREHAND: return KroshFirehand; 111 case DATA_MAULGARDOOR: return MaulgarDoor; 112 case DATA_GRUULDOOR: return GruulDoor; 113 case DATA_MAULGAR: return Maulgar; 97 114 } 98 115 return 0; … … 104 121 { 105 122 case DATA_MAULGAREVENT: 106 Encounters[0] = (data) ? true : false; 107 break; 123 Encounters[0] = data; break; 108 124 case DATA_GRUULEVENT: 109 Encounters[1] = (data) ? true : false; 110 break; 125 Encounters[1] = data; break; 111 126 } 127 128 if(data == DONE) 129 SaveToDB(); 112 130 } 113 131 … … 116 134 switch(type) 117 135 { 118 case DATA_MAULGAREVENT: 119 return Encounters[0]; 120 case DATA_GRUULEVENT: 121 return Encounters[1]; 136 case DATA_MAULGAREVENT: return Encounters[0]; 137 case DATA_GRUULEVENT: return Encounters[1]; 122 138 } 123 139 return 0; 124 140 } 141 142 143 const char* Save() 144 { 145 OUT_SAVE_INST_DATA; 146 std::ostringstream stream; 147 stream << Encounters[0] << " " << Encounters[1]; 148 char* out = new char[stream.str().length() + 1]; 149 strcpy(out, stream.str().c_str()); 150 if(out) 151 { 152 OUT_SAVE_INST_DATA_COMPLETE; 153 return out; 154 } 155 156 return NULL; 157 } 158 159 void Load(const char* in) 160 { 161 if(!in) 162 { 163 OUT_LOAD_INST_DATA_FAIL; 164 return; 165 } 166 167 OUT_LOAD_INST_DATA(in); 168 std::istringstream stream(in); 169 stream >> Encounters[0] >> Encounters[1]; 170 for(uint8 i = 0; i < ENCOUNTERS; ++i) 171 if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. 172 Encounters[i] = NOT_STARTED; 173 OUT_LOAD_INST_DATA_COMPLETE; 174 } 125 175 }; 126 127 176 InstanceData* GetInstanceData_instance_gruuls_lair(Map* map) 128 177 { -
trunk/src/game/SpellMgr.cpp
r87 r98 1041 1041 if(spellInfo_1->SpellFamilyFlags == spellInfo_2->SpellFamilyFlags) 1042 1042 return true; 1043 if(spellInfo_1->SpellFamilyName == SPELLFAMILY_SHAMAN) 1044 if(IsElementalShield(spellInfo_1) && IsElementalShield(spellInfo_2)) 1045 return true; 1043 1046 //Corruption & Seed of corruption 1044 1047 if(spellInfo_1->SpellFamilyName == SPELLFAMILY_WARLOCK) -
trunk/src/game/WaypointMovementGenerator.cpp
r44 r98 166 166 creature.Say(behavior->text[0].c_str(), 0, 0); 167 167 } 168 169 i_hasDone[idx] = true;170 MovementInform(creature);171 168 } // wpBehaviour found 169 i_hasDone[idx] = true; 170 MovementInform(creature); 172 171 } // HasDone == false 173 172 } // i_creature.IsStopped()