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

Public Member Functions

 go_jotunheim_cage ()
 
bool OnGossipHello (Player *player, GameObject *go) 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
 
- 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)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_jotunheim_cage()

go_jotunheim_cage::go_jotunheim_cage ( )
inline
1301: GameObjectScript("go_jotunheim_cage") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from GameObjectScript.

1304 {
1305 go->UseDoorOrButton();
1306 Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
1307 if (!pPrisoner)
1308 {
1309 pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
1310 if (!pPrisoner)
1311 {
1312 pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
1313 if (!pPrisoner)
1314 pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
1315 }
1316 }
1317 if (!pPrisoner || !pPrisoner->IsAlive())
1318 return false;
1319
1320 pPrisoner->DespawnOrUnsummon();
1322 switch (pPrisoner->GetEntry())
1323 {
1325 player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
1326 break;
1328 player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
1329 break;
1331 player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
1332 break;
1334 player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
1335 break;
1336 }
1337 return true;
1338 }
@ NPC_EBON_BLADE_PRISONER_TROLL
Definition: go_scripts.cpp:1289
@ SPELL_SUMMON_BLADE_KNIGHT_NE
Definition: go_scripts.cpp:1293
@ NPC_EBON_BLADE_PRISONER_NE
Definition: go_scripts.cpp:1288
@ SPELL_SUMMON_BLADE_KNIGHT_H
Definition: go_scripts.cpp:1292
@ SPELL_SUMMON_BLADE_KNIGHT_ORC
Definition: go_scripts.cpp:1294
@ NPC_EBON_BLADE_PRISONER_ORC
Definition: go_scripts.cpp:1290
@ NPC_EBON_BLADE_PRISONER_HUMAN
Definition: go_scripts.cpp:1287
@ SPELL_SUMMON_BLADE_KNIGHT_TROLL
Definition: go_scripts.cpp:1295
Definition: Creature.h:46
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition: GameObject.cpp:1427
uint32 GetEntry() const
Definition: Object.h:109
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: PlayerQuest.cpp:1913
bool IsAlive() const
Definition: Unit.h:1822
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:1169

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), WorldObject::FindNearestCreature(), Object::GetEntry(), Unit::IsAlive(), Player::KilledMonsterCredit(), NPC_EBON_BLADE_PRISONER_HUMAN, NPC_EBON_BLADE_PRISONER_NE, NPC_EBON_BLADE_PRISONER_ORC, NPC_EBON_BLADE_PRISONER_TROLL, SPELL_SUMMON_BLADE_KNIGHT_H, SPELL_SUMMON_BLADE_KNIGHT_NE, SPELL_SUMMON_BLADE_KNIGHT_ORC, SPELL_SUMMON_BLADE_KNIGHT_TROLL, and GameObject::UseDoorOrButton().