Tidying up cpp - zone_icecrown.cpp
* Remove script for The Flesh Giant Champion * Remove script from for Vereth the Cunning as even though I scripted new recruit using the correct npc (Geist Return Bunny) today discovered this npc had script for it even though never worked as before I scripted the lithe stalkers did not move when subdued.
This commit is contained in:
1 parent
e79521dab0
commit
f80a9f9f72
1 file changed
-241
@@ -209,52 +209,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_vereth_the_cunning
|
||||
######*/
|
||||
|
||||
enum VerethTheCunning
|
||||
{
|
||||
NPC_GEIST_RETURN_BUNNY_KC = 31049,
|
||||
NPC_LITHE_STALKER = 30894,
|
||||
SPELL_SUBDUED_LITHE_STALKER = 58151,
|
||||
};
|
||||
|
||||
class npc_vereth_the_cunning : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_vereth_the_cunning() : CreatureScript("npc_vereth_the_cunning") { }
|
||||
|
||||
struct npc_vereth_the_cunningAI : public ScriptedAI
|
||||
{
|
||||
npc_vereth_the_cunningAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
|
||||
if (who->GetEntry() == NPC_LITHE_STALKER && me->IsWithinDistInMap(who, 10.0f))
|
||||
{
|
||||
if (Unit* owner = who->GetCharmer())
|
||||
{
|
||||
if (who->HasAura(SPELL_SUBDUED_LITHE_STALKER))
|
||||
{
|
||||
owner->ToPlayer()->KilledMonsterCredit(NPC_GEIST_RETURN_BUNNY_KC);
|
||||
who->ToCreature()->DisappearAndDie();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_vereth_the_cunningAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
* npc_tournament_training_dummy
|
||||
######*/
|
||||
@@ -881,207 +835,12 @@ class npc_frostbrood_skytalon : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## The Flesh Giant Champion - Id: 13235
|
||||
######*/
|
||||
enum FleshGiant
|
||||
{
|
||||
QUEST_FLESH_GIANT_CHAMPION = 13235,
|
||||
|
||||
NPC_MORBIDUS = 30698,
|
||||
NPC_LICH_KING = 31301,
|
||||
NPC_OLAKIN = 31428,
|
||||
NPC_DHAKAR = 31306,
|
||||
|
||||
FACTION_HOSTILE = 14,
|
||||
FACTION_BASIC = 2102,
|
||||
|
||||
EVENT_INTRO = 1,
|
||||
EVENT_LK_SAY_1 = 2,
|
||||
EVENT_LK_SAY_2 = 3,
|
||||
EVENT_LK_SAY_3 = 4,
|
||||
EVENT_LK_SAY_4 = 5,
|
||||
EVENT_LK_SAY_5 = 6,
|
||||
EVENT_OUTRO = 7,
|
||||
EVENT_START = 8,
|
||||
|
||||
SPELL_SIMPLE_TELEPORT = 64195,
|
||||
|
||||
SAY_DHAKAR_START = 0,
|
||||
SAY_LK_1 = 0,
|
||||
SAY_LK_2 = 1,
|
||||
SAY_LK_3 = 2,
|
||||
SAY_LK_4 = 3,
|
||||
SAY_LK_5 = 4,
|
||||
SAY_OLAKIN_PAY = 0
|
||||
};
|
||||
|
||||
class npc_margrave_dhakar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_margrave_dhakar() : CreatureScript("npc_margrave_dhakar") { }
|
||||
|
||||
struct npc_margrave_dhakarAI : public ScriptedAI
|
||||
{
|
||||
npc_margrave_dhakarAI(Creature* creature) : ScriptedAI(creature) , _summons(me) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
|
||||
|
||||
_events.Reset();
|
||||
_summons.DespawnAll();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 sender, uint32 action) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_FLESH_GIANT_CHAMPION) == QUEST_STATUS_INCOMPLETE && !player->IsInCombat())
|
||||
{
|
||||
if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_INTRO, 1000);
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INTRO:
|
||||
{
|
||||
Talk(SAY_DHAKAR_START);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
|
||||
|
||||
if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
|
||||
{
|
||||
if (Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX() + 10.0f, morbidus->GetPositionY(), morbidus->GetPositionZ()))
|
||||
{
|
||||
_lichKingGuid = lichKing->GetGUID();
|
||||
lichKing->SetFacingTo(morbidus->GetOrientation());
|
||||
lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true);
|
||||
}
|
||||
}
|
||||
|
||||
_events.ScheduleEvent(EVENT_LK_SAY_1, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LK_SAY_1:
|
||||
{
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->AI()->Talk(SAY_LK_1);
|
||||
_events.ScheduleEvent(EVENT_LK_SAY_2, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LK_SAY_2:
|
||||
{
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->AI()->Talk(SAY_LK_2);
|
||||
_events.ScheduleEvent(EVENT_LK_SAY_3, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LK_SAY_3:
|
||||
{
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->AI()->Talk(SAY_LK_3);
|
||||
_events.ScheduleEvent(EVENT_LK_SAY_4, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LK_SAY_4:
|
||||
{
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->AI()->Talk(SAY_LK_4);
|
||||
_events.ScheduleEvent(EVENT_OUTRO, 12000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LK_SAY_5:
|
||||
{
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->AI()->Talk(SAY_LK_5);
|
||||
_events.ScheduleEvent(EVENT_OUTRO, 8000);
|
||||
break;
|
||||
}
|
||||
case EVENT_OUTRO:
|
||||
{
|
||||
if (Creature* olakin = me->FindNearestCreature(NPC_OLAKIN, 50.0f, true))
|
||||
olakin->AI()->Talk(SAY_OLAKIN_PAY);
|
||||
|
||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _lichKingGuid))
|
||||
lichKing->DespawnOrUnsummon(0);
|
||||
|
||||
_events.ScheduleEvent(EVENT_START, 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_START:
|
||||
{
|
||||
if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
|
||||
{
|
||||
morbidus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_DISABLE_MOVE);
|
||||
morbidus->setFaction(FACTION_HOSTILE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
SummonList _summons;
|
||||
ObjectGuid _lichKingGuid;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_margrave_dhakarAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_morbidus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_morbidus() : CreatureScript("npc_morbidus") { }
|
||||
|
||||
struct npc_morbidusAI : public ScriptedAI
|
||||
{
|
||||
npc_morbidusAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (Creature* dhakar = me->FindNearestCreature(NPC_DHAKAR, 50.0f, true))
|
||||
dhakar->AI()->Reset();
|
||||
|
||||
// this will prevent the event to start without morbidus being alive
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->setFaction(FACTION_BASIC);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_morbidusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_icecrown()
|
||||
{
|
||||
new npc_squire_david;
|
||||
new npc_argent_valiant;
|
||||
new npc_guardian_pavilion;
|
||||
new npc_vereth_the_cunning;
|
||||
new npc_tournament_training_dummy;
|
||||
new npc_blessed_banner();
|
||||
new npc_frostbrood_skytalon();
|
||||
new npc_margrave_dhakar();
|
||||
new npc_morbidus();
|
||||
}
|
||||
Reference in new issue
Block a user