diff options
author | Anubisss <none@none> | 2010-04-02 15:41:37 +0200 |
---|---|---|
committer | Anubisss <none@none> | 2010-04-02 15:41:37 +0200 |
commit | 08b4748e622a91b86b1918400836f862133cbf71 (patch) | |
tree | 0f0a582a6ce9ef3c4f01dc089af56014c16f9126 /src/scripts/outland/netherstorm.cpp | |
parent | 7c4f2f520f4047b10d94e44f6af1c910ff4bdbcf (diff) |
Use GUIDs instead of "global" pointers in zone scripts.
This commit is like that: 7714 / rce505237e4aa
And use const_iterators where it is possible.
--HG--
branch : trunk
Diffstat (limited to 'src/scripts/outland/netherstorm.cpp')
-rw-r--r-- | src/scripts/outland/netherstorm.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scripts/outland/netherstorm.cpp b/src/scripts/outland/netherstorm.cpp index 25dba020be4..992a4f2dc85 100644 --- a/src/scripts/outland/netherstorm.cpp +++ b/src/scripts/outland/netherstorm.cpp @@ -79,7 +79,7 @@ struct npc_manaforge_control_consoleAI : public ScriptedAI Wave = false; someplayer = 0; goConsole = 0; - Creature* add = NULL; + add = NULL; } void EnterCombat(Unit *who) { return; } @@ -296,8 +296,7 @@ bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo) pPlayer->SendPreparedQuest(pGo->GetGUID()); } - Creature* manaforge; - manaforge = NULL; + Creature* manaforge = NULL; switch(pGo->GetAreaId()) { @@ -696,6 +695,7 @@ struct mob_phase_hunterAI : public ScriptedAI float HpPercent; Player *pPlayer; + uint64 PlayerGUID; uint32 ManaBurnTimer; @@ -707,7 +707,7 @@ struct mob_phase_hunterAI : public ScriptedAI WeakPercent = 25 + (rand() % 16); // 25-40 HpPercent = 0.0f; - pPlayer = NULL; + PlayerGUID = 0; ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd @@ -718,7 +718,7 @@ struct mob_phase_hunterAI : public ScriptedAI void EnterCombat(Unit *who) { if (who->GetTypeId() == TYPEID_PLAYER) - pPlayer = CAST_PLR(who); + PlayerGUID = who->GetGUID(); } void SpellHit(Unit *caster, const SpellEntry *spell) @@ -765,7 +765,7 @@ struct mob_phase_hunterAI : public ScriptedAI ManaBurnTimer = 3500; } else ManaBurnTimer -= diff; - if (pPlayer) // start: support for quest 10190 + if (Player *pPlayer = Unit::GetPlayer(PlayerGUID)) // start: support for quest 10190 { if (!Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent) && pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE) |