Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
icecrown_citadel_teleport.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#include "ScriptedGossip.h"
7#include "ScriptMgr.h"
8#include "InstanceScript.h"
9#include "icecrown_citadel.h"
10#include "Spell.h"
11#include "Player.h"
12
13#define GOSSIP_SENDER_ICC_PORT 631
14
16{
17 public:
18 icecrown_citadel_teleport() : GameObjectScript("icecrown_citadel_teleport") { }
19
21 {
22 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to Light's Hammer.", GOSSIP_SENDER_ICC_PORT, LIGHT_S_HAMMER_TELEPORT);
23 if (InstanceScript* instance = go->GetInstanceScript())
24 {
25 if (instance->GetBossState(DATA_LORD_MARROWGAR) == DONE)
26 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Oratory of the Damned.", GOSSIP_SENDER_ICC_PORT, ORATORY_OF_THE_DAMNED_TELEPORT);
27 if (instance->GetBossState(DATA_LADY_DEATHWHISPER) == DONE)
28 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Rampart of Skulls.", GOSSIP_SENDER_ICC_PORT, RAMPART_OF_SKULLS_TELEPORT);
29 if (instance->GetBossState(DATA_GUNSHIP_EVENT) == DONE)
30 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Deathbringer's Rise.", GOSSIP_SENDER_ICC_PORT, DEATHBRINGER_S_RISE_TELEPORT);
31 if (instance->GetData(DATA_COLDFLAME_JETS) == DONE)
32 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Upper Spire.", GOSSIP_SENDER_ICC_PORT, UPPER_SPIRE_TELEPORT);
34 if (instance->GetBossState(DATA_VALITHRIA_DREAMWALKER) == DONE)
35 player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to Sindragosa's Lair", GOSSIP_SENDER_ICC_PORT, SINDRAGOSA_S_LAIR_TELEPORT);
36 }
37
38 player->SEND_GOSSIP_MENU(player->GetGossipTextId(go), go->GetGUID());
39 return true;
40 }
41
42 bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 sender, uint32 action) OVERRIDE
43 {
44 player->PlayerTalkClass->ClearMenus();
45 player->CLOSE_GOSSIP_MENU();
46 SpellInfo const* spell = sSpellMgr->GetSpellInfo(action);
47 if (!spell)
48 return false;
49
50 if (player->IsInCombat())
51 {
53 return true;
54 }
55
56 if (sender == GOSSIP_SENDER_ICC_PORT)
57 player->CastSpell(player, spell, true);
58
59 return true;
60 }
61};
62
64{
65 public:
66 at_frozen_throne_teleport() : AreaTriggerScript("at_frozen_throne_teleport") { }
67
68 bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) OVERRIDE
69 {
70 if (player->IsInCombat())
71 {
72 if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT))
74 return true;
75 }
76
77 if (InstanceScript* instance = player->GetInstanceScript())
78 if (instance->GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE &&
79 instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE &&
80 instance->GetBossState(DATA_SINDRAGOSA) == DONE &&
81 instance->GetBossState(DATA_THE_LICH_KING) != IN_PROGRESS)
82 player->CastSpell(player, FROZEN_THRONE_TELEPORT, true);
83
84 return true;
85 }
86};
87
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ IN_PROGRESS
@ DONE
#define sSpellMgr
Definition SpellMgr.h:744
AreaTriggerScript(const char *name)
GameObjectScript(const char *name)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, Opcodes opcode=SMSG_CAST_FAILED)
Definition Spell.cpp:3874
bool OnTrigger(Player *player, AreaTriggerEntry const *) OVERRIDE
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
bool OnGossipSelect(Player *player, GameObject *, uint32 sender, uint32 action) OVERRIDE
@ ORATORY_OF_THE_DAMNED_TELEPORT
@ FROZEN_THRONE_TELEPORT
@ DEATHBRINGER_S_RISE_TELEPORT
@ SINDRAGOSA_S_LAIR_TELEPORT
@ LIGHT_S_HAMMER_TELEPORT
@ UPPER_SPIRE_TELEPORT
@ RAMPART_OF_SKULLS_TELEPORT
@ DATA_THE_LICH_KING
@ DATA_GUNSHIP_EVENT
@ DATA_VALITHRIA_DREAMWALKER
@ DATA_SINDRAGOSA
@ DATA_LORD_MARROWGAR
@ DATA_COLDFLAME_JETS
@ DATA_BLOOD_QUEEN_LANA_THEL
@ DATA_PROFESSOR_PUTRICIDE
@ DATA_LADY_DEATHWHISPER
#define GOSSIP_SENDER_ICC_PORT
void AddSC_icecrown_citadel_teleport()