mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-19 08:30:34 +01:00
*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:
@@ -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
|
||||
|
||||
@@ -2181,6 +2181,10 @@
|
||||
RelativePath="..\scripts\northrend\borean_tundra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\northrend\dalaran.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\northrend\dragonblight.cpp"
|
||||
>
|
||||
|
||||
@@ -1643,6 +1643,10 @@
|
||||
RelativePath="..\scripts\northrend\borean_tundra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\northrend\dalaran.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\northrend\dragonblight.cpp"
|
||||
>
|
||||
|
||||
111
src/bindings/scripts/scripts/northrend/dalaran.cpp
Normal file
111
src/bindings/scripts/scripts/northrend/dalaran.cpp
Normal 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();
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user