aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/custom
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/custom')
-rw-r--r--src/scripts/custom/custom_example.cpp34
-rw-r--r--src/scripts/custom/test.cpp44
2 files changed, 39 insertions, 39 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;