Convert a bunch of World scripts to the new system.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-06 17:07:41 -07:00
parent c2ca2e1c98
commit f73e952de3
10 changed files with 3860 additions and 3850 deletions
+85 -95
View File
@@ -33,114 +33,104 @@ enum eEnums
SPELL_SLEEP = 24777,
SPELL_NOXIOUSBREATH = 24818,
SPELL_TAILSWEEP = 15847,
//SPELL_MARKOFNATURE = 25040, // Not working
SPELL_VOLATILEINFECTION = 24928,
SPELL_CORRUPTIONOFEARTH = 24910
};
struct boss_emerissAI : public ScriptedAI
class boss_emeriss : public CreatureScript
{
boss_emerissAI(Creature *c) : ScriptedAI(c) {}
public:
boss_emeriss() : CreatureScript("boss_emeriss") { }
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
//uint32 m_uiMarkOfNature_Timer;
uint32 m_uiVolatileInfection_Timer;
uint32 m_uiCorruptionsCasted;
void Reset()
struct boss_emerissAI : public ScriptedAI
{
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
//m_uiMarkOfNature_Timer = 45000;
m_uiVolatileInfection_Timer = 12000;
m_uiCorruptionsCasted = 0;
}
boss_emerissAI(Creature *c) : ScriptedAI(c) {}
void EnterCombat(Unit* /*pWho*/)
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
uint32 m_uiVolatileInfection_Timer;
uint32 m_uiCorruptionsCasted;
void Reset()
{
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
m_uiVolatileInfection_Timer = 12000;
m_uiCorruptionsCasted = 0;
}
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%8000;
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//VolatileInfection_Timer
if (m_uiVolatileInfection_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_VOLATILEINFECTION);
m_uiVolatileInfection_Timer = 7000 + rand()%5000;
}
else
m_uiVolatileInfection_Timer -= uiDiff;
//CorruptionofEarth_Timer
//CorruptionofEarth at 75%, 50% and 25%
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
{
++m_uiCorruptionsCasted; // prevent casting twice on same hp
DoScriptText(SAY_CASTCORRUPTION, me);
DoCast(me->getVictim(), SPELL_CORRUPTIONOFEARTH);
}
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%8000;
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
// m_uiMarkOfNature_Timer -= uiDiff;
//VolatileInfection_Timer
if (m_uiVolatileInfection_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_VOLATILEINFECTION);
m_uiVolatileInfection_Timer = 7000 + rand()%5000;
}
else
m_uiVolatileInfection_Timer -= uiDiff;
//CorruptionofEarth_Timer
//CorruptionofEarth at 75%, 50% and 25%
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
{
++m_uiCorruptionsCasted; // prevent casting twice on same hp
DoScriptText(SAY_CASTCORRUPTION, me);
DoCast(me->getVictim(), SPELL_CORRUPTIONOFEARTH);
}
DoMeleeAttackIfReady();
return new boss_emerissAI(creature);
}
};
CreatureAI* GetAI_boss_emeriss(Creature* pCreature)
{
return new boss_emerissAI (pCreature);
}
void AddSC_boss_emeriss()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_emeriss";
newscript->GetAI = &GetAI_boss_emeriss;
newscript->RegisterSelf();
new boss_emeriss;
}
+164 -174
View File
@@ -34,7 +34,6 @@ enum eEnums
SPELL_SLEEP = 24777,
SPELL_NOXIOUSBREATH = 24818,
SPELL_TAILSWEEP = 15847,
// SPELL_MARKOFNATURE = 25040, // Not working
SPELL_ARCANEBLAST = 24857,
SPELL_BELLOWINGROAR = 22686,
@@ -47,219 +46,210 @@ enum eEnums
SPELL_POSIONBREATH = 20667
};
uint32 m_auiSpellSummonShade[]=
uint32 m_auiSpellSummonShade[] =
{
SPELL_SUMMONSHADE_1, SPELL_SUMMONSHADE_2, SPELL_SUMMONSHADE_3
};
struct boss_taerarAI : public ScriptedAI
class boss_taerar : public CreatureScript
{
boss_taerarAI(Creature *c) : ScriptedAI(c) {}
public:
boss_taerar() : CreatureScript("boss_taerar") { }
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
//uint32 m_uiMarkOfNature_Timer;
uint32 m_uiArcaneBlast_Timer;
uint32 m_uiBellowingRoar_Timer;
uint32 m_uiShades_Timer;
uint32 m_uiShadesSummoned;
bool m_bShades;
void Reset()
struct boss_taerarAI : public ScriptedAI
{
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
//m_uiMarkOfNature_Timer = 45000;
m_uiArcaneBlast_Timer = 12000;
m_uiBellowingRoar_Timer = 30000;
m_uiShades_Timer = 60000; //The time that Taerar is banished
m_uiShadesSummoned = 0;
boss_taerarAI(Creature *c) : ScriptedAI(c) {}
m_bShades = false;
}
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
uint32 m_uiArcaneBlast_Timer;
uint32 m_uiBellowingRoar_Timer;
uint32 m_uiShades_Timer;
uint32 m_uiShadesSummoned;
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
bool m_bShades;
void JustSummoned(Creature* pSummoned)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(pTarget);
}
void UpdateAI(const uint32 uiDiff)
{
if (m_bShades && m_uiShades_Timer <= uiDiff)
void Reset()
{
//Become unbanished again
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
m_uiArcaneBlast_Timer = 12000;
m_uiBellowingRoar_Timer = 30000;
m_uiShades_Timer = 60000; //The time that Taerar is banished
m_uiShadesSummoned = 0;
m_bShades = false;
}
else if (m_bShades)
void EnterCombat(Unit* /*pWho*/)
{
m_uiShades_Timer -= uiDiff;
//Do nothing while banished
return;
DoScriptText(SAY_AGGRO, me);
}
//Return since we have no target
if (!UpdateVictim())
return;
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
void JustSummoned(Creature* pSummoned)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%7000;
pSummoned->AI()->AttackStart(pTarget);
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
void UpdateAI(const uint32 uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
// m_uiMarkOfNature_Timer -= uiDiff;
//ArcaneBlast_Timer
if (m_uiArcaneBlast_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_ARCANEBLAST);
m_uiArcaneBlast_Timer = 7000 + rand()%5000;
}
else
m_uiArcaneBlast_Timer -= uiDiff;
//BellowingRoar_Timer
if (m_uiBellowingRoar_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
m_uiBellowingRoar_Timer = 20000 + rand()%10000;
}
else
m_uiBellowingRoar_Timer -= uiDiff;
//Summon 3 Shades at 75%, 50% and 25% (if bShades is true we already left in line 117, no need to check here again)
if (!m_bShades && (me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiShadesSummoned)))
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (m_bShades && m_uiShades_Timer <= uiDiff)
{
//Interrupt any spell casting
me->InterruptNonMeleeSpells(false);
//horrible workaround, need to fix
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SAY_SUMMONSHADE, me);
int iSize = sizeof(m_auiSpellSummonShade) / sizeof(uint32);
for (int i = 0; i < iSize; ++i)
DoCast(pTarget, m_auiSpellSummonShade[i], true);
++m_uiShadesSummoned; // prevent casting twice at same health
m_bShades = true;
//Become unbanished again
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_bShades = false;
}
else if (m_bShades)
{
m_uiShades_Timer -= uiDiff;
//Do nothing while banished
return;
}
m_uiShades_Timer = 60000;
}
DoMeleeAttackIfReady();
//Return since we have no target
if (!UpdateVictim())
return;
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%7000;
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//ArcaneBlast_Timer
if (m_uiArcaneBlast_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_ARCANEBLAST);
m_uiArcaneBlast_Timer = 7000 + rand()%5000;
}
else
m_uiArcaneBlast_Timer -= uiDiff;
//BellowingRoar_Timer
if (m_uiBellowingRoar_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
m_uiBellowingRoar_Timer = 20000 + rand()%10000;
}
else
m_uiBellowingRoar_Timer -= uiDiff;
//Summon 3 Shades at 75%, 50% and 25% (if bShades is true we already left in line 117, no need to check here again)
if (!m_bShades && (me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiShadesSummoned)))
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
//Interrupt any spell casting
me->InterruptNonMeleeSpells(false);
//horrible workaround, need to fix
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SAY_SUMMONSHADE, me);
int iSize = sizeof(m_auiSpellSummonShade) / sizeof(uint32);
for (int i = 0; i < iSize; ++i)
DoCast(pTarget, m_auiSpellSummonShade[i], true);
++m_uiShadesSummoned; // prevent casting twice at same health
m_bShades = true;
}
m_uiShades_Timer = 60000;
}
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new boss_taerarAI(creature);
}
};
// Shades of Taerar Script
struct boss_shadeoftaerarAI : public ScriptedAI
class boss_shadeoftaerar : public CreatureScript
{
boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {}
public:
boss_shadeoftaerar() : CreatureScript("boss_shade_of_taerar") { }
uint32 m_uiPoisonCloud_Timer;
uint32 m_uiPosionBreath_Timer;
void Reset()
struct boss_shadeoftaerarAI : public ScriptedAI
{
m_uiPoisonCloud_Timer = 8000;
m_uiPosionBreath_Timer = 12000;
}
boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
uint32 m_uiPoisonCloud_Timer;
uint32 m_uiPosionBreath_Timer;
//PoisonCloud_Timer
if (m_uiPoisonCloud_Timer <= uiDiff)
void Reset()
{
DoCast(me->getVictim(), SPELL_POSIONCLOUD);
m_uiPoisonCloud_Timer = 30000;
}
else
m_uiPoisonCloud_Timer -= uiDiff;
//PosionBreath_Timer
if (m_uiPosionBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_POSIONBREATH);
m_uiPoisonCloud_Timer = 8000;
m_uiPosionBreath_Timer = 12000;
}
else
m_uiPosionBreath_Timer -= uiDiff;
DoMeleeAttackIfReady();
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//PoisonCloud_Timer
if (m_uiPoisonCloud_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_POSIONCLOUD);
m_uiPoisonCloud_Timer = 30000;
}
else
m_uiPoisonCloud_Timer -= uiDiff;
//PosionBreath_Timer
if (m_uiPosionBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_POSIONBREATH);
m_uiPosionBreath_Timer = 12000;
}
else
m_uiPosionBreath_Timer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new boss_shadeoftaerarAI(creature);
}
};
CreatureAI* GetAI_boss_taerar(Creature* pCreature)
{
return new boss_taerarAI (pCreature);
}
CreatureAI* GetAI_boss_shadeoftaerar(Creature* pCreature)
{
return new boss_shadeoftaerarAI (pCreature);
}
void AddSC_boss_taerar()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_taerar";
newscript->GetAI = &GetAI_boss_taerar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_shade_of_taerar";
newscript->GetAI = &GetAI_boss_shadeoftaerar;
newscript->RegisterSelf();
new boss_taerar;
new boss_shadeoftaerar;
}
+118 -126
View File
@@ -44,162 +44,154 @@ enum eEnums
};
// Ysondre script
struct boss_ysondreAI : public ScriptedAI
class boss_ysondre : public CreatureScript
{
boss_ysondreAI(Creature* pCreature) : ScriptedAI(pCreature) {}
public:
boss_ysondre() : CreatureScript("boss_ysondre") { }
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
//uint32 m_uiMarkOfNature_Timer;
uint32 m_uiLightningWave_Timer;
uint32 m_uiSummonDruidModifier;
void Reset()
struct boss_ysondreAI : public ScriptedAI
{
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
//m_uiMarkOfNature_Timer = 45000;
m_uiLightningWave_Timer = 12000;
m_uiSummonDruidModifier = 0;
}
boss_ysondreAI(Creature* pCreature) : ScriptedAI(pCreature) {}
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
uint32 m_uiSleep_Timer;
uint32 m_uiNoxiousBreath_Timer;
uint32 m_uiTailSweep_Timer;
uint32 m_uiLightningWave_Timer;
uint32 m_uiSummonDruidModifier;
void JustSummoned(Creature* pSummoned)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(pTarget);
}
void Reset()
{
m_uiSleep_Timer = 15000 + rand()%5000;
m_uiNoxiousBreath_Timer = 8000;
m_uiTailSweep_Timer = 4000;
m_uiLightningWave_Timer = 12000;
m_uiSummonDruidModifier = 0;
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
void JustSummoned(Creature* pSummoned)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%7000;
pSummoned->AI()->AttackStart(pTarget);
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
void UpdateAI(const uint32 uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
if (!UpdateVictim())
return;
//Sleep_Timer
if (m_uiSleep_Timer <= uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_SLEEP);
m_uiSleep_Timer = 8000 + rand()%7000;
}
else
m_uiSleep_Timer -= uiDiff;
//NoxiousBreath_Timer
if (m_uiNoxiousBreath_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//LightningWave_Timer
if (m_uiLightningWave_Timer <= uiDiff)
{
//Cast LIGHTNINGWAVE on a Random target
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_LIGHTNINGWAVE);
m_uiLightningWave_Timer = 7000 + rand()%5000;
}
else
m_uiLightningWave_Timer -= uiDiff;
//Summon Druids
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiSummonDruidModifier)))
{
DoScriptText(SAY_SUMMONDRUIDS, me);
for (int i = 0; i < 10; ++i)
DoCast(me, SPELL_SUMMONDRUIDS, true);
++m_uiSummonDruidModifier;
}
DoMeleeAttackIfReady();
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
};
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(me->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
// m_uiMarkOfNature_Timer -= uiDiff;
//LightningWave_Timer
if (m_uiLightningWave_Timer <= uiDiff)
{
//Cast LIGHTNINGWAVE on a Random target
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_LIGHTNINGWAVE);
m_uiLightningWave_Timer = 7000 + rand()%5000;
}
else
m_uiLightningWave_Timer -= uiDiff;
//Summon Druids
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(25*m_uiSummonDruidModifier)))
{
DoScriptText(SAY_SUMMONDRUIDS, me);
for (int i = 0; i < 10; ++i)
DoCast(me, SPELL_SUMMONDRUIDS, true);
++m_uiSummonDruidModifier;
}
DoMeleeAttackIfReady();
CreatureAI *OnGetAI(Creature *creature) const
{
return new boss_ysondreAI(creature);
}
};
// Summoned druid script
struct mob_dementeddruidsAI : public ScriptedAI
class mob_dementeddruids : public CreatureScript
{
mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {}
public:
mob_dementeddruids() : CreatureScript("mob_dementeddruids") { }
uint32 m_uiMoonFire_Timer;
void Reset()
struct mob_dementeddruidsAI : public ScriptedAI
{
m_uiMoonFire_Timer = 3000;
}
mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
uint32 m_uiMoonFire_Timer;
//MoonFire_Timer
if (m_uiMoonFire_Timer <= uiDiff)
void Reset()
{
DoCast(me->getVictim(), SPELL_MOONFIRE);
m_uiMoonFire_Timer = 5000;
m_uiMoonFire_Timer = 3000;
}
else
m_uiMoonFire_Timer -= uiDiff;
DoMeleeAttackIfReady();
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//MoonFire_Timer
if (m_uiMoonFire_Timer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_MOONFIRE);
m_uiMoonFire_Timer = 5000;
}
else
m_uiMoonFire_Timer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new mob_dementeddruidsAI(creature);
}
};
CreatureAI* GetAI_boss_ysondre(Creature* pCreature)
{
return new boss_ysondreAI (pCreature);
}
CreatureAI* GetAI_mob_dementeddruids(Creature* pCreature)
{
return new mob_dementeddruidsAI (pCreature);
}
void AddSC_boss_ysondre()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_ysondre";
newscript->GetAI = &GetAI_boss_ysondre;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_dementeddruids";
newscript->GetAI = &GetAI_mob_dementeddruids;
newscript->RegisterSelf();
new boss_ysondre;
new mob_dementeddruids;
}
+142 -133
View File
@@ -38,19 +38,31 @@ EndContentData */
* guard_generic
*******************************************************/
CreatureAI* GetAI_guard_generic(Creature* pCreature)
class guard_generic : public CreatureScript
{
return new guardAI (pCreature);
}
public:
guard_generic() : CreatureScript("guard_generic") { }
CreatureAI *OnGetAI(Creature *creature) const
{
return new guardAI(creature);
}
};
/*******************************************************
* guard_orgrimmar
*******************************************************/
CreatureAI* GetAI_guard_orgrimmar(Creature* pCreature)
class guard_orgrimmar : public CreatureScript
{
return new guardAI_orgrimmar (pCreature);
}
public:
guard_orgrimmar() : CreatureScript("guard_orgrimmar") { }
CreatureAI *OnGetAI(Creature *creature) const
{
return new guardAI_orgrimmar(creature);
}
};
/*******************************************************
* guard_shattrath_aldor
@@ -61,138 +73,156 @@ CreatureAI* GetAI_guard_orgrimmar(Creature* pCreature)
#define SPELL_BANISH_TELEPORT 36643
#define SPELL_EXILE 39533
struct guard_shattrath_aldorAI : public guardAI
class guard_shattrath_aldor : public CreatureScript
{
guard_shattrath_aldorAI(Creature *c) : guardAI(c) {}
public:
guard_shattrath_aldor() : CreatureScript("guard_shattrath_aldor") { }
uint32 Exile_Timer;
uint32 Banish_Timer;
uint64 PlayerGUID;
bool CanTeleport;
void Reset()
struct guard_shattrath_aldorAI : public guardAI
{
Banish_Timer = 5000;
Exile_Timer = 8500;
PlayerGUID = 0;
CanTeleport = false;
}
guard_shattrath_aldorAI(Creature *c) : guardAI(c) {}
void EnterCombat(Unit * /*who*/) {}
uint32 Exile_Timer;
uint32 Banish_Timer;
uint64 PlayerGUID;
bool CanTeleport;
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CanTeleport)
void Reset()
{
if (Exile_Timer <= diff)
{
if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
}
PlayerGUID = 0;
Exile_Timer = 8500;
CanTeleport = false;
} else Exile_Timer -= diff;
Banish_Timer = 5000;
Exile_Timer = 8500;
PlayerGUID = 0;
CanTeleport = false;
}
else if (Banish_Timer <= diff)
{
Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
Banish_Timer = 9000;
PlayerGUID = temp->GetGUID();
if (PlayerGUID)
CanTeleport = true;
}
} else Banish_Timer -= diff;
DoMeleeAttackIfReady();
void EnterCombat(Unit * /*who*/) {}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CanTeleport)
{
if (Exile_Timer <= diff)
{
if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
}
PlayerGUID = 0;
Exile_Timer = 8500;
CanTeleport = false;
} else Exile_Timer -= diff;
}
else if (Banish_Timer <= diff)
{
Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
Banish_Timer = 9000;
PlayerGUID = temp->GetGUID();
if (PlayerGUID)
CanTeleport = true;
}
} else Banish_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new guard_shattrath_aldorAI(creature);
}
};
CreatureAI* GetAI_guard_shattrath_aldor(Creature* pCreature)
{
return new guard_shattrath_aldorAI (pCreature);
}
/*******************************************************
* guard_shattrath_scryer
*******************************************************/
struct guard_shattrath_scryerAI : public guardAI
class guard_shattrath_scryer : public CreatureScript
{
guard_shattrath_scryerAI(Creature *c) : guardAI(c) {}
public:
guard_shattrath_scryer() : CreatureScript("guard_shattrath_scryer") { }
uint32 Exile_Timer;
uint32 Banish_Timer;
uint64 PlayerGUID;
bool CanTeleport;
void Reset()
struct guard_shattrath_scryerAI : public guardAI
{
Banish_Timer = 5000;
Exile_Timer = 8500;
PlayerGUID = 0;
CanTeleport = false;
}
guard_shattrath_scryerAI(Creature *c) : guardAI(c) {}
void EnterCombat(Unit * /*who*/) {}
uint32 Exile_Timer;
uint32 Banish_Timer;
uint64 PlayerGUID;
bool CanTeleport;
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CanTeleport)
void Reset()
{
if (Exile_Timer <= diff)
{
if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
}
PlayerGUID = 0;
Exile_Timer = 8500;
CanTeleport = false;
} else Exile_Timer -= diff;
Banish_Timer = 5000;
Exile_Timer = 8500;
PlayerGUID = 0;
CanTeleport = false;
}
else if (Banish_Timer <= diff)
{
Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
Banish_Timer = 9000;
PlayerGUID = temp->GetGUID();
if (PlayerGUID)
CanTeleport = true;
}
} else Banish_Timer -= diff;
DoMeleeAttackIfReady();
void EnterCombat(Unit * /*who*/) {}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CanTeleport)
{
if (Exile_Timer <= diff)
{
if (Unit* temp = Unit::GetUnit(*me,PlayerGUID))
{
temp->CastSpell(temp,SPELL_EXILE,true);
temp->CastSpell(temp,SPELL_BANISH_TELEPORT,true);
}
PlayerGUID = 0;
Exile_Timer = 8500;
CanTeleport = false;
} else Exile_Timer -= diff;
}
else if (Banish_Timer <= diff)
{
Unit* temp = me->getVictim();
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
Banish_Timer = 9000;
PlayerGUID = temp->GetGUID();
if (PlayerGUID)
CanTeleport = true;
}
} else Banish_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new guard_shattrath_scryerAI(creature);
}
};
CreatureAI* GetAI_guard_shattrath_scryer(Creature* pCreature)
{
return new guard_shattrath_scryerAI (pCreature);
}
/*******************************************************
* guard_stormwind
*******************************************************/
CreatureAI* GetAI_guard_stormwind(Creature* pCreature)
class guard_stormwind : public CreatureScript
{
return new guardAI_stormwind (pCreature);
}
public:
guard_stormwind() : CreatureScript("guard_stormwind") { }
CreatureAI *OnGetAI(Creature *creature) const
{
return new guardAI_stormwind(creature);
}
};
/*******************************************************
* AddSC
@@ -200,30 +230,9 @@ CreatureAI* GetAI_guard_stormwind(Creature* pCreature)
void AddSC_guards()
{
Script *newscript;
newscript = new Script;
newscript->Name = "guard_generic";
newscript->GetAI = &GetAI_guard_generic;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "guard_orgrimmar";
newscript->GetAI = &GetAI_guard_orgrimmar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "guard_shattrath_aldor";
newscript->GetAI = &GetAI_guard_shattrath_aldor;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "guard_shattrath_scryer";
newscript->GetAI = &GetAI_guard_shattrath_scryer;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "guard_stormwind";
newscript->GetAI = &GetAI_guard_stormwind;
newscript->RegisterSelf();
new guard_generic;
new guard_orgrimmar;
new guard_shattrath_aldor;
new guard_shattrath_scryer;
new guard_stormwind;
}
+265 -245
View File
@@ -43,194 +43,244 @@ enum eOnlyForFlight
SPELL_ARCANE_CHARGES = 45072
};
bool ItemUse_item_only_for_flight(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
class item_only_for_flight : public ItemScript
{
uint32 itemId = pItem->GetEntry();
bool disabled = false;
public:
item_only_for_flight() : ItemScript("item_only_for_flight") { }
//for special scripts
switch(itemId)
bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
{
case 24538:
if (pPlayer->GetAreaId() != 3628)
disabled = true;
break;
case 34489:
if (pPlayer->GetZoneId() != 4080)
disabled = true;
break;
case 34475:
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_ARCANE_CHARGES))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
break;
uint32 itemId = pItem->GetEntry();
bool disabled = false;
//for special scripts
switch(itemId)
{
case 24538:
if (pPlayer->GetAreaId() != 3628)
disabled = true;
break;
case 34489:
if (pPlayer->GetZoneId() != 4080)
disabled = true;
break;
case 34475:
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_ARCANE_CHARGES))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
break;
}
// allow use in flight only
if (pPlayer->isInFlight() && !disabled)
return false;
// error
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,pItem,NULL);
return true;
}
// allow use in flight only
if (pPlayer->isInFlight() && !disabled)
return false;
// error
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,pItem,NULL);
return true;
}
};
/*#####
# item_draenei_fishing_net
#####*/
//This is just a hack and should be removed from here.
//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
bool ItemUse_item_draenei_fishing_net(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
class item_draenei_fishing_net : public ItemScript
{
//if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT &&
//targets.getGOTarget()->GetGOInfo()->type == GAMEOBJECT_TYPE_SPELL_FOCUS && targets.getGOTarget()->GetEntry() == 181616)
//{
if (pPlayer->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE)
public:
item_draenei_fishing_net() : ItemScript("item_draenei_fishing_net") { }
//This is just a hack and should be removed from here.
//Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
if (urand(0,99) < 35)
if (pPlayer->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE)
{
Creature *Murloc = pPlayer->SummonCreature(17102, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Murloc)
Murloc->AI()->AttackStart(pPlayer);
}
else
{
ItemPosCountVec dest;
uint32 itemId = 23614;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1);
if (msg == EQUIP_ERR_OK)
if (urand(0,99) < 35)
{
if (Item* item = pPlayer->StoreNewItem(dest, itemId, true))
pPlayer->SendNewItem(item, 1, false, true);
} else
pPlayer->SendEquipError(msg, NULL, NULL, itemId);
Creature *Murloc = pPlayer->SummonCreature(17102, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
if (Murloc)
Murloc->AI()->AttackStart(pPlayer);
}
else
{
ItemPosCountVec dest;
uint32 itemId = 23614;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1);
if (msg == EQUIP_ERR_OK)
{
if (Item* item = pPlayer->StoreNewItem(dest, itemId, true))
pPlayer->SendNewItem(item, 1, false, true);
} else
pPlayer->SendEquipError(msg, NULL, NULL, itemId);
}
}
return false;
}
//}
return false;
}
};
/*#####
# item_nether_wraith_beacon
#####*/
bool ItemUse_item_nether_wraith_beacon(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
class item_nether_wraith_beacon : public ItemScript
{
if (pPlayer->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
public:
item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { }
bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
Creature *Nether;
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()-20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
if (Nether)
Nether->AI()->AttackStart(pPlayer);
if (pPlayer->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
{
Creature *Nether;
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()+20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
Nether = pPlayer->SummonCreature(22408, pPlayer->GetPositionX(), pPlayer->GetPositionY()-20, pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
if (Nether)
Nether->AI()->AttackStart(pPlayer);
}
return false;
}
return false;
}
};
/*#####
# item_flying_machine
#####*/
bool ItemUse_item_flying_machine(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
class item_flying_machine : public ItemScript
{
uint32 itemId = pItem->GetEntry();
if (itemId == 34060)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) >= 225)
return false;
public:
item_flying_machine() : ItemScript("item_flying_machine") { }
if (itemId == 34061)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300)
return false;
bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
{
uint32 itemId = pItem->GetEntry();
if (itemId == 34060)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) >= 225)
return false;
sLog.outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId);
pPlayer->SendEquipError(EQUIP_ERR_CANT_EQUIP_SKILL,pItem,NULL);
return true;
}
if (itemId == 34061)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300)
return false;
sLog.outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId);
pPlayer->SendEquipError(EQUIP_ERR_CANT_EQUIP_SKILL,pItem,NULL);
return true;
}
};
/*#####
# item_gor_dreks_ointment
#####*/
bool ItemUse_item_gor_dreks_ointment(Player *pPlayer, Item *pItem, SpellCastTargets const& targets)
class item_gor_dreks_ointment : public ItemScript
{
if (targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT &&
targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578))
return false;
public:
item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { }
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,pItem,NULL);
return true;
}
bool OnUse(Player *pPlayer, Item *pItem, SpellCastTargets const& targets)
{
if (targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT &&
targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578))
return false;
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,pItem,NULL);
return true;
}
};
/*#####
# item_incendiary_explosives
#####*/
bool ItemUse_item_incendiary_explosives(Player *pPlayer, Item *pItem, SpellCastTargets const & /*targets*/)
class item_incendiary_explosives : public ItemScript
{
if (pPlayer->FindNearestCreature(26248,15) || pPlayer->FindNearestCreature(26249,15))
return false;
else
public:
item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { }
bool OnUse(Player *pPlayer, Item *pItem, SpellCastTargets const & /*targets*/)
{
pPlayer->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,pItem,NULL);
return true;
if (pPlayer->FindNearestCreature(26248,15) || pPlayer->FindNearestCreature(26249,15))
return false;
else
{
pPlayer->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,pItem,NULL);
return true;
}
}
}
};
/*#####
# item_mysterious_egg
#####*/
bool ItemExpire_item_mysterious_egg(Player *pPlayer, ItemPrototype const * /*pItemProto*/)
class item_mysterious_egg : public ItemScript
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1); // Cracked Egg
if (msg == EQUIP_ERR_OK)
pPlayer->StoreNewItem(dest, 39883, true, Item::GenerateItemRandomPropertyId(39883));
public:
item_mysterious_egg() : ItemScript("item_mysterious_egg") { }
bool OnExpire(Player *pPlayer, ItemPrototype const * /*pItemProto*/)
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1); // Cracked Egg
if (msg == EQUIP_ERR_OK)
pPlayer->StoreNewItem(dest, 39883, true, Item::GenerateItemRandomPropertyId(39883));
return true;
}
return true;
}
};
/*#####
# item_disgusting_jar
#####*/
bool ItemExpire_item_disgusting_jar(Player *pPlayer, ItemPrototype const * /*pItemProto*/)
class item_disgusting_jar : public ItemScript
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1); // Ripe Disgusting Jar
if (msg == EQUIP_ERR_OK)
pPlayer->StoreNewItem(dest, 44718, true, Item::GenerateItemRandomPropertyId(44718));
public:
item_disgusting_jar() : ItemScript("item_disgusting_jar") {}
return true;
}
bool OnExpire(Player *pPlayer, ItemPrototype const * /*pItemProto*/)
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1); // Ripe Disgusting Jar
if (msg == EQUIP_ERR_OK)
pPlayer->StoreNewItem(dest, 44718, true, Item::GenerateItemRandomPropertyId(44718));
return true;
}
};
/*#####
# item_harvesters_gift
#####*/
#define GHOULS 28845
bool ItemUse_item_harvesters_gift(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
std::list<Creature*> MinionList;
pPlayer->GetAllMinionsByEntry(MinionList,GHOULS);
if (pPlayer->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
class item_harvesters_gift : public ItemScript
{
public:
item_harvesters_gift() : ItemScript("item_harvesters_gift") { }
bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
if (!MinionList.empty())
std::list<Creature*> MinionList;
pPlayer->GetAllMinionsByEntry(MinionList,GHOULS);
if (pPlayer->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
{
if (MinionList.size() < 5)
return false;
else
if (!MinionList.empty())
{
//This should be sent to the player as red text.
pPlayer->Say("You have created enough ghouls. Return to Gothik the Harvester at Death's Breach.",LANG_UNIVERSAL);
return true;
if (MinionList.size() < 5)
return false;
else
{
//This should be sent to the player as red text.
pPlayer->Say("You have created enough ghouls. Return to Gothik the Harvester at Death's Breach.",LANG_UNIVERSAL);
return true;
}
}
else
return false;
}
else
return false;
return true;
}
return true;
}
};
/*#####
# item_pile_fake_furs
@@ -265,34 +315,39 @@ const uint32 CaribouTraps[CaribouTrapsNum] =
GO_CARIBOU_TRAP_11, GO_CARIBOU_TRAP_12, GO_CARIBOU_TRAP_13, GO_CARIBOU_TRAP_14, GO_CARIBOU_TRAP_15,
};
bool ItemUse_item_pile_fake_furs(Player *pPlayer, Item * /*pItem*/, SpellCastTargets const & /*targets*/)
class item_pile_fake_furs : public ItemScript
{
GameObject *pGo = NULL;
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
{
pGo = pPlayer->FindNearestGameObject(CaribouTraps[i], 5.0f);
if (pGo)
break;
}
public:
item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { }
if (!pGo)
bool OnUse(Player *pPlayer, Item * /*pItem*/, SpellCastTargets const & /*targets*/)
{
GameObject *pGo = NULL;
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
{
pGo = pPlayer->FindNearestGameObject(CaribouTraps[i], 5.0f);
if (pGo)
break;
}
if (!pGo)
return false;
if (pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, true) || pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, false) || pGo->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 2.0f))
return true;
float x, y, z;
pGo->GetClosePoint(x, y, z, pGo->GetObjectSize() / 3, 7.0f);
pGo->SummonGameObject(GO_HIGH_QUALITY_FUR, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, 0, 0, 0, 0, 1000);
if (TempSummon* summon = pPlayer->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, pGo->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisibility(VISIBILITY_OFF);
summon->SetReactState(REACT_PASSIVE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
return false;
if (pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, true) || pGo->FindNearestCreature(NPC_NESINGWARY_TRAPPER, 10.0f, false) || pGo->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 2.0f))
return true;
float x, y, z;
pGo->GetClosePoint(x, y, z, pGo->GetObjectSize() / 3, 7.0f);
pGo->SummonGameObject(GO_HIGH_QUALITY_FUR, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, 0, 0, 0, 0, 1000);
if (TempSummon* summon = pPlayer->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, pGo->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisibility(VISIBILITY_OFF);
summon->SetReactState(REACT_PASSIVE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
return false;
}
};
/*#####
# item_petrov_cluster_bombs
@@ -305,23 +360,29 @@ enum ePetrovClusterBombs
ZONE_ID_HOWLING = 495
};
bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const SpellCastTargets & /*pTargets*/)
class item_petrov_cluster_bombs : public ItemScript
{
if (pPlayer->GetZoneId() != ZONE_ID_HOWLING)
return false;
public:
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
bool OnUse(Player* pPlayer, Item* pItem, const SpellCastTargets & /*pTargets*/)
{
pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
if (pPlayer->GetZoneId() != ZONE_ID_HOWLING)
return false;
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE);
if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
{
pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
return true;
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE);
return true;
}
return false;
}
return false;
}
};
/*######
# item_dehta_trap_smasher
@@ -365,30 +426,36 @@ const uint32 MammothTraps[MammothTrapsNum] =
GO_MAMMOTH_TRAP_21, GO_MAMMOTH_TRAP_22
};
bool ItemUse_item_dehta_trap_smasher(Player* pPlayer, Item* /*pItem*/, const SpellCastTargets & /*pTargets*/)
class item_dehta_trap_smasher : public ItemScript
{
if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE)
return false;
public:
item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { }
Creature* pMammoth;
pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f);
if (!pMammoth)
return false;
GameObject* pTrap;
for (uint8 i = 0; i < MammothTrapsNum; ++i)
bool OnUse(Player* pPlayer, Item* /*pItem*/, const SpellCastTargets & /*pTargets*/)
{
pTrap = pPlayer->FindNearestGameObject(MammothTraps[i],11.0f);
if (pTrap)
if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE)
return false;
Creature* pMammoth;
pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f);
if (!pMammoth)
return false;
GameObject* pTrap;
for (uint8 i = 0; i < MammothTrapsNum; ++i)
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
return true;
pTrap = pPlayer->FindNearestGameObject(MammothTraps[i],11.0f);
if (pTrap)
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
return true;
}
}
return false;
}
return false;
}
};
enum TheEmissary
{
@@ -396,87 +463,40 @@ enum TheEmissary
NPC_LEVIROTH = 26452
};
bool ItemUse_item_Trident_of_Nazjan(Player* pPlayer, Item* pItem, const SpellCastTargets & /*pTargets*/)
class item_trident_of_nazjan : public ItemScript
{
if (pPlayer->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE)
public:
item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { }
bool OnUse(Player* pPlayer, Item* pItem, const SpellCastTargets & /*pTargets*/)
{
if (Creature* pLeviroth = pPlayer->FindNearestCreature(NPC_LEVIROTH, 10.0f)) // spell range
if (pPlayer->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE)
{
pLeviroth->AI()->AttackStart(pPlayer);
return false;
if (Creature* pLeviroth = pPlayer->FindNearestCreature(NPC_LEVIROTH, 10.0f)) // spell range
{
pLeviroth->AI()->AttackStart(pPlayer);
return false;
} else
pPlayer->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL);
} else
pPlayer->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL);
} else
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW ,pItem, NULL);
return true;
}
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW ,pItem, NULL);
return true;
}
};
void AddSC_item_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "item_only_for_flight";
newscript->pItemUse = &ItemUse_item_only_for_flight;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_draenei_fishing_net";
newscript->pItemUse = &ItemUse_item_draenei_fishing_net;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_nether_wraith_beacon";
newscript->pItemUse = &ItemUse_item_nether_wraith_beacon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_flying_machine";
newscript->pItemUse = &ItemUse_item_flying_machine;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_gor_dreks_ointment";
newscript->pItemUse = &ItemUse_item_gor_dreks_ointment;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_incendiary_explosives";
newscript->pItemUse = &ItemUse_item_incendiary_explosives;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_mysterious_egg";
newscript->pItemExpire = &ItemExpire_item_mysterious_egg;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_disgusting_jar";
newscript->pItemExpire = &ItemExpire_item_disgusting_jar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_harvesters_gift";
newscript->pItemUse = &ItemUse_item_harvesters_gift;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_pile_fake_furs";
newscript->pItemUse = &ItemUse_item_pile_fake_furs;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_petrov_cluster_bombs";
newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_dehta_trap_smasher";
newscript->pItemUse = &ItemUse_item_dehta_trap_smasher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_Trident_of_Nazjan";
newscript->pItemUse = &ItemUse_item_Trident_of_Nazjan;
newscript->RegisterSelf();
new item_only_for_flight;
new item_draenei_fishing_net;
new item_nether_wraith_beacon;
new item_flying_machine;
new item_gor_dreks_ointment;
new item_incendiary_explosives;
new item_mysterious_egg;
new item_disgusting_jar;
new item_harvesters_gift;
new item_pile_fake_furs;
new item_petrov_cluster_bombs;
new item_dehta_trap_smasher;
new item_trident_of_nazjan;
}
+161 -160
View File
@@ -27,203 +27,204 @@ EndScriptData */
#define GENERIC_CREATURE_COOLDOWN 5000
struct generic_creatureAI : public ScriptedAI
class generic_creature : public CreatureScript
{
generic_creatureAI(Creature *c) : ScriptedAI(c) {}
public:
generic_creature() : CreatureScript("generic_creature") { }
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs
bool IsSelfRooted;
void Reset()
struct generic_creatureAI : public ScriptedAI
{
GlobalCooldown = 0;
BuffTimer = 0; //Rebuff as soon as we can
IsSelfRooted = false;
}
generic_creatureAI(Creature *c) : ScriptedAI(c) {}
void EnterCombat(Unit *who)
{
if (!me->IsWithinMeleeRange(who))
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs
bool IsSelfRooted;
void Reset()
{
IsSelfRooted = true;
GlobalCooldown = 0;
BuffTimer = 0; //Rebuff as soon as we can
IsSelfRooted = false;
}
}
void UpdateAI(const uint32 diff)
{
//Always decrease our global cooldown first
if (GlobalCooldown > diff)
GlobalCooldown -= diff;
else GlobalCooldown = 0;
//Buff timer (only buff when we are alive and not in combat
if (!me->isInCombat() && me->isAlive())
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
SpellEntry const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
DoCastSpell(me, info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
//Set our timer to 10 minutes before rebuff
BuffTimer = 600000;
}//Try agian in 30 seconds
else BuffTimer = 30000;
} else BuffTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))
void EnterCombat(Unit *who)
{
//Make sure our attack is ready and we arn't currently casting
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
if (me->GetHealth()*100 / me->GetMaxHealth() < 30)
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(me, info);
else DoCastSpell(me->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
else me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
if (!me->IsWithinMeleeRange(who))
IsSelfRooted = true;
}
else
void UpdateAI(const uint32 diff)
{
//Only run this code if we arn't already casting
if (!me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Always decrease our global cooldown first
if (GlobalCooldown > diff)
GlobalCooldown -= diff;
else GlobalCooldown = 0;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (me->GetHealth()*100 / me->GetMaxHealth() < 30 && rand() % 3 == 0)
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
//Buff timer (only buff when we are alive and not in combat
if (!me->isInCombat() && me->isAlive())
if (BuffTimer <= diff)
{
//If we are currently moving stop us and set the movement generator
if (!IsSelfRooted)
//Find a spell that targets friendly and applies an aura (these are generally buffs)
SpellEntry const *info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
IsSelfRooted = true;
}
//Cast the buff spell
DoCastSpell(me, info);
//Cast spell
if (Healing) DoCastSpell(me,info);
else DoCastSpell(me->getVictim(),info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
//Set our timer to 10 minutes before rebuff
BuffTimer = 600000;
}//Try agian in 30 seconds
else BuffTimer = 30000;
} else BuffTimer -= diff;
}//If no spells available and we arn't moving run to target
else if (IsSelfRooted)
//Return since we have no target
if (!UpdateVictim())
return;
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
//Cancel our current spell and then allow movement agian
me->InterruptNonMeleeSpells(false);
IsSelfRooted = false;
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
if (me->GetHealth()*100 / me->GetMaxHealth() < 30)
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(me, info);
else DoCastSpell(me->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
else me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
}
else
{
//Only run this code if we arn't already casting
if (!me->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (me->GetHealth()*100 / me->GetMaxHealth() < 30 && rand() % 3 == 0)
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
{
//If we are currently moving stop us and set the movement generator
if (!IsSelfRooted)
IsSelfRooted = true;
//Cast spell
if (Healing) DoCastSpell(me,info);
else DoCastSpell(me->getVictim(),info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}//If no spells available and we arn't moving run to target
else if (IsSelfRooted)
{
//Cancel our current spell and then allow movement agian
me->InterruptNonMeleeSpells(false);
IsSelfRooted = false;
}
}
}
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new generic_creatureAI(creature);
}
};
CreatureAI* GetAI_generic_creature(Creature* pCreature)
class trigger_periodic : public CreatureScript
{
return new generic_creatureAI (pCreature);
}
public:
trigger_periodic() : CreatureScript("trigger_periodic") { }
struct trigger_periodicAI : public NullCreatureAI
{
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
struct trigger_periodicAI : public NullCreatureAI
{
spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
interval = me->GetAttackTime(BASE_ATTACK);
timer = interval;
}
uint32 timer, interval;
const SpellEntry * spell;
void UpdateAI(const uint32 diff)
{
if (timer <= diff)
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
{
if (spell)
me->CastSpell(me, spell, true);
spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
interval = me->GetAttackTime(BASE_ATTACK);
timer = interval;
}
else
timer -= diff;
}
};
struct trigger_deathAI : public NullCreatureAI
{
trigger_deathAI(Creature* c) : NullCreatureAI(c) {}
void JustDied(Unit *killer)
uint32 timer, interval;
const SpellEntry * spell;
void UpdateAI(const uint32 diff)
{
if (timer <= diff)
{
if (spell)
me->CastSpell(me, spell, true);
timer = interval;
}
else
timer -= diff;
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
if (me->m_spells[0])
me->CastSpell(killer, me->m_spells[0], true);
return new trigger_periodicAI(creature);
}
};
CreatureAI* GetAI_trigger_periodic(Creature* pCreature)
class trigger_death : public CreatureScript
{
return new trigger_periodicAI (pCreature);
}
public:
trigger_death() : CreatureScript("trigger_death") { }
CreatureAI* GetAI_trigger_death(Creature* pCreature)
{
return new trigger_deathAI (pCreature);
}
struct trigger_deathAI : public NullCreatureAI
{
trigger_deathAI(Creature* c) : NullCreatureAI(c) {}
void JustDied(Unit *killer)
{
if (me->m_spells[0])
me->CastSpell(killer, me->m_spells[0], true);
}
};
CreatureAI *OnGetAI(Creature *creature) const
{
return new trigger_deathAI(creature);
}
};
void AddSC_generic_creature()
{
Script *newscript;
/*newscript = new Script;
newscript->Name = "generic_creature";
newscript->GetAI = &GetAI_generic_creature;
newscript->RegisterSelf();*/
newscript = new Script;
newscript->Name = "trigger_periodic";
newscript->GetAI = &GetAI_trigger_periodic;
newscript->RegisterSelf();
/*newscript = new Script;
newscript->Name = "trigger_death";
newscript->GetAI = &GetAI_trigger_death;
newscript->RegisterSelf();*/
//new generic_creature;
new trigger_periodic;
//new trigger_death;
}
+76 -75
View File
@@ -37,94 +37,95 @@ EndScriptData */
#define LOCALE_INNKEEPER_0 "Make this inn my home."
#define LOCALE_INNKEEPER_3 "Ich möchte dieses Gasthaus zu meinem Heimatort machen."
bool GossipHello_npc_innkeeper(Player *pPlayer, Creature *pCreature)
class npc_innkeeper : public CreatureScript
{
if (IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
public:
npc_innkeeper() : CreatureScript("npc_innkeeper") { }
bool OnGossipHello(Player *pPlayer, Creature *pCreature)
{
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
if (IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
case LOCALE_frFR: localizedEntry = LOCALE_TRICK_OR_TREAT_2; break;
case LOCALE_deDE: localizedEntry = LOCALE_TRICK_OR_TREAT_3; break;
case LOCALE_esES: localizedEntry = LOCALE_TRICK_OR_TREAT_6; break;
case LOCALE_enUS: default: localizedEntry = LOCALE_TRICK_OR_TREAT_0;
}
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
}
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (pCreature->isInnkeeper())
{
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
{
case LOCALE_deDE: localizedEntry = LOCALE_INNKEEPER_3; break;
case LOCALE_enUS: default: localizedEntry = LOCALE_INNKEEPER_0;
}
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INN);
}
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_innkeeper(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
pPlayer->CastSpell(pPlayer, SPELL_TRICK_OR_TREATED, true);
if (urand(0, 1))
pPlayer->CastSpell(pPlayer, SPELL_TREAT, true);
else
{
uint32 trickspell = 0;
switch (urand(0, 13))
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
{
case 0: trickspell = 24753; break; // cannot cast, random 30sec
case 1: trickspell = 24713; break; // lepper gnome costume
case 2: trickspell = 24735; break; // male ghost costume
case 3: trickspell = 24736; break; // female ghostcostume
case 4: trickspell = 24710; break; // male ninja costume
case 5: trickspell = 24711; break; // female ninja costume
case 6: trickspell = 24708; break; // male pirate costume
case 7: trickspell = 24709; break; // female pirate costume
case 8: trickspell = 24723; break; // skeleton costume
case 9: trickspell = 24753; break; // Trick
case 10: trickspell = 24924; break; // Hallow's End Candy
case 11: trickspell = 24925; break; // Hallow's End Candy
case 12: trickspell = 24926; break; // Hallow's End Candy
case 13: trickspell = 24927; break; // Hallow's End Candy
case LOCALE_frFR: localizedEntry = LOCALE_TRICK_OR_TREAT_2; break;
case LOCALE_deDE: localizedEntry = LOCALE_TRICK_OR_TREAT_3; break;
case LOCALE_esES: localizedEntry = LOCALE_TRICK_OR_TREAT_6; break;
case LOCALE_enUS: default: localizedEntry = LOCALE_TRICK_OR_TREAT_0;
}
pPlayer->CastSpell(pPlayer, trickspell, true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
}
pPlayer->CLOSE_GOSSIP_MENU();
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (pCreature->isInnkeeper())
{
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
{
case LOCALE_deDE: localizedEntry = LOCALE_INNKEEPER_3; break;
case LOCALE_enUS: default: localizedEntry = LOCALE_INNKEEPER_0;
}
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, localizedEntry, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INN);
}
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
pPlayer->CLOSE_GOSSIP_MENU();
switch (uiAction)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
case GOSSIP_ACTION_TRADE: pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); break;
case GOSSIP_ACTION_INN: pPlayer->SetBindPoint(pCreature->GetGUID()); break;
if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
pPlayer->CastSpell(pPlayer, SPELL_TRICK_OR_TREATED, true);
if (urand(0, 1))
pPlayer->CastSpell(pPlayer, SPELL_TREAT, true);
else
{
uint32 trickspell = 0;
switch (urand(0, 13))
{
case 0: trickspell = 24753; break; // cannot cast, random 30sec
case 1: trickspell = 24713; break; // lepper gnome costume
case 2: trickspell = 24735; break; // male ghost costume
case 3: trickspell = 24736; break; // female ghostcostume
case 4: trickspell = 24710; break; // male ninja costume
case 5: trickspell = 24711; break; // female ninja costume
case 6: trickspell = 24708; break; // male pirate costume
case 7: trickspell = 24709; break; // female pirate costume
case 8: trickspell = 24723; break; // skeleton costume
case 9: trickspell = 24753; break; // Trick
case 10: trickspell = 24924; break; // Hallow's End Candy
case 11: trickspell = 24925; break; // Hallow's End Candy
case 12: trickspell = 24926; break; // Hallow's End Candy
case 13: trickspell = 24927; break; // Hallow's End Candy
}
pPlayer->CastSpell(pPlayer, trickspell, true);
}
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
pPlayer->CLOSE_GOSSIP_MENU();
switch (uiAction)
{
case GOSSIP_ACTION_TRADE: pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); break;
case GOSSIP_ACTION_INN: pPlayer->SetBindPoint(pCreature->GetGUID()); break;
}
return true;
}
return true;
}
};
void AddSC_npc_innkeeper()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_innkeeper";
newscript->pGossipHello = &GossipHello_npc_innkeeper;
newscript->pGossipSelect = &GossipSelect_npc_innkeeper;
newscript->RegisterSelf();
new npc_innkeeper;
}
File diff suppressed because it is too large Load Diff
+255 -253
View File
@@ -58,271 +58,273 @@ EndScriptData
#define GOSSIP_WILLIAMKEILAR2 "Take me to Eastwall Tower."
#define GOSSIP_WILLIAMKEILAR3 "Take me to Crown Guard Tower."
bool GossipHello_npc_taxi(Player* pPlayer, Creature* pCreature)
class npc_taxi : public CreatureScript
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
public:
npc_taxi() : CreatureScript("npc_taxi") { }
switch(pCreature->GetEntry()) {
case 17435: // Azuremyst Isle - Susurrus
if (pPlayer->HasItemCount(23843,1,true))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
break;
case 20903: // Netherstorm - Protectorate Nether Drake
if (pPlayer->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(29778,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
break;
case 18725: // Old Hillsbrad Foothills - Brazen
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRAZEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
break;
case 29154: // Stormwind City - Thargold Ironwing
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
break;
case 19409: // Hellfire Peninsula - Wing Commander Dabir'ee
//Mission: The Murketh and Shaadraz Gateways
if (pPlayer->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
//Shatter Point
if (!pPlayer->GetQuestRewardStatus(10340))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
break;
case 20235: // Hellfire Peninsula - Gryphoneer Windbellow
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (pPlayer->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
switch(pCreature->GetEntry())
{
case 17435: // Azuremyst Isle - Susurrus
if (pPlayer->HasItemCount(23843,1,true))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
break;
case 20903: // Netherstorm - Protectorate Nether Drake
if (pPlayer->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(29778,1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
break;
case 18725: // Old Hillsbrad Foothills - Brazen
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRAZEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
break;
case 29154: // Stormwind City - Thargold Ironwing
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
break;
case 19409: // Hellfire Peninsula - Wing Commander Dabir'ee
//Mission: The Murketh and Shaadraz Gateways
if (pPlayer->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
//Go to the Front
if (pPlayer->GetQuestStatus(10382) != QUEST_STATUS_NONE && !pPlayer->GetQuestRewardStatus(10382))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
break;
case 19401: // Hellfire Peninsula - Wing Commander Brack
//Mission: The Murketh and Shaadraz Gateways
if (pPlayer->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
//Shatter Point
if (!pPlayer->GetQuestRewardStatus(10340))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
break;
case 20235: // Hellfire Peninsula - Gryphoneer Windbellow
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (pPlayer->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (pPlayer->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
//Go to the Front
if (pPlayer->GetQuestStatus(10382) != QUEST_STATUS_NONE && !pPlayer->GetQuestRewardStatus(10382))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
break;
case 19401: // Hellfire Peninsula - Wing Commander Brack
//Mission: The Murketh and Shaadraz Gateways
if (pPlayer->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
//Spinebreaker Post
if (pPlayer->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(10242))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
break;
case 23413: // Blade's Edge Mountains - Skyguard Handler Irena
if (pPlayer->GetReputationRank(1031) >= REP_HONORED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRENA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
break;
case 25059: // Isle of Quel'Danas - Ayren Cloudbreaker
if (pPlayer->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
if (pPlayer->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
if (pPlayer->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
break;
case 25236: // Isle of Quel'Danas - Unrestrained Dragonhawk
if (pPlayer->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || pPlayer->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DRAGONHAWK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
break;
case 20162: // Netherstorm - Veronia
//Behind Enemy Lines
if (pPlayer->GetQuestStatus(10652) && !pPlayer->GetQuestRewardStatus(10652))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
break;
case 23415: // Terokkar Forest - Skyguard Handler Deesak
if (pPlayer->GetReputationRank(1031) >= REP_HONORED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEESAK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
break;
case 27575: // Dragonblight - Lord Afrasastrasz
// middle -> ground
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
// middle -> top
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
break;
case 26443: // Dragonblight - Tariolstrasz //need to check if quests are required before gossip available (12123, 12124)
// ground -> top
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
// ground -> middle
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
break;
case 26949: // Dragonblight - Torastrasza
// top -> middle
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
// top -> ground
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
break;
case 23816: // Howling Fjord - Bat Handler Camille
if (!pPlayer->GetQuestRewardStatus(11229))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CAMILLE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
if (pPlayer->GetQuestStatus(11170) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CAMILLE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
break;
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
if (pPlayer->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+25);
break;
case 26602:
if (pCreature->isTaxi())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, GOSSIP_THRICESTAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
if (pPlayer->GetQuestStatus(11692) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_THRICESTAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 27);
break;
case 17209:
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 28);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 29);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
break;
}
//Spinebreaker Post
if (pPlayer->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(10242))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
break;
case 23413: // Blade's Edge Mountains - Skyguard Handler Irena
if (pPlayer->GetReputationRank(1031) >= REP_HONORED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRENA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
break;
case 25059: // Isle of Quel'Danas - Ayren Cloudbreaker
if (pPlayer->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_taxi(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch(uiAction) {
case GOSSIP_ACTION_INFO_DEF:
//spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506.
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,32474,true);
break;
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
break;
case GOSSIP_ACTION_INFO_DEF + 2:
if (!pPlayer->HasItemCount(25853,1)) {
pPlayer->SEND_GOSSIP_MENU(9780, pCreature->GetGUID());
} else {
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(534); //TaxiPath 534
if (pPlayer->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
break;
case 25236: // Isle of Quel'Danas - Unrestrained Dragonhawk
if (pPlayer->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || pPlayer->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DRAGONHAWK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
break;
case 20162: // Netherstorm - Veronia
//Behind Enemy Lines
if (pPlayer->GetQuestStatus(10652) && !pPlayer->GetQuestRewardStatus(10652))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
break;
case 23415: // Terokkar Forest - Skyguard Handler Deesak
if (pPlayer->GetReputationRank(1031) >= REP_HONORED)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEESAK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
break;
case 27575: // Dragonblight - Lord Afrasastrasz
// middle -> ground
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
// middle -> top
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
break;
case 26443: // Dragonblight - Tariolstrasz //need to check if quests are required before gossip available (12123, 12124)
// ground -> top
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
// ground -> middle
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
break;
case 26949: // Dragonblight - Torastrasza
// top -> middle
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
// top -> ground
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
break;
case 23816: // Howling Fjord - Bat Handler Camille
if (!pPlayer->GetQuestRewardStatus(11229))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CAMILLE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
if (pPlayer->GetQuestStatus(11170) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CAMILLE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
break;
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
if (pPlayer->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+25);
break;
case 26602:
if (pCreature->isTaxi())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, GOSSIP_THRICESTAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
if (pPlayer->GetQuestStatus(11692) == QUEST_STATUS_COMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_THRICESTAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 27);
break;
case 17209:
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 28);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 29);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
break;
}
break;
case GOSSIP_ACTION_INFO_DEF + 3:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,53335,true); //TaxiPath 1041 (Stormwind Harbor)
break;
case GOSSIP_ACTION_INFO_DEF + 4:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz)
break;
case GOSSIP_ACTION_INFO_DEF + 5:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
break;
case GOSSIP_ACTION_INFO_DEF + 6:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
break;
case GOSSIP_ACTION_INFO_DEF + 7:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
break;
case GOSSIP_ACTION_INFO_DEF + 8:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz)
break;
case GOSSIP_ACTION_INFO_DEF + 9:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde))
break;
case GOSSIP_ACTION_INFO_DEF + 10:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
break;
case GOSSIP_ACTION_INFO_DEF + 11:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,41278,true); //TaxiPath 706
break;
case GOSSIP_ACTION_INFO_DEF + 12:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45071,true); //TaxiPath 779
break;
case GOSSIP_ACTION_INFO_DEF + 13:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45113,true); //TaxiPath 784
break;
case GOSSIP_ACTION_INFO_DEF + 14:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45353,true); //TaxiPath 788
break;
case GOSSIP_ACTION_INFO_DEF + 15:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,34905,true); //TaxiPath 606
break;
case GOSSIP_ACTION_INFO_DEF + 16:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
break;
case GOSSIP_ACTION_INFO_DEF + 17:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(882);
break;
case GOSSIP_ACTION_INFO_DEF + 18:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(881);
break;
case GOSSIP_ACTION_INFO_DEF + 19:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(878);
break;
case GOSSIP_ACTION_INFO_DEF + 20:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(883);
break;
case GOSSIP_ACTION_INFO_DEF + 21:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(880);
break;
case GOSSIP_ACTION_INFO_DEF + 22:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(879);
break;
case GOSSIP_ACTION_INFO_DEF + 23:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,43074,true); //TaxiPath 736
break;
case GOSSIP_ACTION_INFO_DEF + 24:
pPlayer->CLOSE_GOSSIP_MENU();
//pPlayer->ActivateTaxiPathTo(738);
pPlayer->CastSpell(pPlayer, 43136, false);
break;
case GOSSIP_ACTION_INFO_DEF + 25:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,42295,true);
break;
case GOSSIP_ACTION_INFO_DEF + 26:
pPlayer->GetSession()->SendTaxiMenu(pCreature);
break;
case GOSSIP_ACTION_INFO_DEF + 27:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer, 51446, false);
break;
case GOSSIP_ACTION_INFO_DEF + 28:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(494);
break;
case GOSSIP_ACTION_INFO_DEF + 29:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(495);
break;
case GOSSIP_ACTION_INFO_DEF + 30:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(496);
break;
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
//spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506.
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,32474,true);
break;
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
break;
case GOSSIP_ACTION_INFO_DEF + 2:
if (!pPlayer->HasItemCount(25853,1)) {
pPlayer->SEND_GOSSIP_MENU(9780, pCreature->GetGUID());
} else {
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(534); //TaxiPath 534
}
break;
case GOSSIP_ACTION_INFO_DEF + 3:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,53335,true); //TaxiPath 1041 (Stormwind Harbor)
break;
case GOSSIP_ACTION_INFO_DEF + 4:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33768,true); //TaxiPath 585 (Gateways Murket and Shaadraz)
break;
case GOSSIP_ACTION_INFO_DEF + 5:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,35069,true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
break;
case GOSSIP_ACTION_INFO_DEF + 6:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33899,true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
break;
case GOSSIP_ACTION_INFO_DEF + 7:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,35065,true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
break;
case GOSSIP_ACTION_INFO_DEF + 8:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz)
break;
case GOSSIP_ACTION_INFO_DEF + 9:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde))
break;
case GOSSIP_ACTION_INFO_DEF + 10:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
break;
case GOSSIP_ACTION_INFO_DEF + 11:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,41278,true); //TaxiPath 706
break;
case GOSSIP_ACTION_INFO_DEF + 12:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45071,true); //TaxiPath 779
break;
case GOSSIP_ACTION_INFO_DEF + 13:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45113,true); //TaxiPath 784
break;
case GOSSIP_ACTION_INFO_DEF + 14:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,45353,true); //TaxiPath 788
break;
case GOSSIP_ACTION_INFO_DEF + 15:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,34905,true); //TaxiPath 606
break;
case GOSSIP_ACTION_INFO_DEF + 16:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
break;
case GOSSIP_ACTION_INFO_DEF + 17:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(882);
break;
case GOSSIP_ACTION_INFO_DEF + 18:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(881);
break;
case GOSSIP_ACTION_INFO_DEF + 19:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(878);
break;
case GOSSIP_ACTION_INFO_DEF + 20:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(883);
break;
case GOSSIP_ACTION_INFO_DEF + 21:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(880);
break;
case GOSSIP_ACTION_INFO_DEF + 22:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(879);
break;
case GOSSIP_ACTION_INFO_DEF + 23:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,43074,true); //TaxiPath 736
break;
case GOSSIP_ACTION_INFO_DEF + 24:
pPlayer->CLOSE_GOSSIP_MENU();
//pPlayer->ActivateTaxiPathTo(738);
pPlayer->CastSpell(pPlayer, 43136, false);
break;
case GOSSIP_ACTION_INFO_DEF + 25:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer,42295,true);
break;
case GOSSIP_ACTION_INFO_DEF + 26:
pPlayer->GetSession()->SendTaxiMenu(pCreature);
break;
case GOSSIP_ACTION_INFO_DEF + 27:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer, 51446, false);
break;
case GOSSIP_ACTION_INFO_DEF + 28:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(494);
break;
case GOSSIP_ACTION_INFO_DEF + 29:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(495);
break;
case GOSSIP_ACTION_INFO_DEF + 30:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(496);
break;
}
return true;
}
};
void AddSC_npc_taxi()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_taxi";
newscript->pGossipHello = &GossipHello_npc_taxi;
newscript->pGossipSelect = &GossipSelect_npc_taxi;
newscript->RegisterSelf();
new npc_taxi;
}
File diff suppressed because it is too large Load Diff