*Implement Dalaran Mageguards, by WarHead. Closes #43

*f6e09e1d71d4 16062b31dba9 df7b6c79c44a and 420160897950 were by MetaphysicalDrama. Closes #153, #146, #147, #123

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-18 00:47:31 -08:00
parent 2582fa289c
commit d2fbb9f919
8 changed files with 142 additions and 3 deletions

View File

@@ -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;

View File

@@ -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
-- --------

View File

@@ -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);

View File

@@ -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

View File

@@ -2181,6 +2181,10 @@
RelativePath="..\scripts\northrend\borean_tundra.cpp"
>
</File>
<File
RelativePath="..\scripts\northrend\dalaran.cpp"
>
</File>
<File
RelativePath="..\scripts\northrend\dragonblight.cpp"
>

View File

@@ -1643,6 +1643,10 @@
RelativePath="..\scripts\northrend\borean_tundra.cpp"
>
</File>
<File
RelativePath="..\scripts\northrend\dalaran.cpp"
>
</File>
<File
RelativePath="..\scripts\northrend\dragonblight.cpp"
>

View File

@@ -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();
}

View File

@@ -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();