* Convert npc_professor_phizzlethorpe.

--HG--
branch : trunk
extra : rebase_source : 55c18bea7f25634a86c028cff3bbf2a2c10420d3
This commit is contained in:
XTZGZoReX
2010-08-08 13:48:01 +02:00
parent 0758e9f78a
commit 02121a026e

View File

@@ -51,84 +51,88 @@ enum eEnums
MOB_VENGEFUL_SURGE = 2776
};
struct npc_professor_phizzlethorpeAI : public npc_escortAI
class npc_professor_phizzlethorpe : public CreatureScript
{
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {}
public:
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch(uiPointId)
npc_professor_phizzlethorpe()
: CreatureScript("npc_professor_phizzlethorpe")
{
case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break;
case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
case 9:
{
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break;
case 11:
DoScriptText(SAY_PROGRESS_6, me, pPlayer);
SetRun();
break;
case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break;
case 20:
DoScriptText(EMOTE_PROGRESS_8, me);
DoScriptText(SAY_PROGRESS_9, me, pPlayer);
if (pPlayer)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->AI()->AttackStart(me);
}
struct npc_professor_phizzlethorpeAI : public npc_escortAI
{
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {}
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
if (!pPlayer)
return;
switch(uiPointId)
{
case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break;
case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
case 9:
{
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break;
case 11:
DoScriptText(SAY_PROGRESS_6, me, pPlayer);
SetRun();
break;
case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break;
case 20:
DoScriptText(EMOTE_PROGRESS_8, me);
DoScriptText(SAY_PROGRESS_9, me, pPlayer);
if (pPlayer)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->AI()->AttackStart(me);
}
void EnterCombat(Unit* /*pWho*/)
{
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_professor_phizzlethorpeAI(creature);
}
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
DoScriptText(SAY_PROGRESS_1, creature, player);
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
pEscortAI->Start(false, false, player->GetGUID(), quest);
creature->setFaction(113);
}
return true;
}
};
bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer);
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI())))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
pCreature->setFaction(113);
}
return true;
}
CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature)
{
return new npc_professor_phizzlethorpeAI(pCreature);
}
void AddSC_arathi_highlands()
{
Script * newscript;
newscript = new Script;
newscript->Name = "npc_professor_phizzlethorpe";
newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe;
newscript->RegisterSelf();
new npc_professor_phizzlethorpe();
}