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

Public Member Functions

 go_corkis_prison ()
 
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_corkis_prison::go_corkis_prison ( )
inline
291 : GameObjectScript("go_corkis_prison") { }
GameObjectScript(const char *name)
Definition: ScriptMgr.cpp:1592

Member Function Documentation

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

Reimplemented from GameObjectScript.

294  {
296  if (go->GetEntry() == GO_CORKIS_PRISON)
297  {
298  if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true))
299  {
300  corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
301  if (player)
302  player->KilledMonsterCredit(NPC_CORKI_CREDIT_1);
303  }
304  }
305 
306  if (go->GetEntry() == GO_CORKIS_PRISON_2)
307  {
308  if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true))
309  {
310  corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ());
311  if (player)
312  player->KilledMonsterCredit(NPC_CORKI_2);
313  }
314  }
315 
316  if (go->GetEntry() == GO_CORKIS_PRISON_3)
317  {
318  if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true))
319  {
320  corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ());
321  if (player)
322  player->KilledMonsterCredit(NPC_CORKI_CREDIT_3);
323  }
324  }
325  return true;
326  }
Definition: zone_nagrand.cpp:271
Definition: zone_nagrand.cpp:272
Definition: zone_nagrand.cpp:284
Definition: zone_nagrand.cpp:273
Definition: zone_nagrand.cpp:282
Definition: Creature.h:467
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Definition: zone_nagrand.cpp:277
float GetPositionY() const
Definition: Position.h:105
float GetPositionZ() const
Definition: Position.h:106
Definition: GameObject.h:823
void SetGoState(GOState state)
Definition: GameObject.cpp:2137
Definition: zone_nagrand.cpp:278
uint32 GetEntry() const
Definition: Object.h:107
Definition: zone_nagrand.cpp:283
float GetPositionX() const
Definition: Position.h:104

+ Here is the call graph for this function:


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