Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
15
class
icecrown_citadel_teleport
:
public
GameObjectScript
16
{
17
public
:
18
icecrown_citadel_teleport
() :
GameObjectScript
(
"icecrown_citadel_teleport"
) { }
19
20
bool
OnGossipHello
(
Player
* player,
GameObject
* go)
OVERRIDE
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
{
52
Spell::SendCastResult
(player, spell, 0,
SpellCastResult::SPELL_FAILED_AFFECTING_COMBAT
);
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
63
class
at_frozen_throne_teleport
:
public
AreaTriggerScript
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
))
73
Spell::SendCastResult
(player, spell, 0,
SpellCastResult::SPELL_FAILED_AFFECTING_COMBAT
);
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
88
void
AddSC_icecrown_citadel_teleport
()
89
{
90
new
icecrown_citadel_teleport
();
91
new
at_frozen_throne_teleport
();
92
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOSSIP_ICON_CHAT
@ GOSSIP_ICON_CHAT
Definition
GossipDef.h:46
InstanceScript.h
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
Player.h
ScriptMgr.h
ScriptedGossip.h
SpellCastResult::SPELL_FAILED_AFFECTING_COMBAT
@ SPELL_FAILED_AFFECTING_COMBAT
Definition
SharedDefines.h:1079
Spell.h
sSpellMgr
#define sSpellMgr
Definition
SpellMgr.h:744
AreaTriggerScript::AreaTriggerScript
AreaTriggerScript(const char *name)
Definition
ScriptMgr.cpp:1448
GameObject
Definition
GameObject.h:629
GameObjectScript::GameObjectScript
GameObjectScript(const char *name)
Definition
ScriptMgr.cpp:1442
InstanceScript
Definition
InstanceScript.h:123
Player
Definition
Player.h:1289
Spell::SendCastResult
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
SpellInfo
Definition
SpellInfo.h:158
at_frozen_throne_teleport
Definition
icecrown_citadel_teleport.cpp:64
at_frozen_throne_teleport::OnTrigger
bool OnTrigger(Player *player, AreaTriggerEntry const *) OVERRIDE
Definition
icecrown_citadel_teleport.cpp:68
at_frozen_throne_teleport::at_frozen_throne_teleport
at_frozen_throne_teleport()
Definition
icecrown_citadel_teleport.cpp:66
icecrown_citadel_teleport
Definition
icecrown_citadel_teleport.cpp:16
icecrown_citadel_teleport::OnGossipHello
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
Definition
icecrown_citadel_teleport.cpp:20
icecrown_citadel_teleport::OnGossipSelect
bool OnGossipSelect(Player *player, GameObject *, uint32 sender, uint32 action) OVERRIDE
Definition
icecrown_citadel_teleport.cpp:42
icecrown_citadel_teleport::icecrown_citadel_teleport
icecrown_citadel_teleport()
Definition
icecrown_citadel_teleport.cpp:18
icecrown_citadel.h
ORATORY_OF_THE_DAMNED_TELEPORT
@ ORATORY_OF_THE_DAMNED_TELEPORT
Definition
icecrown_citadel.h:54
FROZEN_THRONE_TELEPORT
@ FROZEN_THRONE_TELEPORT
Definition
icecrown_citadel.h:58
DEATHBRINGER_S_RISE_TELEPORT
@ DEATHBRINGER_S_RISE_TELEPORT
Definition
icecrown_citadel.h:56
SINDRAGOSA_S_LAIR_TELEPORT
@ SINDRAGOSA_S_LAIR_TELEPORT
Definition
icecrown_citadel.h:59
LIGHT_S_HAMMER_TELEPORT
@ LIGHT_S_HAMMER_TELEPORT
Definition
icecrown_citadel.h:53
UPPER_SPIRE_TELEPORT
@ UPPER_SPIRE_TELEPORT
Definition
icecrown_citadel.h:57
RAMPART_OF_SKULLS_TELEPORT
@ RAMPART_OF_SKULLS_TELEPORT
Definition
icecrown_citadel.h:55
DATA_THE_LICH_KING
@ DATA_THE_LICH_KING
Definition
icecrown_citadel.h:77
DATA_GUNSHIP_EVENT
@ DATA_GUNSHIP_EVENT
Definition
icecrown_citadel.h:67
DATA_VALITHRIA_DREAMWALKER
@ DATA_VALITHRIA_DREAMWALKER
Definition
icecrown_citadel.h:75
DATA_SINDRAGOSA
@ DATA_SINDRAGOSA
Definition
icecrown_citadel.h:76
DATA_LORD_MARROWGAR
@ DATA_LORD_MARROWGAR
Definition
icecrown_citadel.h:65
DATA_COLDFLAME_JETS
@ DATA_COLDFLAME_JETS
Definition
icecrown_citadel.h:93
DATA_BLOOD_QUEEN_LANA_THEL
@ DATA_BLOOD_QUEEN_LANA_THEL
Definition
icecrown_citadel.h:73
DATA_PROFESSOR_PUTRICIDE
@ DATA_PROFESSOR_PUTRICIDE
Definition
icecrown_citadel.h:71
DATA_LADY_DEATHWHISPER
@ DATA_LADY_DEATHWHISPER
Definition
icecrown_citadel.h:66
GOSSIP_SENDER_ICC_PORT
#define GOSSIP_SENDER_ICC_PORT
Definition
icecrown_citadel_teleport.cpp:13
AddSC_icecrown_citadel_teleport
void AddSC_icecrown_citadel_teleport()
Definition
icecrown_citadel_teleport.cpp:88
AreaTriggerEntry
Definition
DBCStructure.h:716
src
server
scripts
Northrend
IcecrownCitadel
icecrown_citadel_teleport.cpp
Generated on
for Project SkyFire Core by
1.17.0