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

Public Member Functions

 npc_icc_buff_switcher ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32) 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_icc_buff_switcher()

npc_icc_buff_switcher::npc_icc_buff_switcher ( )
inline
3179: CreatureScript("npc_icc_buff_switcher") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

3182 {
3183 if ((creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206) || (creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204))
3184 {
3185 if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID()))
3186 {
3187 CloseGossipMenuFor(player);
3188 ChatHandler(player->GetSession()).PSendSysMessage("Only the raid leader can turn off the buff.");
3189 return true;
3190 }
3191 if (InstanceScript* inst = creature->GetInstanceScript())
3192 if (inst->GetData(DATA_BUFF_AVAILABLE))
3193 inst->SetData(DATA_BUFF_AVAILABLE, 0);
3194 if (creature->GetEntry() == NPC_GARROSH_HELLSCREAM)
3195 {
3196 CloseGossipMenuFor(player);
3197 return true;
3198 }
3199 }
3200 return false;
3201 }
@ NPC_KING_VARIAN_WRYNN
Definition: icecrown_citadel.h:174
@ NPC_GARROSH_HELLSCREAM
Definition: icecrown_citadel.h:173
@ DATA_BUFF_AVAILABLE
Definition: icecrown_citadel.h:136
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
Definition: Chat.h:37
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:210
uint32 GetMenuId() const
Definition: GossipDef.h:172
GossipMenu & GetGossipMenu()
Definition: GossipDef.h:264
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
WorldSession * GetSession() const
Definition: Player.h:1998
Group * GetGroup()
Definition: Player.h:2468
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
bool IsLeader(ObjectGuid guid) const
Definition: Group.cpp:2337
bool isRaidGroup() const
Definition: Group.cpp:2267
Definition: InstanceScript.h:142

References CloseGossipMenuFor(), DATA_BUFF_AVAILABLE, Object::GetEntry(), PlayerMenu::GetGossipMenu(), Player::GetGroup(), Object::GetGUID(), WorldObject::GetInstanceScript(), GossipMenu::GetMenuId(), Player::GetSession(), Group::IsLeader(), Group::isRaidGroup(), NPC_GARROSH_HELLSCREAM, NPC_KING_VARIAN_WRYNN, Player::PlayerTalkClass, and ChatHandler::PSendSysMessage().