aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/scripts/northrend/dalaran.cpp111
-rw-r--r--src/bindings/scripts/system/ScriptLoader.cpp2
5 files changed, 122 insertions, 0 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 420dfb2e30c..b259ef20c0d 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -412,6 +412,7 @@ SET(trinityscript_LIB_SRCS
scripts/northrend/violet_hold/boss_zuramat.cpp
scripts/northrend/violet_hold/violet_hold.h
scripts/northrend/violet_hold/violet_hold.cpp
+ scripts/northrend/dalaran.cpp
scripts/northrend/borean_tundra.cpp
scripts/northrend/dragonblight.cpp
scripts/northrend/grizzly_hills.cpp
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 8627c37643c..85dd4c5af8f 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -2182,6 +2182,10 @@
>
</File>
<File
+ RelativePath="..\scripts\northrend\dalaran.cpp"
+ >
+ </File>
+ <File
RelativePath="..\scripts\northrend\dragonblight.cpp"
>
</File>
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 6c7b446f607..0dc177b27a1 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -1644,6 +1644,10 @@
>
</File>
<File
+ RelativePath="..\scripts\northrend\dalaran.cpp"
+ >
+ </File>
+ <File
RelativePath="..\scripts\northrend\dragonblight.cpp"
>
</File>
diff --git a/src/bindings/scripts/scripts/northrend/dalaran.cpp b/src/bindings/scripts/scripts/northrend/dalaran.cpp
new file mode 100644
index 00000000000..ea06c2d3a0f
--- /dev/null
+++ b/src/bindings/scripts/scripts/northrend/dalaran.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* Script Data Start
+SDName: Dalaran
+SDAuthor: WarHead
+SD%Complete: 99%
+SDComment: For what is 63990+63991? Same function but don't work correct...
+SDCategory: Dalaran
+Script Data End */
+
+#include "precompiled.h"
+
+/*******************************************************
+ * npc_mageguard_dalaran
+ *******************************************************/
+
+enum Spells
+{
+ SPELL_TRESPASSER_A = 54028,
+ SPELL_TRESPASSER_H = 54029
+};
+
+struct TRINITY_DLL_DECL npc_mageguard_dalaranAI : public Scripted_NoMovementAI
+{
+ npc_mageguard_dalaranAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
+ {
+ pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ pCreature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_NORMAL, true);
+ pCreature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
+
+ Reset();
+ }
+
+ void Reset() {}
+
+ void Aggro(Unit* pWho)
+ {
+ return;
+ }
+
+ void AttackStart(Unit* pWho)
+ {
+ return;
+ }
+
+ void MoveInLineOfSight(Unit *pWho)
+ {
+ if (m_creature->isInCombat())
+ return;
+
+ if (!pWho)
+ return;
+
+ Player* pVisiblePlayer = NULL;
+
+ if (pWho->GetTypeId() == TYPEID_PLAYER)
+ pVisiblePlayer = CAST_PLR(pWho);
+
+ if (!pVisiblePlayer || pVisiblePlayer->isGameMaster())
+ return;
+
+ if (m_creature->GetDistance(pVisiblePlayer) >= 12.0f)
+ return;
+
+ switch (m_creature->GetEntry())
+ {
+ case 29254:
+ if (pVisiblePlayer->GetTeam() == HORDE)
+ DoCast(pVisiblePlayer, SPELL_TRESPASSER_A);
+ break;
+ case 29255:
+ if (pVisiblePlayer->GetTeam() == ALLIANCE)
+ DoCast(pVisiblePlayer, SPELL_TRESPASSER_H);
+ break;
+ }
+ return;
+ }
+
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_npc_mageguard_dalaran(Creature* pCreature)
+{
+ return new npc_mageguard_dalaranAI(pCreature);
+}
+
+void AddSC_dalaran()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_mageguard_dalaran";
+ newscript->GetAI = &GetAI_npc_mageguard_dalaran;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp
index 3cf0eb61b7c..30bbecfd856 100644
--- a/src/bindings/scripts/system/ScriptLoader.cpp
+++ b/src/bindings/scripts/system/ScriptLoader.cpp
@@ -356,6 +356,7 @@ extern void AddSC_boss_zuramat();
extern void AddSC_instance_violet_hold();
extern void AddSC_violet_hold();
+extern void AddSC_dalaran();
extern void AddSC_borean_tundra();
extern void AddSC_dragonblight();
extern void AddSC_grizzly_hills();
@@ -803,6 +804,7 @@ void AddScripts()
AddSC_instance_violet_hold();
AddSC_violet_hold();
+ AddSC_dalaran();
AddSC_borean_tundra();
AddSC_dragonblight();
AddSC_grizzly_hills();