*Integrate Script system to Core

-added ScriptMgr for loading scripts
-removed bindings
-moved script system to src/game
-moved scripts to src/scripts
-VC project files updated
-cmakes updated (not 100% done yet)

NOTE to Devs:
-file locations changed
-precompiled renamed to ScriptedPch
-ecsort_ai renamed to ScriptedEscortAI
-follower_ai renamed to ScriptedFollowerAI
-guard_ai renamed to ScriptedGuardAI
-simple_ai renamed to ScriptedSimpleAI
-sc_creature renamed to ScriptedCreature
-sc_gossip renamed to ScriptedGossip
-sc_instance  renamed to ScriptedInstance

*use the new headers in scripts, thank you

NOTE to ALL:
cmake not fully tested, please report any errors with it
could make creashes, incompability
USE AT YOUR OWN RISK before further tests!!

--HG--
branch : trunk
This commit is contained in:
Rat
2010-01-19 11:36:05 +01:00
parent f5dea61b66
commit 0cc053ea4d
601 changed files with 3908 additions and 7245 deletions
+120
View File
@@ -0,0 +1,120 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Areatrigger_Scripts
SD%Complete: 100
SDComment: Scripts for areatriggers
SDCategory: Areatrigger
EndScriptData */
/* ContentData
at_coilfang_waterfall 4591
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
at_ravenholdt
at_warsong_slaughterhouse
at_warsong_grainery
at_torp_farm
EndContentData */
#include "ScriptedPch.h"
/*######
## at_coilfang_waterfall
######*/
enum eCoilfangGOs
{
GO_COILFANG_WATERFALL = 184212
};
bool AreaTrigger_at_coilfang_waterfall(Player *pPlayer, const AreaTriggerEntry *pAt)
{
if (GameObject* pGo = GetClosestGameObjectWithEntry(pPlayer, GO_COILFANG_WATERFALL, 35.0f))
if (pGo->getLootState() == GO_READY)
pGo->UseDoorOrButton();
return false;
}
/*#####
## at_legion_teleporter
#####*/
enum eLegionTeleporter
{
SPELL_TELE_A_TO = 37387,
QUEST_GAINING_ACCESS_A = 10589,
SPELL_TELE_H_TO = 37389,
QUEST_GAINING_ACCESS_H = 10604
};
bool AreaTrigger_at_legion_teleporter(Player *pPlayer, const AreaTriggerEntry *pAt)
{
if (pPlayer->isAlive() && !pPlayer->isInCombat())
{
if (pPlayer->GetTeam() == ALLIANCE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_A))
{
pPlayer->CastSpell(pPlayer, SPELL_TELE_A_TO, false);
return true;
}
if (pPlayer->GetTeam() == HORDE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_H))
{
pPlayer->CastSpell(pPlayer, SPELL_TELE_H_TO, false);
return true;
}
return false;
}
return false;
}
enum eRavenholdt
{
QUEST_MANOR_RAVENHOLDT = 6681,
NPC_RAVENHOLDT = 13936
};
bool AreaTrigger_at_ravenholdt(Player* pPlayer, const AreaTriggerEntry* pAt)
{
if (pPlayer->GetQuestStatus(QUEST_MANOR_RAVENHOLDT) == QUEST_STATUS_INCOMPLETE)
pPlayer->KilledMonsterCredit(NPC_RAVENHOLDT, 0);
return false;
}
void AddSC_areatrigger_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "at_coilfang_waterfall";
newscript->pAreaTrigger = &AreaTrigger_at_coilfang_waterfall;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_legion_teleporter";
newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_ravenholdt";
newscript->pAreaTrigger = &AreaTrigger_at_ravenholdt;
newscript->RegisterSelf();
}
+144
View File
@@ -0,0 +1,144 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Emeriss
SD%Complete: 90
SDComment: Teleport function & Mark of Nature missing
SDCategory: Bosses
EndScriptData */
#include "ScriptedPch.h"
enum eEnums
{
SAY_AGGRO = -1000401,
SAY_CASTCORRUPTION = -1000402, //signed for 6182
SPELL_SLEEP = 24777,
SPELL_NOXIOUSBREATH = 24818,
SPELL_TAILSWEEP = 15847,
//SPELL_MARKOFNATURE = 25040, // Not working
SPELL_VOLATILEINFECTION = 24928,
SPELL_CORRUPTIONOFEARTH = 24910
};
struct TRINITY_DLL_DECL boss_emerissAI : public ScriptedAI
{
boss_emerissAI(Creature *c) : ScriptedAI(c) {}
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()
{
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;
}
void Aggro(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
}
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(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(m_creature, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
// m_uiMarkOfNature_Timer -= uiDiff;
//VolatileInfection_Timer
if (m_uiVolatileInfection_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_VOLATILEINFECTION);
m_uiVolatileInfection_Timer = 7000 + rand()%5000;
}
else
m_uiVolatileInfection_Timer -= uiDiff;
//CorruptionofEarth_Timer
//CorruptionofEarth at 75%, 50% and 25%
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiCorruptionsCasted)))
{
++m_uiCorruptionsCasted; // prevent casting twice on same hp
DoScriptText(SAY_CASTCORRUPTION, m_creature);
DoCast(m_creature->getVictim(), SPELL_CORRUPTIONOFEARTH);
}
DoMeleeAttackIfReady();
}
};
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();
}
+25
View File
@@ -0,0 +1,25 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Lethon
SD%Complete: 0
SDComment: Place Holder
SDCategory: Bosses
EndScriptData */
#include "ScriptedPch.h"
+263
View File
@@ -0,0 +1,263 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Taerar
SD%Complete: 70
SDComment: Mark of Nature & Teleport NYI. Fix the way to be banished.
SDCategory: Bosses
EndScriptData */
#include "ScriptedPch.h"
enum eEnums
{
SAY_AGGRO = -1000399, //signed for 20021
SAY_SUMMONSHADE = -1000400, //signed for 20021
//Spells of Taerar
SPELL_SLEEP = 24777,
SPELL_NOXIOUSBREATH = 24818,
SPELL_TAILSWEEP = 15847,
// SPELL_MARKOFNATURE = 25040, // Not working
SPELL_ARCANEBLAST = 24857,
SPELL_BELLOWINGROAR = 22686,
SPELL_SUMMONSHADE_1 = 24841,
SPELL_SUMMONSHADE_2 = 24842,
SPELL_SUMMONSHADE_3 = 24843,
//Spells of Shades of Taerar
SPELL_POSIONCLOUD = 24840,
SPELL_POSIONBREATH = 20667
};
uint32 m_auiSpellSummonShade[]=
{
SPELL_SUMMONSHADE_1, SPELL_SUMMONSHADE_2, SPELL_SUMMONSHADE_3
};
struct TRINITY_DLL_DECL boss_taerarAI : public ScriptedAI
{
boss_taerarAI(Creature *c) : ScriptedAI(c) {}
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()
{
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;
m_bShades = false;
}
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
}
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)
{
//Become unbanished again
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_bShades = false;
}
else if (m_bShades)
{
m_uiShades_Timer -= uiDiff;
//Do nothing while banished
return;
}
//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(m_creature->getVictim(), SPELL_NOXIOUSBREATH);
m_uiNoxiousBreath_Timer = 14000 + rand()%6000;
}
else
m_uiNoxiousBreath_Timer -= uiDiff;
//Tailsweep every 2 seconds
if (m_uiTailSweep_Timer <= uiDiff)
{
DoCast(m_creature, SPELL_TAILSWEEP);
m_uiTailSweep_Timer = 2000;
}
else
m_uiTailSweep_Timer -= uiDiff;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(m_creature->getVictim(), SPELL_MARKOFNATURE);
// m_uiMarkOfNature_Timer = 45000;
//}
//else
// m_uiMarkOfNature_Timer -= uiDiff;
//ArcaneBlast_Timer
if (m_uiArcaneBlast_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANEBLAST);
m_uiArcaneBlast_Timer = 7000 + rand()%5000;
}
else
m_uiArcaneBlast_Timer -= uiDiff;
//BellowingRoar_Timer
if (m_uiBellowingRoar_Timer <= uiDiff)
{
DoCast(m_creature->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 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiShadesSummoned)))
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
//Inturrupt any spell casting
m_creature->InterruptNonMeleeSpells(false);
//horrible workaround, need to fix
m_creature->setFaction(35);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SAY_SUMMONSHADE, m_creature);
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();
}
};
// Shades of Taerar Script
struct TRINITY_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI
{
boss_shadeoftaerarAI(Creature *c) : ScriptedAI(c) {}
uint32 m_uiPoisonCloud_Timer;
uint32 m_uiPosionBreath_Timer;
void Reset()
{
m_uiPoisonCloud_Timer = 8000;
m_uiPosionBreath_Timer = 12000;
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//PoisonCloud_Timer
if (m_uiPoisonCloud_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_POSIONCLOUD);
m_uiPoisonCloud_Timer = 30000;
}
else
m_uiPoisonCloud_Timer -= uiDiff;
//PosionBreath_Timer
if (m_uiPosionBreath_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_POSIONBREATH);
m_uiPosionBreath_Timer = 12000;
}
else
m_uiPosionBreath_Timer -= uiDiff;
DoMeleeAttackIfReady();
}
};
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();
}
+203
View File
@@ -0,0 +1,203 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Ysondre
SD%Complete: 90
SDComment: Mark of Nature & Teleport missing
SDCategory: Bosses
EndScriptData */
#include "ScriptedPch.h"
enum eEnums
{
SAY_AGGRO = -1000360, //signed for 17969
SAY_SUMMONDRUIDS = -1000361, //signed for 17969
SPELL_SLEEP = 24777,
SPELL_NOXIOUSBREATH = 24818,
SPELL_TAILSWEEP = 15847,
//SPELL_MARKOFNATURE = 25040, // Not working
SPELL_LIGHTNINGWAVE = 24819,
SPELL_SUMMONDRUIDS = 24795,
SPELL_SUMMON_PLAYER = 24776,
//druid spells
SPELL_MOONFIRE = 21669
};
// Ysondre script
struct TRINITY_DLL_DECL boss_ysondreAI : public ScriptedAI
{
boss_ysondreAI(Creature* pCreature) : ScriptedAI(pCreature) {}
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()
{
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;
}
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void JustSummoned(Creature* pSummoned)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
pSummoned->AI()->AttackStart(pTarget);
}
void UpdateAI(const uint32 uiDiff)
{
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(m_creature->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;
//MarkOfNature_Timer
//if (m_uiMarkOfNature_Timer <= uiDiff)
//{
// DoCast(m_creature->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 ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(25*m_uiSummonDruidModifier)))
{
DoScriptText(SAY_SUMMONDRUIDS, m_creature);
for (int i = 0; i < 10; ++i)
DoCast(m_creature, SPELL_SUMMONDRUIDS, true);
++m_uiSummonDruidModifier;
}
DoMeleeAttackIfReady();
}
};
// Summoned druid script
struct TRINITY_DLL_DECL mob_dementeddruidsAI : public ScriptedAI
{
mob_dementeddruidsAI(Creature *c) : ScriptedAI(c) {}
uint32 m_uiMoonFire_Timer;
void Reset()
{
m_uiMoonFire_Timer = 3000;
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//MoonFire_Timer
if (m_uiMoonFire_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
m_uiMoonFire_Timer = 5000;
}
else
m_uiMoonFire_Timer -= uiDiff;
DoMeleeAttackIfReady();
}
};
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();
}
+849
View File
@@ -0,0 +1,849 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: GO_Scripts
SD%Complete: 100
SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 6481, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089,12843,12982, 2936
SDCategory: Game Objects
EndScriptData */
/* ContentData
go_cat_figurine (the "trap" version of GO, two different exist)
go_northern_crystal_pylon
go_eastern_crystal_pylon
go_western_crystal_pylon
go_barov_journal
go_ethereum_prison
go_ethereum_stasis
go_sacred_fire_of_life
go_shrine_of_the_birds
go_southfury_moonstone
go_field_repair_bot_74A
go_orb_of_command
go_resonite_cask
go_tablet_of_madness
go_tablet_of_the_seven
go_tele_to_dalaran_crystal
go_tele_to_violet_stand
go_rusty_cage
go_scourge_cage
go_jotunheim_cage
go_table_theka
EndContentData */
#include "ScriptedPch.h"
/*######
## go_cat_figurine
######*/
enum eCatFigurine
{
SPELL_SUMMON_GHOST_SABER = 5968,
};
bool GOHello_go_cat_figurine(Player *pPlayer, GameObject *pGO)
{
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_GHOST_SABER,true);
return false;
}
/*######
## go_crystal_pylons (3x)
######*/
bool GOHello_go_northern_crystal_pylon(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGO->GetGUID());
pPlayer->SendPreparedQuest(pGO->GetGUID());
}
if (pPlayer->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4285);
return true;
}
bool GOHello_go_eastern_crystal_pylon(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGO->GetGUID());
pPlayer->SendPreparedQuest(pGO->GetGUID());
}
if (pPlayer->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4287);
return true;
}
bool GOHello_go_western_crystal_pylon(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGO->GetGUID());
pPlayer->SendPreparedQuest(pGO->GetGUID());
}
if (pPlayer->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4288);
return true;
}
/*######
## go_barov_journal
######*/
bool GOHello_go_barov_journal(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !pPlayer->HasSpell(26086))
{
pPlayer->CastSpell(pPlayer,26095,false);
}
return true;
}
/*######
## go_field_repair_bot_74A
######*/
bool GOHello_go_field_repair_bot_74A(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->HasSkill(SKILL_ENGINERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !pPlayer->HasSpell(22704))
{
pPlayer->CastSpell(pPlayer,22864,false);
}
return true;
}
/*######
## go_gilded_brazier
######*/
enum eGildedBrazier
{
NPC_STILLBLADE = 17716,
};
bool GOHello_go_gilded_brazier(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632, -7542.740, 151.568, 0.122, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
pCreature->AI()->AttackStart(pPlayer);
return true;
}
/*######
## go_orb_of_command
######*/
bool GOHello_go_orb_of_command(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestRewardStatus(7761))
pPlayer->CastSpell(pPlayer,23460,true);
return true;
}
/*######
## go_tablet_of_madness
######*/
bool GOHello_go_tablet_of_madness(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->HasSkill(SKILL_ALCHEMY) && pPlayer->GetSkillValue(SKILL_ALCHEMY) >= 300 && !pPlayer->HasSpell(24266))
{
pPlayer->CastSpell(pPlayer,24267,false);
}
return true;
}
/*######
## go_tablet_of_the_seven
######*/
//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
bool GOHello_go_tablet_of_the_seven(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
return true;
if (pPlayer->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
pPlayer->CastSpell(pPlayer,15065,false);
return true;
}
/*#####
## go_jump_a_tron
######*/
bool GOHello_go_jump_a_tron(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE)
pPlayer->CastSpell(pPlayer,33382,true);
return true;
}
/*######
## go_ethereum_prison
######*/
enum eEthereumPrison
{
SPELL_REP_LC = 39456,
SPELL_REP_SHAT = 39457,
SPELL_REP_CE = 39460,
SPELL_REP_CON = 39474,
SPELL_REP_KT = 39475,
SPELL_REP_SPOR = 39476
};
const uint32 NpcPrisonEntry[] =
{
22810, 22811, 22812, 22813, 22814, 22815, //good guys
20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys
};
bool GOHello_go_ethereum_prison(Player *pPlayer, GameObject *pGO)
{
int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
if (Creature* pCreature = pPlayer->SummonCreature(NpcPrisonEntry[Random],
pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(pPlayer),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
if (!pCreature->IsHostileTo(pPlayer))
{
uint32 Spell = 0;
if (FactionTemplateEntry const* pFaction = pCreature->getFactionTemplateEntry())
{
switch(pFaction->faction)
{
case 1011: Spell = SPELL_REP_LC; break;
case 935: Spell = SPELL_REP_SHAT; break;
case 942: Spell = SPELL_REP_CE; break;
case 933: Spell = SPELL_REP_CON; break;
case 989: Spell = SPELL_REP_KT; break;
case 970: Spell = SPELL_REP_SPOR; break;
}
if (Spell)
pCreature->CastSpell(pPlayer, Spell, false);
else
error_log("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction());
}
}
}
return false;
}
/*######
## go_ethereum_stasis
######*/
const uint32 NpcStasisEntry[] =
{
22825, 20888, 22827, 22826, 22828
};
bool GOHello_go_ethereum_stasis(Player *pPlayer, GameObject *pGO)
{
int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32));
pPlayer->SummonCreature(NpcStasisEntry[Random],
pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(pPlayer),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return false;
}
/*######
## go_resonite_cask
######*/
enum eResoniteCask
{
NPC_GOGGEROC = 11920
};
bool GOHello_go_resonite_cask(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
return false;
}
/*######
## go_sacred_fire_of_life
######*/
#define NPC_ARIKARA 10882
bool GOHello_go_sacred_fire_of_life(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
pPlayer->SummonCreature(NPC_ARIKARA, -5008.338, -2118.894, 83.657, 0.874, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return true;
}
/*######
## go_shrine_of_the_birds
######*/
enum eShrineOfTheBirds
{
NPC_HAWK_GUARD = 22992,
NPC_EAGLE_GUARD = 22993,
NPC_FALCON_GUARD = 22994,
GO_SHRINE_HAWK = 185551,
GO_SHRINE_EAGLE = 185547,
GO_SHRINE_FALCON = 185553
};
bool GOHello_go_shrine_of_the_birds(Player *pPlayer, GameObject *pGO)
{
uint32 BirdEntry = 0;
float fX, fY, fZ;
pGO->GetClosePoint(fX, fY, fZ, pGO->GetObjectSize(), INTERACTION_DISTANCE);
switch(pGO->GetEntry())
{
case GO_SHRINE_HAWK:
BirdEntry = NPC_HAWK_GUARD;
break;
case GO_SHRINE_EAGLE:
BirdEntry = NPC_EAGLE_GUARD;
break;
case GO_SHRINE_FALCON:
BirdEntry = NPC_FALCON_GUARD;
break;
}
if (BirdEntry)
pPlayer->SummonCreature(BirdEntry, fX, fY, fZ, pGO->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
return false;
}
/*######
## go_southfury_moonstone
######*/
enum eSouthfury
{
NPC_RIZZLE = 23002,
SPELL_BLACKJACK = 39865, //stuns player
SPELL_SUMMON_RIZZLE = 39866
};
bool GOHello_go_southfury_moonstone(Player *pPlayer, GameObject *pGO)
{
//implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
//pPlayer->CastSpell(pPlayer,SPELL_SUMMON_RIZZLE,false);
if (Creature* pCreature = pPlayer->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
pCreature->CastSpell(pPlayer,SPELL_BLACKJACK,false);
return false;
}
/*######
## go_tele_to_dalaran_crystal
######*/
enum eDalaranCrystal
{
QUEST_LEARN_LEAVE_RETURN = 12790,
QUEST_TELE_CRYSTAL_FLAG = 12845
};
bool GOHello_go_tele_to_dalaran_crystal(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
return false;
//TODO: must send error message (what kind of message? On-screen?)
return true;
}
/*######
## go_tele_to_violet_stand
######*/
bool GOHello_go_tele_to_violet_stand(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || pPlayer->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE)
return false;
return true;
}
/*######
## go_fel_crystalforge
######*/
#define GOSSIP_FEL_CRYSTALFORGE_TEXT 31000
#define GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN 31001
#define GOSSIP_FEL_CRYSTALFORGE_ITEM_1 "Purchase 1 Unstable Flask of the Beast for the cost of 10 Apexis Shards"
#define GOSSIP_FEL_CRYSTALFORGE_ITEM_5 "Purchase 5 Unstable Flask of the Beast for the cost of 50 Apexis Shards"
#define GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN "Use the fel crystalforge to make another purchase."
enum eFelCrystalforge
{
SPELL_CREATE_1_FLASK_OF_BEAST = 40964,
SPELL_CREATE_5_FLASK_OF_BEAST = 40965,
};
bool GOHello_go_fel_crystalforge(Player *pPlayer, GameObject *pGO)
{
if ( pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER ) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
pPlayer->PrepareQuestMenu(pGO->GetGUID()); /* return true*/
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID());
return true;
}
bool GOSelect_go_fel_crystalforge(Player *pPlayer, GameObject *pGO, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
pPlayer->CastSpell(pPlayer,SPELL_CREATE_1_FLASK_OF_BEAST,false);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->CastSpell(pPlayer,SPELL_CREATE_5_FLASK_OF_BEAST,false);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID());
break;
}
return true;
}
/*######
## go_bashir_crystalforge
######*/
enum eBashirCrystalforge
{
SPELL_CREATE_1_FLASK_OF_SORCERER = 40968,
SPELL_CREATE_5_FLASK_OF_SORCERER = 40970,
};
bool GOHello_go_bashir_crystalforge(Player *pPlayer, GameObject *pGO)
{
pPlayer->CastSpell(pPlayer,SPELL_CREATE_1_FLASK_OF_SORCERER,false);
return false;
}
/*######
## matrix_punchograph
######*/
enum eMatrixPunchograph
{
ITEM_WHITE_PUNCH_CARD = 9279,
ITEM_YELLOW_PUNCH_CARD = 9280,
ITEM_BLUE_PUNCH_CARD = 9282,
ITEM_RED_PUNCH_CARD = 9281,
ITEM_PRISMATIC_PUNCH_CARD = 9316,
SPELL_YELLOW_PUNCH_CARD = 11512,
SPELL_BLUE_PUNCH_CARD = 11525,
SPELL_RED_PUNCH_CARD = 11528,
SPELL_PRISMATIC_PUNCH_CARD = 11545,
MATRIX_PUNCHOGRAPH_3005_A = 142345,
MATRIX_PUNCHOGRAPH_3005_B = 142475,
MATRIX_PUNCHOGRAPH_3005_C = 142476,
MATRIX_PUNCHOGRAPH_3005_D = 142696,
};
bool GOHello_go_matrix_punchograph(Player *pPlayer, GameObject *pGO)
{
switch(pGO->GetEntry())
{
case MATRIX_PUNCHOGRAPH_3005_A:
if(pPlayer->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_WHITE_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_YELLOW_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_B:
if(pPlayer->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_YELLOW_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_BLUE_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_C:
if(pPlayer->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_BLUE_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer,SPELL_RED_PUNCH_CARD,true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_D:
if(pPlayer->HasItemCount(ITEM_RED_PUNCH_CARD, 1))
{
pPlayer->DestroyItemCount(ITEM_RED_PUNCH_CARD, 1, true);
pPlayer->CastSpell(pPlayer, SPELL_PRISMATIC_PUNCH_CARD, true);
}
break;
default:
break;
}
return false;
}
/*######
## go_rusty_cage
######*/
enum eRustyCage
{
NPC_GOBLIN_PRISIONER = 29466
};
bool GOHello_go_rusty_cage(Player *pPlayer, GameObject *pGO)
{
if(Creature *pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true))
{
pGO->SetGoState(GO_STATE_ACTIVE);
pPlayer->KilledMonsterCredit(NPC_GOBLIN_PRISIONER, pGoblinPrisoner->GetGUID());
pGoblinPrisoner->DisappearAndDie();
}
return true;
}
/*######
## go_scourge_cage
######*/
enum eScourgeCage
{
NPC_SCOURGE_PRISONER = 25610
};
bool GOHello_go_scourge_cage(Player *pPlayer, GameObject *pGO)
{
if (Creature *pNearestPrisoner = pGO->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true))
{
pGO->SetGoState(GO_STATE_ACTIVE);
pPlayer->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID());
pNearestPrisoner->DisappearAndDie();
}
return true;
}
/*######
## go_arcane_prison
######*/
enum eArcanePrison
{
QUEST_PRISON_BREAK = 11587,
SPELL_ARCANE_PRISONER_KILL_CREDIT = 45456
};
bool GOHello_go_arcane_prison(Player *pPlayer, GameObject *pGO)
{
if (pPlayer->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE)
{
pGO->SummonCreature(25318, 3485.089844, 6115.7422188, 70.966812, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
pPlayer->CastSpell(pPlayer, SPELL_ARCANE_PRISONER_KILL_CREDIT, true);
return true;
} else
return false;
}
/*######
## go_blood_filled_orb
######*/
#define NPC_ZELEMAR 17830
bool GOHello_go_blood_filled_orb(Player *pPlayer, GameObject *pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
pPlayer->SummonCreature(NPC_ZELEMAR, -369.746, 166.759, -21.50, 5.235, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return true;
}
/*######
## go_jotunheim_cage
######*/
enum eJotunheimCage
{
NPC_EBON_BLADE_PRISONER_HUMAN = 30186,
NPC_EBON_BLADE_PRISONER_NE = 30194,
NPC_EBON_BLADE_PRISONER_TROLL = 30196,
NPC_EBON_BLADE_PRISONER_ORC = 30195,
SPELL_SUMMON_BLADE_KNIGHT_H = 56207,
SPELL_SUMMON_BLADE_KNIGHT_NE = 56209,
SPELL_SUMMON_BLADE_KNIGHT_ORC = 56212,
SPELL_SUMMON_BLADE_KNIGHT_TROLL = 56214
};
bool GOHello_go_jotunheim_cage(Player* pPlayer, GameObject* pGO)
{
Creature* pPrisoner;
pPrisoner = NULL;
if ((pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true)) ||
(pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true)))
{
if (pPrisoner && pPrisoner->isAlive())
{
pPrisoner->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
switch(pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
break;
}
}
}
return true;
}
enum eTableTheka
{
GOSSIP_TABLE_THEKA = 1653,
QUEST_SPIDER_GOLD = 2936
};
bool GOHello_go_table_theka(Player* pPlayer, GameObject* pGO)
{
if (pPlayer->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, pGO->GetGUID());
return true;
}
/*######
* ## go_inconspicuous_landmark
* ######*/
enum eInconspicuousLandmark
{
SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB = 11462,
ITEM_CUERGOS_KEY = 9275,
};
bool GOHello_go_inconspicuous_landmark(Player *pPlayer, GameObject* pGO)
{
if (pPlayer->HasItemCount(ITEM_CUERGOS_KEY,1))
return false;
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB,true);
return true;
}
void AddSC_go_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "go_cat_figurine";
newscript->pGOHello = &GOHello_go_cat_figurine;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_northern_crystal_pylon";
newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_eastern_crystal_pylon";
newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_western_crystal_pylon";
newscript->pGOHello = &GOHello_go_western_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_barov_journal";
newscript->pGOHello = &GOHello_go_barov_journal;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_field_repair_bot_74A";
newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_gilded_brazier";
newscript->pGOHello = &GOHello_go_gilded_brazier;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_orb_of_command";
newscript->pGOHello = &GOHello_go_orb_of_command;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_shrine_of_the_birds";
newscript->pGOHello = &GOHello_go_shrine_of_the_birds;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_southfury_moonstone";
newscript->pGOHello = &GOHello_go_southfury_moonstone;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tablet_of_madness";
newscript->pGOHello = &GOHello_go_tablet_of_madness;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tablet_of_the_seven";
newscript->pGOHello = &GOHello_go_tablet_of_the_seven;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_jump_a_tron";
newscript->pGOHello = &GOHello_go_jump_a_tron;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_ethereum_prison";
newscript->pGOHello = &GOHello_go_ethereum_prison;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_ethereum_stasis";
newscript->pGOHello = &GOHello_go_ethereum_stasis;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_resonite_cask";
newscript->pGOHello = &GOHello_go_resonite_cask;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_sacred_fire_of_life";
newscript->pGOHello = &GOHello_go_sacred_fire_of_life;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tele_to_dalaran_crystal";
newscript->pGOHello = &GOHello_go_tele_to_dalaran_crystal;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tele_to_violet_stand";
newscript->pGOHello = &GOHello_go_tele_to_violet_stand;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_fel_crystalforge";
newscript->pGOHello = &GOHello_go_fel_crystalforge;
newscript->pGOSelect = &GOSelect_go_fel_crystalforge;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_bashir_crystalforge";
newscript->pGOHello = &GOHello_go_bashir_crystalforge;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_matrix_punchograph";
newscript->pGOHello = &GOHello_go_matrix_punchograph;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_rusty_cage";
newscript->pGOHello = &GOHello_go_rusty_cage;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_scourge_cage";
newscript->pGOHello = &GOHello_go_scourge_cage;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_arcane_prison";
newscript->pGOHello = &GOHello_go_arcane_prison;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_blood_filled_orb";
newscript->pGOHello = &GOHello_go_blood_filled_orb;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_jotunheim_cage";
newscript->pGOHello = &GOHello_go_jotunheim_cage;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_table_theka";
newscript->pGOHello = &GOHello_go_table_theka;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_inconspicuous_landmark";
newscript->pGOHello = &GOHello_go_inconspicuous_landmark;
newscript->RegisterSelf();
}
File diff suppressed because it is too large Load Diff
+377
View File
@@ -0,0 +1,377 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Item_Scripts
SD%Complete: 100
SDComment: Items for a range of different items. See content below (in script)
SDCategory: Items
EndScriptData */
/* ContentData
item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
item_flying_machine(i34060,i34061) Engineering crafted flying machines
item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
item_only_for_flight Items which should only useable while flying
EndContentData */
#include "ScriptedPch.h"
#include "Spell.h"
/*#####
# item_only_for_flight
#####*/
enum eOnlyForFlight
{
SPELL_ARCANE_CHARGES = 45072
};
bool ItemUse_item_only_for_flight(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
{
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;
}
/*#####
# 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)
{
//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)
{
if (urand(0,99) < 35)
{
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;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 23614, 1);
if (msg == EQUIP_ERR_OK)
{
if (Item* item = pPlayer->StoreNewItem(dest,23614,true))
pPlayer->SendNewItem(item,1,false,true);
} else
pPlayer->SendEquipError(msg,NULL,NULL);
}
}
//}
return false;
}
/*#####
# item_nether_wraith_beacon
#####*/
bool ItemUse_item_nether_wraith_beacon(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
{
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;
}
/*#####
# item_flying_machine
#####*/
bool ItemUse_item_flying_machine(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
{
uint32 itemId = pItem->GetEntry();
if (itemId == 34060)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) >= 225)
return false;
if (itemId == 34061)
if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300)
return false;
debug_log("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId);
pPlayer->SendEquipError(EQUIP_ERR_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)
{
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)
{
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)
{
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;
}
/*#####
# item_disgusting_jar
#####*/
bool ItemExpire_item_disgusting_jar(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)
{
if (!MinionList.empty())
{
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;
}
return true;
}
/*#####
# item_pile_fake_furs
#####*/
enum ePileFakeFur
{
GO_CARIBOU_TRAP_1 = 187982,
GO_CARIBOU_TRAP_2 = 187995,
GO_CARIBOU_TRAP_3 = 187996,
GO_CARIBOU_TRAP_4 = 187997,
GO_CARIBOU_TRAP_5 = 187998,
GO_CARIBOU_TRAP_6 = 187999,
GO_CARIBOU_TRAP_7 = 188000,
GO_CARIBOU_TRAP_8 = 188001,
GO_CARIBOU_TRAP_9 = 188002,
GO_CARIBOU_TRAP_10 = 188003,
GO_CARIBOU_TRAP_11 = 188004,
GO_CARIBOU_TRAP_12 = 188005,
GO_CARIBOU_TRAP_13 = 188006,
GO_CARIBOU_TRAP_14 = 188007,
GO_CARIBOU_TRAP_15 = 188008,
GO_HIGH_QUALITY_FUR = 187983,
NPC_NESINGWARY_TRAPPER = 25835
};
bool ItemUse_item_pile_fake_furs(Player *pPlayer, Item *pItem, SpellCastTargets const &targets)
{
GameObject *pGo;
if ((pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_1, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_2, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_3, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_4, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_5, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_6, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_7, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_8, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_9, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_10, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_11, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_12, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_13, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_14, 5.0f)) ||
(pGo = pPlayer->FindNearestGameObject(GO_CARIBOU_TRAP_15, 5.0f)))
{
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
#####*/
enum ePetrovClusterBombs
{
SPELL_PETROV_BOMB = 42406,
AREA_ID_SHATTERED_STRAITS = 4064,
ZONE_ID_HOWLING = 495
};
bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
{
if (pPlayer->GetZoneId() != ZONE_ID_HOWLING)
return false;
if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
{
pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB))
Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE);
return true;
}
return false;
}
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();
}
+259
View File
@@ -0,0 +1,259 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Generic_Creature
SD%Complete: 80
SDComment: Should be replaced with core based AI
SDCategory: Creatures
EndScriptData */
#include "ScriptedPch.h"
#define GENERIC_CREATURE_COOLDOWN 5000
struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
{
generic_creatureAI(Creature *c) : ScriptedAI(c) {}
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()
{
GlobalCooldown = 0;
BuffTimer = 0; //Rebuff as soon as we can
IsSelfRooted = false;
}
void EnterCombat(Unit *who)
{
if (!m_creature->IsWithinMeleeRange(who))
{
IsSelfRooted = true;
}
}
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 (!m_creature->isInCombat() && m_creature->isAlive())
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
DoCastSpell(m_creature, 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 (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
info = SelectSpell(m_creature, -1, -1, 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(m_creature->getVictim(), -1, -1, 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() % (m_creature->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(m_creature, info);
else DoCastSpell(m_creature->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
else m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
}
}
else
{
//Only run this code if we arn't already casting
if (!m_creature->IsNonMeleeSpellCasted(false))
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
info = SelectSpell(m_creature, -1, -1, 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(m_creature->getVictim(), -1, -1, 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(m_creature,info);
else DoCastSpell(m_creature->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
m_creature->InterruptNonMeleeSpells(false);
IsSelfRooted = false;
}
}
}
}
};
CreatureAI* GetAI_generic_creature(Creature* pCreature)
{
return new generic_creatureAI (pCreature);
}
struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI
{
trigger_periodicAI(Creature* c) : NullCreatureAI(c)
{
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)
{
if (spell)
me->CastSpell(me, spell, true);
timer = interval;
}
else
timer -= diff;
}
};
struct TRINITY_DLL_DECL 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);
}
};
struct TRINITY_DLL_DECL mob_webwrapAI : public NullCreatureAI
{
mob_webwrapAI(Creature *c) : NullCreatureAI(c), victimGUID(0) {}
uint64 victimGUID;
void SetGUID(const uint64 &guid, int32 param)
{
victimGUID = guid;
if (me->m_spells[0] && victimGUID)
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
}
void JustDied(Unit *killer)
{
if (me->m_spells[0] && victimGUID)
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID());
}
};
CreatureAI* GetAI_trigger_periodic(Creature* pCreature)
{
return new trigger_periodicAI (pCreature);
}
CreatureAI* GetAI_trigger_death(Creature* pCreature)
{
return new trigger_deathAI (pCreature);
}
CreatureAI* GetAI_mob_webwrap(Creature* pCreature)
{
return new mob_webwrapAI (pCreature);
}
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();*/
newscript = new Script;
newscript->Name = "mob_webwrap";
newscript->GetAI = &GetAI_mob_webwrap;
newscript->RegisterSelf();
}
+131
View File
@@ -0,0 +1,131 @@
/*
* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Npc_Innkeeper
SDAuthor: WarHead
SD%Complete: 99% - SendBindPoint(pCreature); needs question if you really want to bind before the real bind is done (don't know how atm)
SDComment: Complete
SDCategory: NPCs
EndScriptData */
#include "ScriptedPch.h"
#define HALLOWEEN_EVENTID 12
#define SPELL_TRICK_OR_TREATED 24755
#define SPELL_TREAT 24715
#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
#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)
{
if (IsEventActive(HALLOWEEN_EVENTID) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED))
{
char* localizedEntry;
switch (pPlayer->GetSession()->GetSessionDbcLocale())
{
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))
{
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->GetSession()->SendBindPoint(pCreature); break;
}
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();
}
File diff suppressed because it is too large Load Diff
+326
View File
@@ -0,0 +1,326 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Npc_Taxi
SD%Complete: 0%
SDComment: To be used for taxi NPCs that are located globally.
SDCategory: NPCs
EndScriptData
*/
#include "ScriptedPch.h"
#define GOSSIP_SUSURRUS "I am ready."
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
#define GOSSIP_BRAZEN "I am ready to go to Durnholde Keep."
#define GOSSIP_IRONWING "I'd like to take a flight around Stormwind Harbor."
#define GOSSIP_DABIREE1 "Fly me to Murketh and Shaadraz Gateways"
#define GOSSIP_DABIREE2 "Fly me to Shatter Point"
#define GOSSIP_WINDBELLOW1 "Fly me to The Abyssal Shelf"
#define GOSSIP_WINDBELLOW2 "Fly me to Honor Point"
#define GOSSIP_BRACK1 "Fly me to Murketh and Shaadraz Gateways"
#define GOSSIP_BRACK2 "Fly me to The Abyssal Shelf"
#define GOSSIP_BRACK3 "Fly me to Spinebreaker Post"
#define GOSSIP_IRENA "Fly me to Skettis please"
#define GOSSIP_CLOUDBREAKER1 "Speaking of uiAction, I've been ordered to undertake an air strike."
#define GOSSIP_CLOUDBREAKER2 "I need to intercept the Dawnblade reinforcements."
#define GOSSIP_DRAGONHAWK "<Ride the dragonhawk to Sun's Reach>"
#define GOSSIP_VERONIA "Fly me to Manaforge Coruu please"
#define GOSSIP_DEESAK "Fly me to Ogri'la please"
#define GOSSIP_AFRASASTRASZ1 "I would like to take a flight to the ground, Lord Of Afrasastrasz."
#define GOSSIP_AFRASASTRASZ2 "My Lord, I must go to the upper floor of the temple."
#define GOSSIP_TARIOLSTRASZ1 "My Lord, I must go to the upper floor of the temple."
#define GOSSIP_TARIOLSTRASZ2 "Can you spare a drake to travel to Lord Of Afrasastrasz, in the middle of the temple?"
#define GOSSIP_TORASTRASZA1 "I would like to see Lord Of Afrasastrasz, in the middle of the temple."
#define GOSSIP_TORASTRASZA2 "Yes, Please. I would like to return to the ground floor of the temple."
#define GOSSIP_CAMILLE1 "I need to fly to the Windrunner Official business!"
#define GOSSIP_CAMILLE2 "<The riding bat for the special task is necessary to me.>"
#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>"
#define GOSSIP_THRICESTAR1 "Do you think I could take a ride on one of those flying machines?"
#define GOSSIP_THRICESTAR2 "Kara, I need to be flown out the Dens of Dying to find Bixie."
#define GOSSIP_WILLIAMKEILAR1 "Take me to Northpass Tower."
#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)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
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);
//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);
//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);
//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);
//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);
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;
}
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
}
break;
case GOSSIP_ACTION_INFO_DEF + 3:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->GetSession()->SendDoFlight(1149, 1041);
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();
}
File diff suppressed because it is too large Load Diff