diff options
author | maximius <none@none> | 2009-11-18 00:47:31 -0800 |
---|---|---|
committer | maximius <none@none> | 2009-11-18 00:47:31 -0800 |
commit | d2fbb9f91930e1201f9030e22f377b7c71bcccfe (patch) | |
tree | 320ae299e6d29efe1e9eaeded313e4865207d88b | |
parent | 2582fa289c0bf0d2ef26848de13b5144f82b2476 (diff) |
*Implement Dalaran Mageguards, by WarHead. Closes #43
*f6e09e1d71d4 16062b31dba9 df7b6c79c44a and 420160897950 were by MetaphysicalDrama. Closes #153, #146, #147, #123
--HG--
branch : trunk
-rw-r--r-- | sql/FULL/world_scripts_full.sql | 7 | ||||
-rw-r--r-- | sql/FULL/world_spell_full.sql | 8 | ||||
-rw-r--r-- | sql/updates/6277_world.sql | 8 | ||||
-rw-r--r-- | src/bindings/scripts/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4 | ||||
-rw-r--r-- | src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/northrend/dalaran.cpp | 111 | ||||
-rw-r--r-- | src/bindings/scripts/system/ScriptLoader.cpp | 2 |
8 files changed, 142 insertions, 3 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index e6200bbb7d1..47ab1e12e81 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -375,9 +375,7 @@ UPDATE `item_template` SET `ScriptName`='item_pile_fake_furs' WHERE `entry`=3512 /* BURNING STEPPES */ UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; -/* */ /* CAVERNS OF TIME */ -/* */ /* MT. HYJAL */ UPDATE `instance_template` SET `script`='instance_hyjal' WHERE `map`=534; @@ -473,6 +471,11 @@ UPDATE `creature_template` SET `ScriptName`='mob_coilfang_strider' WHERE `entry` UPDATE `creature_template` SET `ScriptName`='mob_toxic_sporebat' WHERE `entry`=22140; UPDATE `creature_template` SET `ScriptName`='mob_shield_generator_channel' WHERE `entry`=19870; +/* CRYSTALSONG FOREST */ + +/* DALARAN */ +UPDATE `creature_template` SET `ScriptName`='npc_mageguard_dalaran' WHERE `entry` IN (29254,29255); + /* DARKSHORE */ UPDATE `creature_template` SET `ScriptName`='npc_kerlonian' WHERE `entry`=11218; UPDATE `creature_template` SET `ScriptName`='npc_threshwackonator' WHERE `entry`=6669; diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 716ec6ef46f..67ebd0749fc 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -527,7 +527,7 @@ INSERT INTO `spell_script_target` VALUES -- POSITION -- -------- DELETE FROM spell_target_position WHERE `id` IN (46019, 46020, 53360); -INSERT INTO spell_target_position () VALUES +INSERT INTO spell_target_position (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES (46019, 580, 1704.34, 928.17, -74.558, 0), (46020, 580, 1704.34, 928.17, 53.079, 0), (53360, 571, 5807.829, 587.960, 660.939, 1.663); @@ -538,6 +538,12 @@ INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `t (54744, 0, 2418.67, -5621.41, 420.644, 3.89597), (54746, 0, 2402.15, -5633.74, 377.021, 3.65249); +-- positions for Dalaran 'Trespasser!' spell +DELETE FROM `spell_target_position` WHERE `id` IN (54028,54029); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(54028, 571, 5758.79, 678.359, 642.726, 5.572); +(54029, 571, 5849.16, 602.093, 651.13, 2.364); + -- -------- -- MISC -- -------- diff --git a/sql/updates/6277_world.sql b/sql/updates/6277_world.sql new file mode 100644 index 00000000000..e89b87bdbd9 --- /dev/null +++ b/sql/updates/6277_world.sql @@ -0,0 +1,8 @@ + +UPDATE `creature_template` SET `ScriptName`='npc_mageguard_dalaran' WHERE `entry` IN (29254,29255); + +-- positions for Dalaran 'Trespasser!' spell +DELETE FROM `spell_target_position` WHERE `id` IN (54028,54029); +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(54028, 571, 5758.79, 678.359, 642.726, 5.572); +(54029, 571, 5849.16, 602.093, 651.13, 2.364); 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(); |