Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_desolace.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/* ScriptData
7SDName: Desolace
8SD%Complete: 100
9SDComment: Quest support: 5561, 5581
10SDCategory: Desolace
11EndScriptData */
12
13/* ContentData
14npc_aged_dying_ancient_kodo
15go_demon_portal
16EndContentData */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "ScriptedGossip.h"
21#include "ScriptedEscortAI.h"
22#include "Player.h"
23#include "SpellInfo.h"
24
42
44{
45public:
46 npc_aged_dying_ancient_kodo() : CreatureScript("npc_aged_dying_ancient_kodo") { }
47
48 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
49 {
50 if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
51 {
52 player->TalkedToCreature(creature->GetEntry(), 0);
53 player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
54 }
55
56 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
57 return true;
58 }
59
61 {
63
65 {
66 if (who->GetEntry() == NPC_SMEED && me->IsWithinDistInMap(who, 10.0f) && !me->HasAura(SPELL_KODO_KOMBO_GOSSIP))
67 {
68 me->GetMotionMaster()->Clear();
70 if (Creature* smeed = who->ToCreature())
71 smeed->AI()->Talk(SAY_SMEED_HOME);
72 }
73 }
74
75 void SpellHit(Unit* caster, SpellInfo const* spell)
76 {
77 if (spell->Id == SPELL_KODO_KOMBO_ITEM)
78 {
80 && (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
81 {
82 caster->CastSpell(caster, SPELL_KODO_KOMBO_PLAYER_BUFF, true);
84
85 me->UpdateEntry(NPC_TAMED_KODO);
86 me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
87 }
88 }
89 else if (spell->Id == SPELL_KODO_KOMBO_GOSSIP)
90 {
92 me->DespawnOrUnsummon(60000);
93 }
94 }
95 };
96
98 {
99 return new npc_aged_dying_ancient_kodoAI(creature);
100 }
101};
102
103/*######
104## go_demon_portal
105######*/
106
113
115{
116 public:
117 go_demon_portal() : GameObjectScript("go_demon_portal") { }
118
119 bool OnGossipHello(Player* player, GameObject* go)
120 {
122 {
124 guardian->AI()->AttackStart(player);
125 }
126
127 return true;
128 }
129};
130
132{
134 new go_demon_portal();
135}
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:74
#define PET_FOLLOW_DIST
Definition PetDefines.h:57
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
@ UNIT_NPC_FLAG_GOSSIP
Definition Unit.h:687
@ UNIT_FIELD_NPC_FLAGS
CreatureScript(const char *name)
GameObjectScript(const char *name)
uint32 GetEntry() const
Definition Object.h:125
Creature * ToCreature()
Definition Object.h:207
QuestStatus GetQuestStatus(uint32 quest_id) const
uint32 Id
Definition SpellInfo.h:160
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TempSummonType::TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition Object.cpp:2703
bool OnGossipHello(Player *player, GameObject *go)
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
Creature * me
ScriptedAI(Creature *creature)
void SpellHit(Unit *caster, SpellInfo const *spell)
DemonPortal
@ NPC_DEMON_GUARDIAN
@ QUEST_PORTAL_OF_THE_LEGION
void AddSC_desolace()
DyingKodo
@ SAY_SMEED_HOME
@ SPELL_KODO_KOMBO_GOSSIP
@ NPC_ANCIENT_KODO
@ NPC_TAMED_KODO
@ NPC_DYING_KODO
@ SPELL_KODO_KOMBO_PLAYER_BUFF
@ QUEST_KODO
@ NPC_SMEED
@ NPC_AGED_KODO
@ SPELL_KODO_KOMBO_DESPAWN_BUFF
@ SPELL_KODO_KOMBO_ITEM