TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
go_jotunheim_cage Class Reference

Public Member Functions

 go_jotunheim_cage ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
- Public Member Functions inherited from GameObjectScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, 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 OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
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 ()
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

go_jotunheim_cage::go_jotunheim_cage ( )
inline
733 : GameObjectScript("go_jotunheim_cage") { }
GameObjectScript(const char *name)
Definition: ScriptMgr.cpp:1592

Member Function Documentation

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

Reimplemented from GameObjectScript.

736  {
737  go->UseDoorOrButton();
738  Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
739  if (!pPrisoner)
740  {
741  pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
742  if (!pPrisoner)
743  {
744  pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
745  if (!pPrisoner)
746  pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
747  }
748  }
749  if (!pPrisoner || !pPrisoner->IsAlive())
750  return false;
751 
752  pPrisoner->DisappearAndDie();
753  player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN);
754  switch (pPrisoner->GetEntry())
755  {
757  player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
758  break;
760  player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
761  break;
763  player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
764  break;
766  player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
767  break;
768  }
769  return true;
770  }
Definition: go_scripts.cpp:726
Definition: go_scripts.cpp:720
Definition: Creature.h:467
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
bool IsAlive() const
Definition: Unit.h:1692
Definition: go_scripts.cpp:721
Definition: go_scripts.cpp:725
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
Definition: GameObject.cpp:1182
Definition: go_scripts.cpp:727
Definition: go_scripts.cpp:719
Definition: go_scripts.cpp:724
uint32 GetEntry() const
Definition: Object.h:107
void DisappearAndDie()
Definition: Creature.cpp:256
Definition: go_scripts.cpp:722

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: