AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_zulaman_hostage Class Reference
Inheritance diagram for npc_zulaman_hostage:
CreatureScript ScriptObject UpdatableScript< Creature >

Classes

struct  npc_zulaman_hostageAI
 

Public Member Functions

 npc_zulaman_hostage ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- 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< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (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< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_zulaman_hostage()

npc_zulaman_hostage::npc_zulaman_hostage ( )
inline
242: CreatureScript("npc_zulaman_hostage") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_zulaman_hostage::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

270 {
271 return GetZulAmanAI<npc_zulaman_hostageAI>(creature);
272 }

◆ OnGossipHello()

bool npc_zulaman_hostage::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

275 {
277 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
278 return true;
279 }
#define GOSSIP_HOSTAGE1
Definition: zulaman.cpp:234
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
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:61
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_HOSTAGE1, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_zulaman_hostage::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

282 {
283 ClearGossipMenuFor(player);
284
285 if (action == GOSSIP_ACTION_INFO_DEF + 1)
286 CloseGossipMenuFor(player);
287
288 if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
289 return true;
290
292
293 float x, y, z;
294 creature->GetPosition(x, y, z);
295 for (uint8 i = 0; i < 4; ++i)
296 {
297 if (HostageEntry[i] == creature->GetEntry())
298 {
299 creature->SummonGameObject(ChestEntry[i], x - 2, y, z, 0, 0, 0, 0, 0, 0);
300 break;
301 }
302 }
303
304 return true;
305 }
std::uint8_t uint8
Definition: Define.h:109
static uint32 HostageEntry[]
Definition: zulaman.cpp:236
static uint32 ChestEntry[]
Definition: zulaman.cpp:237
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
uint32 GetEntry() const
Definition: Object.h:115
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2380
void GetPosition(float &x, float &y) const
Definition: Position.h:121
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
bool HasNpcFlag(NPCFlags flags) const
Definition: Unit.h:725

References ChestEntry, ClearGossipMenuFor(), CloseGossipMenuFor(), Object::GetEntry(), Position::GetPosition(), GOSSIP_ACTION_INFO_DEF, Unit::HasNpcFlag(), HostageEntry, Unit::RemoveNpcFlag(), WorldObject::SummonGameObject(), and UNIT_NPC_FLAG_GOSSIP.