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

Classes

struct  npc_thrall_bfuAI
 

Public Member Functions

 npc_thrall_bfu ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnQuestReward (Player *player, Creature *, Quest const *quest, uint32) override
 
CreatureAIGetAI (Creature *creature) const 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_thrall_bfu()

npc_thrall_bfu::npc_thrall_bfu ( )
inline
2258: CreatureScript("npc_thrall_bfu") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

3950 {
3951 return new npc_thrall_bfuAI(creature);
3952 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

2290 {
2291 if (creature->IsQuestGiver())
2292 player->PrepareQuestMenu(creature->GetGUID());
2293
2296
2297 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
2298
2299 return true;
2300 }
@ QUEST_BATTLE_H
Definition: zone_undercity.cpp:708
#define GOSSIP_THRALL
Definition: zone_undercity.cpp:930
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
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:61
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, GOSSIP_THRALL, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_BATTLE_H, QUEST_STATUS_INCOMPLETE, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

2261 {
2262 ClearGossipMenuFor(player);
2263
2264 switch (action)
2265 {
2266 case GOSSIP_ACTION_INFO_DEF + 1:
2267 {
2268 CloseGossipMenuFor(player);
2269
2270 if (auto thrall_ai = CAST_AI(npc_thrall_bfu::npc_thrall_bfuAI, creature->AI()))
2271 {
2272 if (Creature* sylvannas = GetClosestCreatureWithEntry(creature, NPC_SYLVANAS, 50.0f))
2273 {
2274 thrall_ai->sylvanasfollowGUID = sylvannas->GetGUID();
2275 thrall_ai->Start(true, true, player->GetGUID());
2276 thrall_ai->SetDespawnAtEnd(false);
2277 thrall_ai->SetDespawnAtFar(false);
2278 }
2279 else
2280 thrall_ai->sylvanasfollowGUID.Clear();
2281 }
2282 break;
2283 }
2284 }
2285
2286 return true;
2287 }
@ NPC_SYLVANAS
Definition: zone_undercity.cpp:549
#define CAST_AI(a, b)
Definition: UnitAI.h:26
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:850
Definition: Creature.h:43
CreatureAI * AI() const
Definition: Creature.h:140
Definition: zone_undercity.cpp:2315

References Creature::AI(), CAST_AI, ClearGossipMenuFor(), CloseGossipMenuFor(), GetClosestCreatureWithEntry(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, and NPC_SYLVANAS.

◆ OnQuestReward()

bool npc_thrall_bfu::OnQuestReward ( Player player,
Creature ,
Quest const *  quest,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

2303 {
2304 if (quest->GetQuestId() == QUEST_BATTLE_H)
2305 {
2308 player->CastSpell(player, SPELL_TELEPORT_OG, true);
2309 }
2310
2311 return true;
2312 }
@ SPELL_SYLVANAS_BUFF
Definition: zone_undercity.cpp:562
@ SPELL_TELEPORT_OG
Definition: zone_undercity.cpp:510
@ SPELL_THRALL_BUFF
Definition: zone_undercity.cpp:496
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
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:1167

References Unit::CastSpell(), Quest::GetQuestId(), QUEST_BATTLE_H, Unit::RemoveAura(), SPELL_SYLVANAS_BUFF, SPELL_TELEPORT_OG, and SPELL_THRALL_BUFF.