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
This commit is contained in:
click
2010-05-01 02:59:48 +02:00
parent 3eccb81ee3
commit 320cbdb2af
4 changed files with 60 additions and 60 deletions
+17 -17
View File
@@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
{ {
//Say some stuff //Say some stuff
DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL); DoSay(SAY_AGGRO,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,8280); DoPlaySoundToSet(me,8280);
} }
//*** HANDLED FUNCTION *** //*** HANDLED FUNCTION ***
@@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
//Out of combat timers //Out of combat timers
if (!m_creature->getVictim()) if (!me->getVictim())
{ {
//Random Say timer //Random Say timer
if (Say_Timer < diff) if (Say_Timer < diff)
@@ -111,27 +111,27 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
{ {
case 0: case 0:
DoYell(SAY_RANDOM_0,LANG_UNIVERSAL,NULL); 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; break;
case 1: case 1:
DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL); DoYell(SAY_RANDOM_1,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,8818); DoPlaySoundToSet(me,8818);
break; break;
case 2: case 2:
DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL); DoYell(SAY_RANDOM_2,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,8041); DoPlaySoundToSet(me,8041);
break; break;
case 3: case 3:
DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL); DoYell(SAY_RANDOM_3,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,8581); DoPlaySoundToSet(me,8581);
break; break;
case 4: case 4:
DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL); DoYell(SAY_RANDOM_4,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,8791); DoPlaySoundToSet(me,8791);
break; break;
} }
@@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
//Rebuff timer //Rebuff timer
if (Rebuff_Timer < diff) if (Rebuff_Timer < diff)
{ {
DoCast(m_creature,SPELL_BUFF); DoCast(me,SPELL_BUFF);
Rebuff_Timer = 900000; //Rebuff agian in 15 minutes Rebuff_Timer = 900000; //Rebuff agian in 15 minutes
}else Rebuff_Timer -= diff; }else Rebuff_Timer -= diff;
} }
@@ -155,9 +155,9 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
{ {
//Cast spell one on our current target. //Cast spell one on our current target.
if (rand()%50 > 10) if (rand()%50 > 10)
DoCast(m_creature->getVictim(),SPELL_ONE_ALT); DoCast(me->getVictim(),SPELL_ONE_ALT);
else if (m_creature->IsWithinDist(m_creature->getVictim(), 25)) else if (me->IsWithinDist(me->getVictim(), 25))
DoCast(m_creature->getVictim(),SPELL_ONE); DoCast(me->getVictim(),SPELL_ONE);
Spell_1_Timer = 5000; Spell_1_Timer = 5000;
}else Spell_1_Timer -= diff; }else Spell_1_Timer -= diff;
@@ -166,7 +166,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
if (Spell_2_Timer < diff) if (Spell_2_Timer < diff)
{ {
//Cast spell one on our current target. //Cast spell one on our current target.
DoCast(m_creature->getVictim(),SPELL_TWO); DoCast(me->getVictim(),SPELL_TWO);
Spell_2_Timer = 37000; Spell_2_Timer = 37000;
}else Spell_2_Timer -= diff; }else Spell_2_Timer -= diff;
@@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
if (Spell_3_Timer < diff) if (Spell_3_Timer < diff)
{ {
//Cast spell one on our current target. //Cast spell one on our current target.
DoCast(m_creature->getVictim(),SPELL_THREE); DoCast(me->getVictim(),SPELL_THREE);
Spell_3_Timer = 19000; Spell_3_Timer = 19000;
}else Spell_3_Timer -= diff; }else Spell_3_Timer -= diff;
@@ -186,9 +186,9 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
if (Beserk_Timer < diff) if (Beserk_Timer < diff)
{ {
//Say our line then cast uber death spell //Say our line then cast uber death spell
DoPlaySoundToSet(m_creature,8588); DoPlaySoundToSet(me,8588);
DoYell(SAY_BESERK,LANG_UNIVERSAL,m_creature->getVictim()); DoYell(SAY_BESERK,LANG_UNIVERSAL,me->getVictim());
DoCast(m_creature->getVictim(),SPELL_BESERK); DoCast(me->getVictim(),SPELL_BESERK);
//Cast our beserk spell agian in 12 seconds if we didn't kill everyone //Cast our beserk spell agian in 12 seconds if we didn't kill everyone
Beserk_Timer = 12000; Beserk_Timer = 12000;
@@ -201,7 +201,7 @@ struct TRINITY_DLL_DECL custom_exampleAI : public ScriptedAI
//Go to next phase //Go to next phase
Phase++; Phase++;
DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL); DoYell(SAY_PHASE,LANG_UNIVERSAL,NULL);
DoCast(m_creature,SPELL_ENRAGE); DoCast(me,SPELL_ENRAGE);
}else Phase_Timer -= diff; }else Phase_Timer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
+22 -22
View File
@@ -57,24 +57,24 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
switch (i) switch (i)
{ {
case 1: case 1:
m_creature->Say(SAY_WALK, LANG_UNIVERSAL, 0); me->Say(SAY_WALK, LANG_UNIVERSAL, 0);
break; break;
case 3: case 3:
{ {
m_creature->Say(SAY_ATTACK, LANG_UNIVERSAL, 0); me->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); Creature* temp = me->SummonCreature(21878, me->GetPositionX()+5, me->GetPositionY()+7, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
if (temp) if (temp)
temp->AI()->AttackStart(m_creature); temp->AI()->AttackStart(me);
} }
break; break;
case 4: case 4:
{ {
m_creature->Say(SAY_TIME_TO_GO, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_TIME_TO_GO, LANG_UNIVERSAL, PlayerGUID);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
Unit* temp = Unit::GetUnit(*m_creature, PlayerGUID); Unit* temp = Unit::GetUnit(*me, PlayerGUID);
if (temp) if (temp)
{ {
temp->MonsterSay(SAY_BYE, LANG_UNIVERSAL, 0); temp->MonsterSay(SAY_BYE, LANG_UNIVERSAL, 0);
@@ -88,8 +88,8 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
void Aggro(Unit*) void Aggro(Unit*)
{ {
if (HasEscortState(STATE_ESCORT_ESCORTING)) if (HasEscortState(STATE_ESCORT_ESCORTING))
m_creature->Say(SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); me->Say(SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID);
else m_creature->Say(SAY_AGGRO2, LANG_UNIVERSAL, 0); else me->Say(SAY_AGGRO2, LANG_UNIVERSAL, 0);
} }
void Reset() void Reset()
@@ -102,16 +102,16 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
{ {
if (HasEscortState(STATE_ESCORT_ESCORTING)) if (HasEscortState(STATE_ESCORT_ESCORTING))
{ {
//killer = m_creature when player got to far from creature //killer = me when player got to far from creature
if (killer == m_creature) if (killer == me)
{ {
Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); Unit *pTemp = Unit::GetUnit(*me,PlayerGUID);
if (pTemp) if (pTemp)
DoWhisper(WHISPER_TOO_FAR, 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) void UpdateAI(const uint32 diff)
@@ -120,12 +120,12 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
npc_escortAI::UpdateAI(diff); npc_escortAI::UpdateAI(diff);
//Combat check //Combat check
if (m_creature->isInCombat() && m_creature->getVictim()) if (me->isInCombat() && me->getVictim())
{ {
if (DeathCoilTimer < diff) if (DeathCoilTimer < diff)
{ {
m_creature->Say(SAY_DEATHCOIL, LANG_UNIVERSAL, 0); me->Say(SAY_DEATHCOIL, LANG_UNIVERSAL, 0);
m_creature->CastSpell(m_creature->getVictim(), 33130, false); me->CastSpell(me->getVictim(), 33130, false);
DeathCoilTimer = 4000; DeathCoilTimer = 4000;
}else DeathCoilTimer -= diff; }else DeathCoilTimer -= diff;
@@ -135,14 +135,14 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
if (HasEscortState(STATE_ESCORT_ESCORTING)) if (HasEscortState(STATE_ESCORT_ESCORTING))
if (ChatTimer < diff) if (ChatTimer < diff)
{ {
if (m_creature->HasAura(3593, 0)) if (me->HasAura(3593, 0))
{ {
m_creature->Say(SAY_FIREWORKS, LANG_UNIVERSAL, 0); me->Say(SAY_FIREWORKS, LANG_UNIVERSAL, 0);
m_creature->CastSpell(m_creature, 11540, false); me->CastSpell(me, 11540, false);
}else }else
{ {
m_creature->Say(SAY_BUFF, LANG_UNIVERSAL, 0); me->Say(SAY_BUFF, LANG_UNIVERSAL, 0);
m_creature->CastSpell(m_creature, 3593, false); me->CastSpell(me, 3593, false);
} }
ChatTimer = 12000; ChatTimer = 12000;
@@ -29,7 +29,7 @@ EndScriptData */
// highlord mograine // highlord mograine
#define SPELL_MARK_OF_MOGRAINE 28834 #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_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." #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() void InitialYell()
{ {
if (!m_creature->isInCombat()) if (!me->isInCombat())
{ {
switch(rand()%3) switch(rand()%3)
{ {
case 0: case 0:
DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_AGGRO1); DoPlaySoundToSet(me,SOUND_AGGRO1);
break; break;
case 1: case 1:
DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_AGGRO2); DoPlaySoundToSet(me,SOUND_AGGRO2);
break; break;
case 2: case 2:
DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_AGGRO3); DoPlaySoundToSet(me,SOUND_AGGRO3);
break; break;
} }
} }
@@ -100,11 +100,11 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
{ {
case 0: case 0:
DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_SLAY1); DoPlaySoundToSet(me,SOUND_SLAY1);
break; break;
case 1: case 1:
DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature,SOUND_SLAY2); DoPlaySoundToSet(me,SOUND_SLAY2);
break; break;
} }
} }
@@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
void JustDied(Unit* Killer) void JustDied(Unit* Killer)
{ {
DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
DoPlaySoundToSet(m_creature, SOUND_DEATH); DoPlaySoundToSet(me, SOUND_DEATH);
} }
void Aggro(Unit *who) void Aggro(Unit *who)
@@ -128,24 +128,24 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
// Mark of Mograine // Mark of Mograine
if (Mark_Timer < diff) if (Mark_Timer < diff)
{ {
DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); DoCast(me->getVictim(),SPELL_MARK_OF_MOGRAINE);
Mark_Timer = 12000; Mark_Timer = 12000;
}else Mark_Timer -= diff; }else Mark_Timer -= diff;
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds // 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) if (ShieldWall1)
{ {
DoCast(m_creature,SPELL_SHIELDWALL); DoCast(me,SPELL_SHIELDWALL);
ShieldWall1 = false; ShieldWall1 = false;
} }
} }
if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) if (ShieldWall2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
{ {
if (ShieldWall2) if (ShieldWall2)
{ {
DoCast(m_creature,SPELL_SHIELDWALL); DoCast(me,SPELL_SHIELDWALL);
ShieldWall2 = false; ShieldWall2 = false;
} }
} }
@@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
{ {
if (rand()%4 == 1) // 1/4 if (rand()%4 == 1) // 1/4
{ {
DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); DoCast(me->getVictim(),SPELL_RIGHTEOUS_FIRE);
} }
RighteousFire_Timer = 2000; RighteousFire_Timer = 2000;
}else RighteousFire_Timer -= diff; }else RighteousFire_Timer -= diff;
+2 -2
View File
@@ -370,11 +370,11 @@ struct npc_injured_goblinAI : public npc_escortAI
switch (i) switch (i)
{ {
case 26: case 26:
DoScriptText(SAY_END_WP_REACHED, m_creature, pPlayer); DoScriptText(SAY_END_WP_REACHED, me, pPlayer);
break; break;
case 27: case 27:
if (pPlayer) if (pPlayer)
pPlayer->GroupEventHappens(QUEST_BITTER_DEPARTURE, m_creature); pPlayer->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
break; break;
} }
} }