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

Public Member Functions

 npcs_riverbreeze_and_silversky ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) 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

◆ npcs_riverbreeze_and_silversky()

npcs_riverbreeze_and_silversky::npcs_riverbreeze_and_silversky ( )
inline
55: CreatureScript("npcs_riverbreeze_and_silversky") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

69 {
70 if (creature->IsQuestGiver())
71 player->PrepareQuestMenu(creature->GetGUID());
72
73 uint32 creatureId = creature->GetEntry();
74
75 if (creatureId == NPC_ARATHANDRIS_SILVERSKY)
76 {
78 {
80 SendGossipMenuFor(player, 2848, creature->GetGUID());
81 }
82 else if (player->GetTeamId() == TEAM_HORDE)
83 SendGossipMenuFor(player, 2845, creature->GetGUID());
84 else
85 SendGossipMenuFor(player, 2844, creature->GetGUID());
86 }
87
88 if (creatureId == NPC_MAYBESS_RIVERBREEZE)
89 {
91 {
93 SendGossipMenuFor(player, 2849, creature->GetGUID());
94 }
95 else if (player->GetTeamId() == TEAM_ALLIANCE)
96 SendGossipMenuFor(player, 2843, creature->GetGUID());
97 else
98 SendGossipMenuFor(player, 2842, creature->GetGUID());
99 }
100
101 return true;
102 }
std::uint32_t uint32
Definition: Define.h:107
@ NPC_ARATHANDRIS_SILVERSKY
Definition: zone_felwood.cpp:45
@ QUEST_CLEASING_FELWOOD_H
Definition: zone_felwood.cpp:49
@ NPC_MAYBESS_RIVERBREEZE
Definition: zone_felwood.cpp:46
@ QUEST_CLEASING_FELWOOD_A
Definition: zone_felwood.cpp:48
#define GOSSIP_ITEM_BEACON
Definition: zone_felwood.cpp:39
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
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
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1414
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2108
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
bool IsQuestGiver() const
Definition: Unit.h:762

References AddGossipItemFor(), Object::GetEntry(), Object::GetGUID(), Player::GetQuestRewardStatus(), Player::GetTeamId(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), NPC_ARATHANDRIS_SILVERSKY, NPC_MAYBESS_RIVERBREEZE, Player::PrepareQuestMenu(), QUEST_CLEASING_FELWOOD_A, QUEST_CLEASING_FELWOOD_H, SendGossipMenuFor(), TEAM_ALLIANCE, and TEAM_HORDE.

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

58 {
59 ClearGossipMenuFor(player);
60 if (action == GOSSIP_ACTION_INFO_DEF + 1)
61 {
62 CloseGossipMenuFor(player);
63 creature->CastSpell(player, SPELL_CENARION_BEACON, false);
64 }
65 return true;
66 }
@ SPELL_CENARION_BEACON
Definition: zone_felwood.cpp:43
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
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(), ClearGossipMenuFor(), CloseGossipMenuFor(), GOSSIP_ACTION_INFO_DEF, and SPELL_CENARION_BEACON.