AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
LootScript Class Reference

#include "LootScript.h"

Inheritance diagram for LootScript:
ScriptObject

Public Member Functions

bool IsDatabaseBound () const override
 
virtual void OnLootMoney (Player *, uint32)
 This hook called before money loot. More...
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Protected Member Functions

 LootScript (const char *name, std::vector< uint16 > enabledHooks=std::vector< uint16 >())
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ LootScript()

LootScript::LootScript ( const char *  name,
std::vector< uint16 enabledHooks = std::vector<uint16>() 
)
protected
31{
32 // If empty - enable all available hooks.
33 if (enabledHooks.empty())
34 for (uint16 i = 0; i < LOOTHOOK_END; ++i)
35 enabledHooks.emplace_back(i);
36
37 ScriptRegistry<LootScript>::AddScript(this, std::move(enabledHooks));
38}
std::uint16_t uint16
Definition: Define.h:108
@ LOOTHOOK_END
Definition: LootScript.h:27
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition: ScriptMgr.h:737
Definition: ScriptObject.h:44

References ScriptRegistry< TScript >::AddScript(), and LOOTHOOK_END.

Member Function Documentation

◆ IsDatabaseBound()

bool LootScript::IsDatabaseBound ( ) const
inlineoverridevirtual

Reimplemented from ScriptObject.

36{ return false; }

◆ OnLootMoney()

virtual void LootScript::OnLootMoney ( Player ,
uint32   
)
inlinevirtual

This hook called before money loot.

Parameters
playerContains information about the Player
goldContains information about money
44{ }