diff options
| author | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-10-07 19:45:43 -0500 |
|---|---|---|
| committer | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-10-07 19:45:43 -0500 |
| commit | 5b4c7783c2a28e420cb4aaf4f2967083db8f6787 (patch) | |
| tree | 887be454d8d9d1a916d8085a243a2afaff2c0dbe /src/server/scripts/EasternKingdoms/ScarletEnclave | |
| parent | c89b1f6989ce1f5a48c48766993c3dd8101cc21b (diff) | |
REPO: Code-style clean-ups
* Fixed pMap->map
* Fixed pInstance->instance
* Fixed pInsta->instance
* Fixed pQuest->quest
* Fixed pWho->who
* Fixed pTarget->target
* Fixed pGo->go
~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
Diffstat (limited to 'src/server/scripts/EasternKingdoms/ScarletEnclave')
3 files changed, 439 insertions, 439 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 9a3913cb7dd..395f4f3ace4 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -313,9 +313,9 @@ class go_acherus_soul_prison : public GameObjectScript public: go_acherus_soul_prison() : GameObjectScript("go_acherus_soul_prison") { } - bool OnGossipHello(Player* player, GameObject* pGo) + bool OnGossipHello(Player* player, GameObject* go) { - if (Creature* anchor = pGo->FindNearestCreature(29521, 15)) + if (Creature* anchor = go->FindNearestCreature(29521, 15)) if (uint64 prisonerGUID = anchor->AI()->GetGUID()) if (Creature* prisoner = Creature::GetCreature(*player, prisonerGUID)) CAST_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 481c8647c82..ebd30aa2f5d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -177,9 +177,9 @@ class npc_koltira_deathweaver : public CreatureScript public: npc_koltira_deathweaver() : CreatureScript("npc_koltira_deathweaver") { } - bool OnQuestAccept(Player* player, Creature* creature, const Quest* pQuest) + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) { - if (pQuest->GetQuestId() == QUEST_BREAKOUT) + if (quest->GetQuestId() == QUEST_BREAKOUT) { creature->SetStandState(UNIT_STAND_STATE_STAND); @@ -305,9 +305,9 @@ public: break; case 4: { - Creature* pTemp = Unit::GetCreature(*me, m_uiValrothGUID); + Creature* temp = Unit::GetCreature(*me, m_uiValrothGUID); - if (!pTemp || !pTemp->isAlive()) + if (!temp || !temp->isAlive()) { DoScriptText(SAY_BREAKOUT8, me); m_uiWave_Timer = 5000; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 2dc4553c3fa..aea25af87bf 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -395,16 +395,16 @@ public: //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiRayneGUID)) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + temp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) + temp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) + temp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) + temp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiRayneGUID)) + temp->setDeathState(JUST_DIED); uiTirionGUID = 0; uiKorfaxGUID = 0; @@ -414,25 +414,25 @@ public: for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiDefenderGUID[i])) + temp->setDeathState(JUST_DIED); uiDefenderGUID[i] = 0; } for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiEarthshatterGUID[i])) + temp->setDeathState(JUST_DIED); uiEarthshatterGUID[i] = 0; } - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->Respawn(); - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - pTemp->Respawn(); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->Respawn(); - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->Respawn(); + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) + temp->Respawn(); + if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) + temp->Respawn(); + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) + temp->Respawn(); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->Respawn(); uiKoltiraGUID = 0; uiOrbazGUID = 0; @@ -440,26 +440,26 @@ public: uiLichKingGUID = 0; for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiAbominationGUID[i])) + temp->setDeathState(JUST_DIED); uiAbominationGUID[i] = 0; } for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiBehemothGUID[i])) + temp->setDeathState(JUST_DIED); uiBehemothGUID[i] = 0; } for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiGhoulGUID[i])) + temp->setDeathState(JUST_DIED); uiGhoulGUID[i] = 0; } for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) { - if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiWarriorGUID[i])) + temp->setDeathState(JUST_DIED); uiWarriorGUID[i] = 0; } } @@ -509,10 +509,10 @@ public: SetHoldState(true); SpawnNPC(); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN07, pTemp); - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN08, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN07, temp); + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN08, temp); for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) NPCChangeTarget(uiGhoulGUID[i]); @@ -529,10 +529,10 @@ public: me->Unmount(); me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->Unmount(); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->Unmount(); + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) + temp->Unmount(); + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) + temp->Unmount(); bIsBattle = true; break; @@ -547,35 +547,35 @@ public: DoScriptText(EMOTE_LIGHT_OF_DAWN05, me); if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) me->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); + if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) + temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); + if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) + temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); } break; @@ -583,10 +583,10 @@ public: DoScriptText(SAY_LIGHT_OF_DAWN27, me); me->SetStandState(UNIT_STAND_STATE_KNEEL); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) + temp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) + temp->SetStandState(UNIT_STAND_STATE_KNEEL); SetHoldState(true); break; case 5: @@ -604,8 +604,8 @@ public: break; case 8: me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - me->CastSpell(pTemp, SPELL_ASHBRINGER, true); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + me->CastSpell(temp, SPELL_ASHBRINGER, true); DoScriptText(EMOTE_LIGHT_OF_DAWN14, me); SetHoldState(true); break; @@ -663,10 +663,10 @@ public: uiPhase_timer = 500; if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) { - Unit* pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->setFaction(2084); - uiGhoulGUID[uiSummon_counter] = pTemp->GetGUID(); + Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->setFaction(2084); + uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } else @@ -681,10 +681,10 @@ public: uiPhase_timer = 500; if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) { - Unit* pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->setFaction(2084); - uiAbominationGUID[uiSummon_counter] = pTemp->GetGUID(); + Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->setFaction(2084); + uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } else @@ -699,10 +699,10 @@ public: uiPhase_timer = 500; if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) { - Unit* pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->setFaction(2084); - uiWarriorGUID[uiSummon_counter] = pTemp->GetGUID(); + Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->setFaction(2084); + uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } else @@ -717,10 +717,10 @@ public: uiPhase_timer = 500; if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) { - Unit* pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->setFaction(2084); - uiBehemothGUID[uiSummon_counter] = pTemp->GetGUID(); + Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->setFaction(2084); + uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; } else @@ -737,52 +737,52 @@ public: case 9: // charge begins SetHoldState(false); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + if (Creature* temp = Unit::GetCreature(*me, uiAbominationGUID[i])) + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + if (Creature* temp = Unit::GetCreature(*me, uiBehemothGUID[i])) + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + if (Creature* temp = Unit::GetCreature(*me, uiGhoulGUID[i])) + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + if (Creature* temp = Unit::GetCreature(*me, uiWarriorGUID[i])) + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); JumpToNextStep(5000); break; // ******* After battle ***************************************************************** case 11: // Tirion starts to speak - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN28, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN28, temp); JumpToNextStep(21000); break; case 12: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN29, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN29, temp); JumpToNextStep(13000); break; case 13: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN30, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN30, temp); JumpToNextStep(13000); break; @@ -793,22 +793,22 @@ public: break; case 15: // summon gate - if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Unit* temp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pTemp->CastSpell(pTemp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); - DoScriptText(EMOTE_LIGHT_OF_DAWN06, pTemp); - uiAlexandrosGUID = pTemp->GetGUID(); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + temp->CastSpell(temp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN06, temp); + uiAlexandrosGUID = temp->GetGUID(); } JumpToNextStep(4000); break; case 16: // Alexandros out - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) { - pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); - DoScriptText(SAY_LIGHT_OF_DAWN32, pTemp); + temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); + DoScriptText(SAY_LIGHT_OF_DAWN32, temp); } SetHoldState(false); // makes darion turns back JumpToNextStep(5000); @@ -821,103 +821,103 @@ public: break; case 18: // Darion's spirit out - if (Unit* pTemp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - DoScriptText(SAY_LIGHT_OF_DAWN35, pTemp); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - uiDarionGUID = pTemp->GetGUID(); + DoScriptText(SAY_LIGHT_OF_DAWN35, temp); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + uiDarionGUID = temp->GetGUID(); } JumpToNextStep(4000); break; case 19: // runs to father - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN07, pTemp); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); + DoScriptText(EMOTE_LIGHT_OF_DAWN07, temp); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); } JumpToNextStep(4000); break; case 20: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN36, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN36, temp); JumpToNextStep(4000); break; case 21: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN08, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN08, temp); JumpToNextStep(4000); break; case 22: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN37, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN37, temp); JumpToNextStep(8000); break; case 23: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN38, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN38, temp); JumpToNextStep(8000); break; case 24: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN39, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN39, temp); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); JumpToNextStep(15000); break; case 25: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN40, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN40, temp); JumpToNextStep(11000); break; case 26: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN41, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN41, temp); JumpToNextStep(5000); break; case 27: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - pTemp->setDeathState(JUST_DIED); + if (Creature* temp = Unit::GetCreature(*me, uiDarionGUID)) + temp->setDeathState(JUST_DIED); JumpToNextStep(24000); break; case 28: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN42, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN42, temp); JumpToNextStep(6000); break; case 29: // lich king spawns - if (Unit* pTemp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + if (Unit* temp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { - DoScriptText(SAY_LIGHT_OF_DAWN43, pTemp); - uiLichKingGUID = pTemp->GetGUID(); + DoScriptText(SAY_LIGHT_OF_DAWN43, temp); + uiLichKingGUID = temp->GetGUID(); if (Unit* pAlex = Unit::GetCreature(*me, uiAlexandrosGUID)) - pTemp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); + temp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); } JumpToNextStep(2000); break; case 30: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) // just hide him + if (Creature* temp = Unit::GetCreature(*me, uiAlexandrosGUID)) // just hide him { - DoScriptText(EMOTE_LIGHT_OF_DAWN09, pTemp); - pTemp->SetVisible(false); + DoScriptText(EMOTE_LIGHT_OF_DAWN09, temp); + temp->SetVisible(false); } - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - pTemp->InterruptNonMeleeSpells(false); - DoScriptText(SAY_LIGHT_OF_DAWN45, pTemp); + temp->InterruptNonMeleeSpells(false); + DoScriptText(SAY_LIGHT_OF_DAWN45, temp); } JumpToNextStep(3000); break; @@ -930,8 +930,8 @@ public: break; case 32: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27].x, LightofDawnLoc[27].y, LightofDawnLoc[27].z); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27].x, LightofDawnLoc[27].y, LightofDawnLoc[27].z); JumpToNextStep(6000); break; @@ -946,10 +946,10 @@ public: break; case 35: // Lich king counterattacks - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - pTemp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - DoScriptText(SAY_LIGHT_OF_DAWN46, pTemp); + temp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + DoScriptText(SAY_LIGHT_OF_DAWN46, temp); } me->SetSpeed(MOVE_RUN, 6.0f); me->SetStandState(UNIT_STAND_STATE_DEAD); @@ -963,33 +963,33 @@ public: break; case 38: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN47, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN47, temp); JumpToNextStep(8000); break; case 39: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN48, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN48, temp); JumpToNextStep(15000); break; case 40: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN49, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN49, temp); JumpToNextStep(17000); break; case 41: // Lich king - Apocalypse - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN11, pTemp); - DoScriptText(SAY_LIGHT_OF_DAWN51, pTemp); + DoScriptText(EMOTE_LIGHT_OF_DAWN11, temp); + DoScriptText(SAY_LIGHT_OF_DAWN51, temp); if (Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID)) { pTirion->SetStandState(UNIT_STAND_STATE_KNEEL); - //pTemp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working - pTemp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); + //temp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working + temp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); DoScriptText(EMOTE_LIGHT_OF_DAWN12, pTirion); } } @@ -1001,106 +1001,106 @@ public: float fLichPositionX = 0, fLichPositionY = 0, fLichPositionZ = 0; - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - fLichPositionX = pTemp->GetPositionX(); - fLichPositionY = pTemp->GetPositionY(); - fLichPositionZ = pTemp->GetPositionZ(); + fLichPositionX = temp->GetPositionX(); + fLichPositionY = temp->GetPositionY(); + fLichPositionZ = temp->GetPositionZ(); } if (fLichPositionX && fLichPositionY) { - Unit* pTemp; - pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->setFaction(me->getFaction()); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - uiDefenderGUID[0] = pTemp->GetGUID(); - - pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->setFaction(me->getFaction()); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - uiEarthshatterGUID[0] = pTemp->GetGUID(); + Unit* temp; + temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetSpeed(MOVE_RUN, 2.0f); + temp->setFaction(me->getFaction()); + temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiDefenderGUID[0] = temp->GetGUID(); + + temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetSpeed(MOVE_RUN, 2.0f); + temp->setFaction(me->getFaction()); + temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiEarthshatterGUID[0] = temp->GetGUID(); } - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - DoScriptText(SAY_LIGHT_OF_DAWN50, pTemp); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetSpeed(MOVE_RUN, 2.0f); + temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + DoScriptText(SAY_LIGHT_OF_DAWN50, temp); } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetSpeed(MOVE_RUN, 2.0f); + temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); + temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetSpeed(MOVE_RUN, 2.0f); + temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } } JumpToNextStep(4500); break; case 43: // They all got kicked - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN13, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN13, temp); - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + temp->SetSpeed(MOVE_RUN, 6.0f); + temp->SetStandState(UNIT_STAND_STATE_DEAD); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + temp->SetSpeed(MOVE_RUN, 6.0f); + temp->SetStandState(UNIT_STAND_STATE_DEAD); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + temp->SetSpeed(MOVE_RUN, 6.0f); + temp->SetStandState(UNIT_STAND_STATE_DEAD); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[0])) + if (Creature* temp = Unit::GetCreature(*me, uiDefenderGUID[0])) { - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + temp->SetSpeed(MOVE_RUN, 6.0f); + temp->SetStandState(UNIT_STAND_STATE_DEAD); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[0])) + if (Creature* temp = Unit::GetCreature(*me, uiEarthshatterGUID[0])) { - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + temp->SetSpeed(MOVE_RUN, 6.0f); + temp->SetStandState(UNIT_STAND_STATE_DEAD); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); } JumpToNextStep(3000); break; case 44: // make them stand up - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) + temp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) + temp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) + temp->SetStandState(UNIT_STAND_STATE_STAND); JumpToNextStep(1000); break; @@ -1121,182 +1121,182 @@ public: case 47: // Ashbringer rebirth me->SetStandState(UNIT_STAND_STATE_KNEEL); DoScriptText(EMOTE_LIGHT_OF_DAWN15, me); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING)); - pTemp->CastSpell(pTemp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false); + temp->SetStandState(UNIT_STAND_STATE_STAND); + temp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING)); + temp->CastSpell(temp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false); } JumpToNextStep(1000); break; case 48: // Show the cleansing effect (dawn of light) - //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) - // pGo->SetPhaseMask(128, true); + //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) + // go->SetPhaseMask(128, true); me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0, 0, 0, 0, 0, 30000); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - if (pTemp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER); - pTemp->CastSpell(pTemp, 41542, false); // workarounds, light expoded, makes it cool - pTemp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, 0)) + temp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER); + temp->CastSpell(temp, 41542, false); // workarounds, light expoded, makes it cool + temp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); } - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->InterruptNonMeleeSpells(false); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->InterruptNonMeleeSpells(false); JumpToNextStep(2500); break; case 49: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN54, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN54, temp); JumpToNextStep(4000); break; case 50: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN55, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN55, temp); JumpToNextStep(5000); break; case 51: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN56, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN56, temp); JumpToNextStep(1000); break; case 52: // Tiron charges - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - DoScriptText(EMOTE_LIGHT_OF_DAWN16, pTemp); - pTemp->CastSpell(pTemp, SPELL_TIRION_CHARGE, false); // jumping charge - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - pTemp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him + DoScriptText(EMOTE_LIGHT_OF_DAWN16, temp); + temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him } JumpToNextStep(1500); break; case 53: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN57, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN57, temp); JumpToNextStep(1000); break; case 54: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { - pTemp->SetSpeed(MOVE_RUN, 1.0f); + temp->SetSpeed(MOVE_RUN, 1.0f); me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 } JumpToNextStep(4000); break; case 55: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->SetStandState(UNIT_STAND_STATE_KNEEL); JumpToNextStep(2000); break; case 56: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->SetStandState(UNIT_STAND_STATE_STAND); JumpToNextStep(1500); break; case 57: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN58, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN58, temp); JumpToNextStep(10000); break; case 58: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN59, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN59, temp); JumpToNextStep(10000); break; case 59: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->CastSpell(pTemp, SPELL_TELEPORT_VISUAL, false); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->CastSpell(temp, SPELL_TELEPORT_VISUAL, false); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 1.0f); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6].x, LightofDawnLoc[6].y, LightofDawnLoc[6].z); + temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + temp->SetSpeed(MOVE_RUN, 1.0f); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6].x, LightofDawnLoc[6].y, LightofDawnLoc[6].z); } JumpToNextStep(2500); break; case 60: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here { - DoScriptText(EMOTE_LIGHT_OF_DAWN17, pTemp); - pTemp->Kill(pTemp); + DoScriptText(EMOTE_LIGHT_OF_DAWN17, temp); + temp->Kill(temp); } JumpToNextStep(10000); break; case 61: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN60, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN60, temp); JumpToNextStep(3000); break; case 62: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); + temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); } JumpToNextStep(5500); break; case 63: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); - DoScriptText(SAY_LIGHT_OF_DAWN61, pTemp); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); + DoScriptText(SAY_LIGHT_OF_DAWN61, temp); } JumpToNextStep(15000); break; case 64: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN62, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN62, temp); JumpToNextStep(7000); break; case 65: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN63, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN63, temp); JumpToNextStep(10000); break; case 66: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN64, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN64, temp); JumpToNextStep(11000); break; case 67: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN65, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN65, temp); JumpToNextStep(10000); break; case 68: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN66, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN66, temp); JumpToNextStep(8000); break; case 69: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN67, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN67, temp); JumpToNextStep(10000); break; @@ -1307,8 +1307,8 @@ public: break; case 71: - //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light - // pGo->SetPhaseMask(0, true); + //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light + // go->SetPhaseMask(0, true); { Map* map = me->GetMap(); // search players with in 50 yards for quest credit @@ -1331,14 +1331,14 @@ public: break; case 73: - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->DespawnOrUnsummon(); - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - pTemp->DespawnOrUnsummon(); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->DespawnOrUnsummon(); - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->DespawnOrUnsummon(); + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) + temp->DespawnOrUnsummon(); + if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) + temp->DespawnOrUnsummon(); + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) + temp->DespawnOrUnsummon(); + if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) + temp->DespawnOrUnsummon(); me->DespawnOrUnsummon(); break; } @@ -1419,12 +1419,12 @@ public: if (uiFight_duration <= diff + 5000) { if (!uiTirionGUID) - if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) + if (Unit* temp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) { - pTemp->setFaction(me->getFaction()); - pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); - DoScriptText(SAY_LIGHT_OF_DAWN25, pTemp); - uiTirionGUID = pTemp->GetGUID(); + temp->setFaction(me->getFaction()); + temp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + DoScriptText(SAY_LIGHT_OF_DAWN25, temp); + uiTirionGUID = temp->GetGUID(); } } if (uiFight_duration <= diff) @@ -1453,69 +1453,69 @@ public: for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) DespawnNPC(uiWarriorGUID[i]); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); + temp->RemoveAllAuras(); + temp->DeleteThreatList(); + temp->CombatStop(true); + temp->AttackStop(); + temp->setFaction(me->getFaction()); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); + temp->RemoveAllAuras(); + temp->DeleteThreatList(); + temp->CombatStop(true); + temp->AttackStop(); + temp->setFaction(me->getFaction()); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); + temp->RemoveAllAuras(); + temp->DeleteThreatList(); + temp->CombatStop(true); + temp->AttackStop(); + temp->setFaction(me->getFaction()); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); } DespawnNPC(uiRayneGUID); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); - pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + temp->RemoveAllAuras(); + temp->DeleteThreatList(); + temp->CombatStop(true); + temp->AttackStop(); + temp->setFaction(me->getFaction()); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); + temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN04, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN04, temp); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); - pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + temp->RemoveAllAuras(); + temp->DeleteThreatList(); + temp->CombatStop(true); + temp->AttackStop(); + temp->setFaction(me->getFaction()); + temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); + temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN26, pTemp); + if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN26, temp); SetHoldState(false); @@ -1533,130 +1533,130 @@ public: void NPCChangeTarget(uint64 ui_GUID) { - if (Creature* pTemp = Unit::GetCreature(*me, ui_GUID)) - if (pTemp->isAlive()) + if (Creature* temp = Unit::GetCreature(*me, ui_GUID)) + if (temp->isAlive()) if (Unit* pTarger = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (pTarger->isAlive()) { - // pTemp->DeleteThreatList(); - pTemp->AddThreat(pTarger, 0.0f); - pTemp->AI()->AttackStart(pTarger); - pTemp->SetInCombatWith(pTarger); - pTarger->SetInCombatWith(pTemp); - // pTemp->GetMotionMaster()->MoveChase(pTarger, 20.0f); + // temp->DeleteThreatList(); + temp->AddThreat(pTarger, 0.0f); + temp->AI()->AttackStart(pTarger); + temp->SetInCombatWith(pTarger); + pTarger->SetInCombatWith(temp); + // temp->GetMotionMaster()->MoveChase(pTarger, 20.0f); } } void SpawnNPC() { - Unit* pTemp = NULL; + Unit* temp = NULL; // Death for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiGhoulGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiGhoulGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiGhoulGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2084); + uiGhoulGUID[i] = temp->GetGUID(); } } for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiAbominationGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiAbominationGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiAbominationGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2084); + uiAbominationGUID[i] = temp->GetGUID(); } } for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiWarriorGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiWarriorGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiWarriorGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2084); + uiWarriorGUID[i] = temp->GetGUID(); } } for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiBehemothGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiBehemothGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiBehemothGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2084); + uiBehemothGUID[i] = temp->GetGUID(); } } // Dawn for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiDefenderGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiDefenderGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiDefenderGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiDefenderGUID[i] = temp->GetGUID(); } } for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) { - pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i]); - if (!pTemp) + temp = Unit::GetCreature(*me, uiEarthshatterGUID[i]); + if (!temp) { - pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiEarthshatterGUID[i] = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiEarthshatterGUID[i] = temp->GetGUID(); } } - pTemp = Unit::GetCreature(*me, uiKorfaxGUID); - if (!pTemp) + temp = Unit::GetCreature(*me, uiKorfaxGUID); + if (!temp) { - pTemp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiKorfaxGUID = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiKorfaxGUID = temp->GetGUID(); } - pTemp = Unit::GetCreature(*me, uiMaxwellGUID); - if (!pTemp) + temp = Unit::GetCreature(*me, uiMaxwellGUID); + if (!temp) { - pTemp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiMaxwellGUID = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiMaxwellGUID = temp->GetGUID(); } - pTemp = Unit::GetCreature(*me, uiEligorGUID); - if (!pTemp) + temp = Unit::GetCreature(*me, uiEligorGUID); + if (!temp) { - pTemp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiEligorGUID = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiEligorGUID = temp->GetGUID(); } - pTemp = Unit::GetCreature(*me, uiRayneGUID); - if (!pTemp) + temp = Unit::GetCreature(*me, uiRayneGUID); + if (!temp) { - pTemp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiRayneGUID = pTemp->GetGUID(); + temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + temp->setFaction(2089); + me->AddThreat(temp, 0.0f); + uiRayneGUID = temp->GetGUID(); } } void DespawnNPC(uint64 pGUID) { - if (Creature* pTemp = Unit::GetCreature(*me, pGUID)) - if (pTemp->isAlive()) + if (Creature* temp = Unit::GetCreature(*me, pGUID)) + if (temp->isAlive()) { - pTemp->SetVisible(false); - pTemp->Kill(pTemp); + temp->SetVisible(false); + temp->Kill(temp); } } }; |
