AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
icecrown_citadel_teleport Class Reference
Inheritance diagram for icecrown_citadel_teleport:
GameObjectScript ScriptObject UpdatableScript< GameObject >

Public Member Functions

 icecrown_citadel_teleport ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
bool OnGossipSelect (Player *player, GameObject *, uint32 sender, uint32 action) override
 
- Public Member Functions inherited from GameObjectScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, GameObject *)
 
virtual bool OnGossipSelect (Player *, GameObject *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnModifyHealth (GameObject *, Unit *, int32 &, SpellInfo const *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ icecrown_citadel_teleport()

icecrown_citadel_teleport::icecrown_citadel_teleport ( )
inline
41: GameObjectScript("icecrown_citadel_teleport") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool icecrown_citadel_teleport::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

44 {
45 uint32 gossipMenuId = go->GetGOInfo()->GetGossipMenuId();
46
49 player, gossipMenuId, ICC_TELEPORT_GOSSIP_OPT_LIGHTS_HAMMER,
51 ); // M_PI + M_PI/6
52
53 if (InstanceScript* instance = go->GetInstanceScript())
54 {
55 if (instance->GetBossState(DATA_LORD_MARROWGAR) == DONE && go->GetEntry() != 202245)
59 ); // M_PI + M_PI/6
60 if (instance->GetBossState(DATA_LADY_DEATHWHISPER) == DONE && go->GetEntry() != 202243)
64 ); // M_PI/6
65 if (instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == DONE && go->GetEntry() != 202244)
69 ); // M_PI/6
70 if (instance->GetData(DATA_COLDFLAME_JETS) == DONE && go->GetEntry() != 202235)
72 player, gossipMenuId, ICC_TELEPORT_GOSSIP_OPT_UPPER_SPIRE,
74 ); // M_PI/6
75 if (instance->GetBossState(DATA_VALITHRIA_DREAMWALKER) == DONE && instance->GetBossState(DATA_SINDRAGOSA_GAUNTLET) == DONE && go->GetEntry() != 202246)
77 player, gossipMenuId, ICC_TELEPORT_GOSSIP_OPT_SINDRAGOSAS_LAIR,
79 ); // M_PI*3/2 + M_PI/6
80 }
81
82 SendGossipMenuFor(player, player->GetGossipTextId(go), go->GetGUID());
83 return true;
84 }
std::uint32_t uint32
Definition: Define.h:107
@ DONE
Definition: InstanceScript.h:60
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ ORATORY_OF_THE_DAMNED_TELEPORT
Definition: icecrown_citadel.h:81
@ DEATHBRINGER_S_RISE_TELEPORT
Definition: icecrown_citadel.h:83
@ SINDRAGOSA_S_LAIR_TELEPORT
Definition: icecrown_citadel.h:86
@ LIGHT_S_HAMMER_TELEPORT
Definition: icecrown_citadel.h:80
@ UPPER_SPIRE_TELEPORT
Definition: icecrown_citadel.h:84
@ RAMPART_OF_SKULLS_TELEPORT
Definition: icecrown_citadel.h:82
@ GO_SCOURGE_TRANSPORTER_FIRST
Definition: icecrown_citadel.h:382
@ DATA_ICECROWN_GUNSHIP_BATTLE
Definition: icecrown_citadel.h:94
@ DATA_SINDRAGOSA_GAUNTLET
Definition: icecrown_citadel.h:105
@ DATA_VALITHRIA_DREAMWALKER
Definition: icecrown_citadel.h:102
@ DATA_LORD_MARROWGAR
Definition: icecrown_citadel.h:92
@ DATA_COLDFLAME_JETS
Definition: icecrown_citadel.h:123
@ DATA_LADY_DEATHWHISPER
Definition: icecrown_citadel.h:93
#define GOSSIP_SENDER_ICC_PORT
Definition: icecrown_citadel_teleport.cpp:26
@ ICC_TELEPORT_GOSSIP_OPT_SINDRAGOSAS_LAIR
Definition: icecrown_citadel_teleport.cpp:35
@ ICC_TELEPORT_GOSSIP_OPT_LIGHTS_HAMMER
Definition: icecrown_citadel_teleport.cpp:30
@ ICC_TELEPORT_GOSSIP_OPT_ORATORY_OF_THE_DAMNED
Definition: icecrown_citadel_teleport.cpp:31
@ ICC_TELEPORT_GOSSIP_OPT_RAMPART_OF_SKULLS
Definition: icecrown_citadel_teleport.cpp:32
@ ICC_TELEPORT_GOSSIP_OPT_DEATHBRINGERS_RISE
Definition: icecrown_citadel_teleport.cpp:33
@ ICC_TELEPORT_GOSSIP_OPT_UPPER_SPIRE
Definition: icecrown_citadel_teleport.cpp:34
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:137
uint32 GetGossipMenuId() const
Definition: GameObjectData.h:553
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
Definition: InstanceScript.h:142

References AddGossipItemFor(), DATA_COLDFLAME_JETS, DATA_ICECROWN_GUNSHIP_BATTLE, DATA_LADY_DEATHWHISPER, DATA_LORD_MARROWGAR, DATA_SINDRAGOSA_GAUNTLET, DATA_VALITHRIA_DREAMWALKER, DEATHBRINGER_S_RISE_TELEPORT, DONE, Object::GetEntry(), GameObject::GetGOInfo(), GameObjectTemplate::GetGossipMenuId(), Player::GetGossipTextId(), Object::GetGUID(), WorldObject::GetInstanceScript(), GO_SCOURGE_TRANSPORTER_FIRST, GOSSIP_SENDER_ICC_PORT, ICC_TELEPORT_GOSSIP_OPT_DEATHBRINGERS_RISE, ICC_TELEPORT_GOSSIP_OPT_LIGHTS_HAMMER, ICC_TELEPORT_GOSSIP_OPT_ORATORY_OF_THE_DAMNED, ICC_TELEPORT_GOSSIP_OPT_RAMPART_OF_SKULLS, ICC_TELEPORT_GOSSIP_OPT_SINDRAGOSAS_LAIR, ICC_TELEPORT_GOSSIP_OPT_UPPER_SPIRE, LIGHT_S_HAMMER_TELEPORT, ORATORY_OF_THE_DAMNED_TELEPORT, RAMPART_OF_SKULLS_TELEPORT, SendGossipMenuFor(), SINDRAGOSA_S_LAIR_TELEPORT, and UPPER_SPIRE_TELEPORT.

◆ OnGossipSelect()

bool icecrown_citadel_teleport::OnGossipSelect ( Player player,
GameObject ,
uint32  sender,
uint32  action 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

87 {
88 ClearGossipMenuFor(player);
89 CloseGossipMenuFor(player);
90 SpellInfo const* spell = sSpellMgr->GetSpellInfo(action);
91 if (!spell)
92 return false;
93
94 if (player->IsInCombat())
95 {
97 return true;
98 }
99
100 if (sender == GOSSIP_SENDER_ICC_PORT)
101 player->CastSpell(player, spell, false);
102
103 return true;
104 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
#define sSpellMgr
Definition: SpellMgr.h:825
@ SPELL_FAILED_AFFECTING_COMBAT
Definition: SharedDefines.h:950
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
bool IsInCombat() const
Definition: Unit.h:820
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4661
Definition: SpellInfo.h:316

References Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), GOSSIP_SENDER_ICC_PORT, Unit::IsInCombat(), Spell::SendCastResult(), SPELL_FAILED_AFFECTING_COMBAT, and sSpellMgr.