Implemented script for Sunreaver Guardian and Silver Covenant Guardian.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-05-29 14:19:00 -03:00
parent 78cb29a30d
commit 5718cabd9c
3 changed files with 48 additions and 0 deletions
+1
View File
@@ -819,6 +819,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_squire_david' WHERE `entry`=334
UPDATE `creature_template` SET `ScriptName`='npc_argent_valiant' WHERE `entry`=33448;
UPDATE `creature_template` SET `ScriptName`='npc_argent_tournament_post' WHERE `entry`=35473;
UPDATE `creature_template` SET `ScriptName`='npc_alorah_and_grimmin' WHERE `entry` IN (36101,36102);
UPDATE `creature_template` SET `ScriptName`='npc_guardian_pavilion' WHERE `entry` IN (33543,33643);
/* IRONFORGE */
UPDATE `creature_template` SET `ScriptName`='npc_royal_historian_archesonus' WHERE `entry`=8879;
+1
View File
@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='npc_guardian_pavilion' WHERE `entry` IN (33543,33643);
+46
View File
@@ -337,6 +337,47 @@ CreatureAI* GetAI_npc_alorah_and_grimmin(Creature* pCreature)
return new npc_alorah_and_grimminAI (pCreature);
}
/*######
## npc_guardian_pavilion
######*/
enum eGuardianPavilion
{
SPELL_TRESPASSER_H = 63987,
AREA_SUNREAVER_PAVILION = 4676,
AREA_SILVER_COVENANT_PAVILION = 4677,
SPELL_TRESPASSER_A = 63986,
};
struct npc_guardian_pavilionAI : public Scripted_NoMovementAI
{
npc_guardian_pavilionAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {}
void MoveInLineOfSight(Unit* pWho)
{
if (me->GetAreaId() != AREA_SUNREAVER_PAVILION && me->GetAreaId() != AREA_SILVER_COVENANT_PAVILION)
return;
if (!pWho || pWho->GetTypeId() != TYPEID_PLAYER || !me->IsHostileTo(pWho) || !me->isInBackInMap(pWho, 5.0f))
return;
if (pWho->HasAura(SPELL_TRESPASSER_H) || pWho->HasAura(SPELL_TRESPASSER_A))
return;
if (pWho->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
pWho->CastSpell(pWho, SPELL_TRESPASSER_H, true);
else
pWho->CastSpell(pWho, SPELL_TRESPASSER_A, true);
}
};
CreatureAI* GetAI_npc_guardian_pavilion(Creature* pCreature)
{
return new npc_guardian_pavilionAI (pCreature);
}
void AddSC_icecrown()
{
Script *newscript;
@@ -373,4 +414,9 @@ void AddSC_icecrown()
newscript->Name = "npc_alorah_and_grimmin";
newscript->GetAI = &GetAI_npc_alorah_and_grimmin;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_guardian_pavilion";
newscript->GetAI = &GetAI_npc_guardian_pavilion;
newscript->RegisterSelf();
}