Add PlayerScript hooks:
* OnMoneyChanged * OnGiveXP * OnReputationChange * OnChat * OnEmote * OnTextEmote --HG-- branch : trunk
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include "ItemPrototype.h"
|
||||
#include "Unit.h"
|
||||
#include "Item.h"
|
||||
|
||||
#include "DatabaseEnv.h"
|
||||
#include "NPCHandler.h"
|
||||
#include "QuestDef.h"
|
||||
@@ -1447,25 +1446,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;}
|
||||
|
||||
uint32 GetMoney() { return GetUInt32Value (PLAYER_FIELD_COINAGE); }
|
||||
void ModifyMoney(int32 d)
|
||||
{
|
||||
if (d < 0)
|
||||
SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0);
|
||||
else
|
||||
{
|
||||
uint32 newAmount = 0;
|
||||
if (GetMoney() < uint32(MAX_MONEY_AMOUNT - d))
|
||||
newAmount = GetMoney() + d;
|
||||
else
|
||||
{
|
||||
// "At Gold Limit"
|
||||
newAmount = MAX_MONEY_AMOUNT;
|
||||
if (d)
|
||||
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
|
||||
}
|
||||
SetMoney (newAmount);
|
||||
}
|
||||
}
|
||||
void ModifyMoney(int32 d);
|
||||
|
||||
void SetMoney(uint32 value)
|
||||
{
|
||||
SetUInt32Value (PLAYER_FIELD_COINAGE, value);
|
||||
|
||||
Reference in New Issue
Block a user