* Rename InstanceData to InstanceScript

* Rename *mgr to their new names in scripts project
* Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker.

--HG--
branch : trunk
rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp
rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
azazel
2010-08-08 22:54:58 +06:00
parent 8a69e50d6a
commit 590199d8e1
482 changed files with 84476 additions and 82697 deletions
@@ -35,81 +35,103 @@ EndContentData */
//id8530 - cannibal ghoul
//id8531 - gibbering ghoul
//id8532 - diseased flayer
struct mobs_ghoul_flayerAI : public ScriptedAI
␍class mobs_ghoul_flayer : public CreatureScript
{
mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {}
public:
mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { }
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void JustDied(Unit* Killer)
CreatureAI* GetAI(Creature* pCreature) const
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
return new mobs_ghoul_flayerAI (pCreature);
}
struct mobs_ghoul_flayerAI : public ScriptedAI
{
mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
}
};
};
CreatureAI* GetAI_mobs_ghoul_flayer(Creature* pCreature)
{
return new mobs_ghoul_flayerAI (pCreature);
}
/*######
## npc_augustus_the_touched
######*/
bool GossipHello_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature)
␍class npc_augustus_the_touched : public CreatureScript
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
public:
npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { }
if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
};
bool GossipSelect_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
/*######
## npc_darrowshire_spirit
######*/
#define SPELL_SPIRIT_SPAWNIN 17321
struct npc_darrowshire_spiritAI : public ScriptedAI
␍class npc_darrowshire_spirit : public CreatureScript
{
npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {}
public:
npc_darrowshire_spirit() : CreatureScript("npc_darrowshire_spirit") { }
void Reset()
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
DoCast(me, SPELL_SPIRIT_SPAWNIN);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID());
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
return true;
}
void EnterCombat(Unit * /*who*/) {}
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_darrowshire_spiritAI (pCreature);
}
struct npc_darrowshire_spiritAI : public ScriptedAI
{
npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {}
void Reset()
{
DoCast(me, SPELL_SPIRIT_SPAWNIN);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit * /*who*/) {}
};
};
CreatureAI* GetAI_npc_darrowshire_spirit(Creature* pCreature)
{
return new npc_darrowshire_spiritAI (pCreature);
}
bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature)
{
pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID());
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
return true;
}
/*######
## npc_tirion_fordring
@@ -119,69 +141,55 @@ bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature)
#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?"
#define GOSSIP_SELECT2 "That is terrible."
#define GOSSIP_SELECT3 "I will, Tirion."
bool GossipHello_npc_tirion_fordring(Player* pPlayer, Creature* pCreature)
␍class npc_tirion_fordring : public CreatureScript
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
public:
npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { }
if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
switch (uiAction)
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(4493, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(4494, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(4495, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(5742);
break;
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(4493, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(4494, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(4495, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(5742);
break;
}
return true;
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
};
void AddSC_eastern_plaguelands()
{
Script *newscript;
newscript = new Script;
newscript->Name = "mobs_ghoul_flayer";
newscript->GetAI = &GetAI_mobs_ghoul_flayer;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_augustus_the_touched";
newscript->pGossipHello = &GossipHello_npc_augustus_the_touched;
newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_darrowshire_spirit";
newscript->GetAI = &GetAI_npc_darrowshire_spirit;
newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tirion_fordring";
newscript->pGossipHello = &GossipHello_npc_tirion_fordring;
newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring;
newscript->RegisterSelf();
new mobs_ghoul_flayer();
new npc_augustus_the_touched();
new npc_darrowshire_spirit();
new npc_tirion_fordring();
}