aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_scripts_full.sql1
-rw-r--r--sql/updates/8334_world_scriptname.sql1
-rw-r--r--src/scripts/northrend/icecrown.cpp46
3 files changed, 48 insertions, 0 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 0e2372d16c3..7277ab1f3d7 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -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;
diff --git a/sql/updates/8334_world_scriptname.sql b/sql/updates/8334_world_scriptname.sql
new file mode 100644
index 00000000000..1ad9829e901
--- /dev/null
+++ b/sql/updates/8334_world_scriptname.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='npc_guardian_pavilion' WHERE `entry` IN (33543,33643); \ No newline at end of file
diff --git a/src/scripts/northrend/icecrown.cpp b/src/scripts/northrend/icecrown.cpp
index 84bc655ac22..76608bdb73d 100644
--- a/src/scripts/northrend/icecrown.cpp
+++ b/src/scripts/northrend/icecrown.cpp
@@ -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();
}