Add PlayerScript hooks:

* OnMoneyChanged
* OnGiveXP
* OnReputationChange
* OnChat
* OnEmote
* OnTextEmote

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-11 22:53:31 -07:00
parent ce29cfa7f7
commit c7b48c1ca9
6 changed files with 98 additions and 20 deletions
+2 -20
View File
@@ -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);