diff options
author | click <none@none> | 2010-05-01 02:59:48 +0200 |
---|---|---|
committer | click <none@none> | 2010-05-01 02:59:48 +0200 |
commit | 320cbdb2af8ffc0cfee3fda4eb9ae5b29bca9334 (patch) | |
tree | 49a0b8d5e9a5b0a0bee5ad1a71708e967522a66e | |
parent | 3eccb81ee36ad1ed78ec219c069e666944878056 (diff) |
Correction in scripts (m_creature -> me) - fixes #1954
(Also corrects some old scripts that seems to have been done the same way)
--HG--
branch : trunk
-rw-r--r-- | src/scripts/custom/custom_example.cpp | 34 | ||||
-rw-r--r-- | src/scripts/custom/test.cpp | 44 | ||||
-rw-r--r-- | src/scripts/northrend/naxxramas/boss_highlord_mograine.cpp | 28 | ||||
-rw-r--r-- | src/scripts/northrend/storm_peaks.cpp | 14 |
4 files changed, 60 insertions, 60 deletions
diff --git a/src/scripts/custom/custom_example.cpp b/src/scripts/custom/custom_example.cpp index 5fec0646101..0e230ba901d 100644 --- a/src/scripts/custom/custom_example.cpp +++ b/src/scripts/custom/custom_example.cpp @@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI { //Say some stuff DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8280); + DoPlaySoundToSet(me,8280); } //*** HANDLED FUNCTION *** @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI void UpdateAI(const uint32 diff) { //Out of combat timers - if (!m_creature->getVictim()) + if (!me->getVictim()) { //Random Say timer if (Say_Timer < diff) @@ -111,27 +111,27 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI { case 0: DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc + DoPlaySoundToSet(me,8831); //8831 is the index of the sound we are playing. You find these numbers in SoundEntries.dbc break; case 1: DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8818); + DoPlaySoundToSet(me,8818); break; case 2: DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8041); + DoPlaySoundToSet(me,8041); break; case 3: DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8581); + DoPlaySoundToSet(me,8581); break; case 4: DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,8791); + DoPlaySoundToSet(me,8791); break; } @@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI //Rebuff timer if (Rebuff_Timer < diff) { - DoCast(m_creature,SPELL_BUFF); + DoCast(me,SPELL_BUFF); Rebuff_Timer = 900000; //Rebuff agian in 15 minutes }else Rebuff_Timer -= diff; } @@ -155,9 +155,9 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI { //Cast spell one on our current target. if (rand()%50 > 10) - DoCast(m_creature->getVictim(),SPELL_ONE_ALT); - else if (m_creature->IsWithinDist(m_creature->getVictim(), 25)) - DoCast(m_creature->getVictim(),SPELL_ONE); + DoCast(me->getVictim(),SPELL_ONE_ALT); + else if (me->IsWithinDist(me->getVictim(), 25)) + DoCast(me->getVictim(),SPELL_ONE); Spell_1_Timer = 5000; }else Spell_1_Timer -= diff; @@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI if (Spell_2_Timer < diff) { //Cast spell one on our current target. - DoCast(m_creature->getVictim(),SPELL_TWO); + DoCast(me->getVictim(),SPELL_TWO); Spell_2_Timer = 37000; }else Spell_2_Timer -= diff; @@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI if (Spell_3_Timer < diff) { //Cast spell one on our current target. - DoCast(m_creature->getVictim(),SPELL_THREE); + DoCast(me->getVictim(),SPELL_THREE); Spell_3_Timer = 19000; }else Spell_3_Timer -= diff; @@ -186,9 +186,9 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI if (Beserk_Timer < diff) { //Say our line then cast uber death spell - DoPlaySoundToSet(m_creature,8588); - DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim()); - DoCast(m_creature->getVictim(),SPELL_BESERK); + DoPlaySoundToSet(me,8588); + DoYell(SAY_BESERK,LANG_UNIVERSAL,me->getVictim()); + DoCast(me->getVictim(),SPELL_BESERK); //Cast our beserk spell agian in 12 seconds if we didn't kill everyone Beserk_Timer = 12000; @@ -201,7 +201,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI //Go to next phase Phase++; DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL); - DoCast(m_creature,SPELL_ENRAGE); + DoCast(me,SPELL_ENRAGE); }else Phase_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/scripts/custom/test.cpp b/src/scripts/custom/test.cpp index fb29a0a05b2..aa9e6879075 100644 --- a/src/scripts/custom/test.cpp +++ b/src/scripts/custom/test.cpp @@ -57,24 +57,24 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI switch (i) { case 1: - m_creature->Say(SAY_WALK, LANG_UNIVERSAL, 0); + me->Say(SAY_WALK, LANG_UNIVERSAL, 0); break; case 3: { - m_creature->Say(SAY_ATTACK, LANG_UNIVERSAL, 0); - Creature* temp = m_creature->SummonCreature(21878, m_creature->GetPositionX()+5, m_creature->GetPositionY()+7, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); + me->Say(SAY_ATTACK, LANG_UNIVERSAL, 0); + Creature* temp = me->SummonCreature(21878, me->GetPositionX()+5, me->GetPositionY()+7, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); if (temp) - temp->AI()->AttackStart(m_creature); + temp->AI()->AttackStart(me); } break; case 4: { - m_creature->Say(SAY_TIME_TO_GO, LANG_UNIVERSAL, PlayerGUID); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + me->Say(SAY_TIME_TO_GO, LANG_UNIVERSAL, PlayerGUID); + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID); + Unit* temp = Unit::GetUnit(*me, PlayerGUID); if (temp) { temp->MonsterSay(SAY_BYE, LANG_UNIVERSAL, 0); @@ -88,8 +88,8 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI void Aggro(Unit*) { if (HasEscortState(STATE_ESCORT_ESCORTING)) - m_creature->Say(SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); - else m_creature->Say(SAY_AGGRO2, LANG_UNIVERSAL, 0); + me->Say(SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + else me->Say(SAY_AGGRO2, LANG_UNIVERSAL, 0); } void Reset() @@ -102,16 +102,16 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI { if (HasEscortState(STATE_ESCORT_ESCORTING)) { - //killer = m_creature when player got to far from creature - if (killer == m_creature) + //killer = me when player got to far from creature + if (killer == me) { - Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); + Unit *pTemp = Unit::GetUnit(*me,PlayerGUID); if (pTemp) DoWhisper(WHISPER_TOO_FAR, pTemp); } - else m_creature->Say(SAY_DIE1, LANG_UNIVERSAL, PlayerGUID); + else me->Say(SAY_DIE1, LANG_UNIVERSAL, PlayerGUID); } - else m_creature->Say(SAY_DIE2, LANG_UNIVERSAL, 0); + else me->Say(SAY_DIE2, LANG_UNIVERSAL, 0); } void UpdateAI(const uint32 diff) @@ -120,12 +120,12 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI npc_escortAI::UpdateAI(diff); //Combat check - if (m_creature->isInCombat() && m_creature->getVictim()) + if (me->isInCombat() && me->getVictim()) { if (DeathCoilTimer < diff) { - m_creature->Say(SAY_DEATHCOIL, LANG_UNIVERSAL, 0); - m_creature->CastSpell(m_creature->getVictim(), 33130, false); + me->Say(SAY_DEATHCOIL, LANG_UNIVERSAL, 0); + me->CastSpell(me->getVictim(), 33130, false); DeathCoilTimer = 4000; }else DeathCoilTimer -= diff; @@ -135,14 +135,14 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI if (HasEscortState(STATE_ESCORT_ESCORTING)) if (ChatTimer < diff) { - if (m_creature->HasAura(3593, 0)) + if (me->HasAura(3593, 0)) { - m_creature->Say(SAY_FIREWORKS, LANG_UNIVERSAL, 0); - m_creature->CastSpell(m_creature, 11540, false); + me->Say(SAY_FIREWORKS, LANG_UNIVERSAL, 0); + me->CastSpell(me, 11540, false); }else { - m_creature->Say(SAY_BUFF, LANG_UNIVERSAL, 0); - m_creature->CastSpell(m_creature, 3593, false); + me->Say(SAY_BUFF, LANG_UNIVERSAL, 0); + me->CastSpell(me, 3593, false); } ChatTimer = 12000; diff --git a/src/scripts/northrend/naxxramas/boss_highlord_mograine.cpp b/src/scripts/northrend/naxxramas/boss_highlord_mograine.cpp index 9bef8ebd3f9..4eb72a3780e 100644 --- a/src/scripts/northrend/naxxramas/boss_highlord_mograine.cpp +++ b/src/scripts/northrend/naxxramas/boss_highlord_mograine.cpp @@ -29,7 +29,7 @@ EndScriptData */ // highlord mograine #define SPELL_MARK_OF_MOGRAINE 28834 -#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim() +#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. me->GetVictim() #define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." #define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." @@ -74,21 +74,21 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI void InitialYell() { - if (!m_creature->isInCombat()) + if (!me->isInCombat()) { switch(rand()%3) { case 0: DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO1); + DoPlaySoundToSet(me,SOUND_AGGRO1); break; case 1: DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO2); + DoPlaySoundToSet(me,SOUND_AGGRO2); break; case 2: DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO3); + DoPlaySoundToSet(me,SOUND_AGGRO3); break; } } @@ -100,11 +100,11 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI { case 0: DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY1); + DoPlaySoundToSet(me,SOUND_SLAY1); break; case 1: DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY2); + DoPlaySoundToSet(me,SOUND_SLAY2); break; } } @@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI void JustDied(Unit* Killer) { DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); + DoPlaySoundToSet(me, SOUND_DEATH); } void Aggro(Unit *who) @@ -128,24 +128,24 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI // Mark of Mograine if (Mark_Timer < diff) { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); + DoCast(me->getVictim(),SPELL_MARK_OF_MOGRAINE); Mark_Timer = 12000; }else Mark_Timer -= diff; // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + if (ShieldWall1 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50) { if (ShieldWall1) { - DoCast(m_creature,SPELL_SHIELDWALL); + DoCast(me,SPELL_SHIELDWALL); ShieldWall1 = false; } } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + if (ShieldWall2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) { if (ShieldWall2) { - DoCast(m_creature,SPELL_SHIELDWALL); + DoCast(me,SPELL_SHIELDWALL); ShieldWall2 = false; } } @@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI { if (rand()%4 == 1) // 1/4 { - DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); + DoCast(me->getVictim(),SPELL_RIGHTEOUS_FIRE); } RighteousFire_Timer = 2000; }else RighteousFire_Timer -= diff; diff --git a/src/scripts/northrend/storm_peaks.cpp b/src/scripts/northrend/storm_peaks.cpp index f71f3d2b935..08e5ca7c2d4 100644 --- a/src/scripts/northrend/storm_peaks.cpp +++ b/src/scripts/northrend/storm_peaks.cpp @@ -365,16 +365,16 @@ struct npc_injured_goblinAI : public npc_escortAI npc_injured_goblinAI(Creature* pCreature) : npc_escortAI(pCreature) { } void WaypointReached(uint32 i) - { - Player* pPlayer = GetPlayerForEscort(); + { + Player* pPlayer = GetPlayerForEscort(); switch (i) { case 26: - DoScriptText(SAY_END_WP_REACHED, m_creature, pPlayer); + DoScriptText(SAY_END_WP_REACHED, me, pPlayer); break; case 27: if (pPlayer) - pPlayer->GroupEventHappens(QUEST_BITTER_DEPARTURE, m_creature); + pPlayer->GroupEventHappens(QUEST_BITTER_DEPARTURE, me); break; } } @@ -387,7 +387,7 @@ struct npc_injured_goblinAI : public npc_escortAI { Player* pPlayer = GetPlayerForEscort(); if (HasEscortState(STATE_ESCORT_ESCORTING) && pPlayer) - pPlayer->FailQuest(QUEST_BITTER_DEPARTURE); + pPlayer->FailQuest(QUEST_BITTER_DEPARTURE); } void UpdateAI(const uint32 uiDiff) @@ -433,7 +433,7 @@ bool GossipSelect_npc_injured_goblin(Player* pPlayer, Creature* pCreature, uint3 if (uiAction == GOSSIP_ACTION_INFO_DEF+1) { - pEscortAI->Start(true, true, pPlayer->GetGUID()); + pEscortAI->Start(true, true, pPlayer->GetGUID()); pCreature->setFaction(113); } return true; @@ -483,7 +483,7 @@ void AddSC_storm_peaks() newscript = new Script; newscript->Name = "npc_injured_goblin"; - newscript->GetAI = &GetAI_npc_injured_goblin; + newscript->GetAI = &GetAI_npc_injured_goblin; newscript->pGossipHello = &GossipHello_npc_injured_goblin; newscript->pGossipSelect = &GossipSelect_npc_injured_goblin; newscript->pQuestAccept = &QuestAccept_npc_injured_goblin; |