Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_dalaran.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* Script Data Start
7SDName: Dalaran
8SDAuthor: WarHead, MaXiMiUS
9SD%Complete: 99%
10SDComment: For what is 63990+63991? Same function but don't work correct...
11SDCategory: Dalaran
12Script Data End */
13
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
16#include "ScriptedGossip.h"
17#include "Player.h"
18#include "WorldSession.h"
19
20/*******************************************************
21 * npc_mageguard_dalaran
22 *******************************************************/
23
34
35enum NPCs // All outdoor guards are within 35.0f of these NPCs
36{
39};
40
42{
43public:
44 npc_mageguard_dalaran() : CreatureScript("npc_mageguard_dalaran") { }
45
47 {
54
55 void Reset()OVERRIDE { }
56
57 void EnterCombat(Unit* /*who*/)OVERRIDE { }
58
59 void AttackStart(Unit* /*who*/)OVERRIDE { }
60
62
63 {
64 if (!who || !who->IsInWorld() || who->GetZoneId() != 4395)
65 return;
66
67 if (!me->IsWithinDist(who, 65.0f, false))
68 return;
69
71
72 if (!player || player->IsGameMaster() || player->IsBeingTeleported() ||
73 // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
76 return;
77
78 switch (me->GetEntry())
79 {
80 case 29254:
81 if (player->GetTeam() == HORDE) // Horde unit found in Alliance area
82 {
84 {
85 if (me->isInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
86 DoCast(who, SPELL_TRESPASSER_A); // Teleport the Horde unit out
87 }
88 else // In my line of sight, and "indoors"
89 DoCast(who, SPELL_TRESPASSER_A); // Teleport the Horde unit out
90 }
91 break;
92 case 29255:
93 if (player->GetTeam() == ALLIANCE) // Alliance unit found in Horde area
94 {
96 {
97 if (me->isInBackInMap(who, 12.0f)) // In my line of sight, "outdoors", and behind me
98 DoCast(who, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
99 }
100 else // In my line of sight, and "indoors"
101 DoCast(who, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
102 }
103 break;
104 }
105 me->SetOrientation(me->GetHomePosition().GetOrientation());
106 return;
107 }
108
109 void UpdateAI(uint32 /*diff*/)OVERRIDE { }
110 };
111
113 {
114 return new npc_mageguard_dalaranAI(creature);
115 }
116};
117
119{
121}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
@ SPELL_SCHOOL_NORMAL
@ IMMUNITY_DAMAGE
@ ALLIANCE
@ HORDE
@ SPELL_SCHOOL_MASK_MAGIC
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FIELD_FLAGS
CreatureScript(const char *name)
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:1261
uint32 GetTeam() const
Definition Player.h:2527
bool IsGameMaster() const
Definition Player.h:1369
bool IsBeingTeleported() const
Definition Player.h:2493
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:2355
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition Unit.cpp:3580
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_SUNREAVER_DISGUISE_MALE
@ SPELL_SILVER_COVENANT_DISGUISE_FEMALE
@ SPELL_TRESPASSER_H
@ SPELL_SILVER_COVENANT_DISGUISE_MALE
@ SPELL_TRESPASSER_A
@ SPELL_SUNREAVER_DISGUISE_FEMALE
void AddSC_dalaran()
@ NPC_SWEETBERRY_H
@ NPC_APPLEBOUGH_A