mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
New hooks OnAfterUpdateMaxPower and OnBeforeRollMeleeOutcomeAgainst
This commit is contained in:
@@ -1525,6 +1525,11 @@ void ScriptMgr::ModifyHealRecieved(Unit* target, Unit* attacker, uint32& damage)
|
||||
FOREACH_SCRIPT(UnitScript)->ModifyHealRecieved(target, attacker, damage);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeRollMeleeOutcomeAgainst(const Unit* attacker, const Unit* victim, WeaponAttackType attType, int32 &crit_chance, int32 &miss_chance, int32 &dodge_chance, int32 &parry_chance, int32 &block_chance)
|
||||
{
|
||||
FOREACH_SCRIPT(UnitScript)->OnBeforeRollMeleeOutcomeAgainst(attacker, victim, attType, crit_chance, miss_chance, dodge_chance, parry_chance, block_chance);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerMove(Player* player, MovementInfo movementInfo, uint32 opcode)
|
||||
{
|
||||
FOREACH_SCRIPT(MovementHandlerScript)->OnPlayerMove(player, movementInfo, opcode);
|
||||
@@ -1535,6 +1540,16 @@ void ScriptMgr::OnBeforeBuyItemFromVendor(Player* player, uint64 vendorguid, uin
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBeforeBuyItemFromVendor(player, vendorguid, vendorslot, item, count, bag, slot);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAfterStoreOrEquipNewItem(player, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAfterUpdateMaxPower(Player* player, Powers& power, float& value)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
||||
}
|
||||
|
||||
AllMapScript::AllMapScript(const char* name)
|
||||
: ScriptObject(name)
|
||||
{
|
||||
|
||||
@@ -444,6 +444,8 @@ public:
|
||||
|
||||
//Called when Damage is Dealt
|
||||
virtual uint32 DealDamage(Unit* AttackerUnit, Unit *pVictim, uint32 damage, DamageEffectType damagetype) { return damage; }
|
||||
|
||||
virtual void OnBeforeRollMeleeOutcomeAgainst(const Unit* /*attacker*/, const Unit* /*victim*/, WeaponAttackType /*attType*/, int32& /*crit_chance*/, int32& /*miss_chance*/ , int32& /*dodge_chance*/ , int32& /*parry_chance*/ , int32& /*block_chance*/ ) { };
|
||||
};
|
||||
|
||||
class MovementHandlerScript : public ScriptObject
|
||||
@@ -883,8 +885,12 @@ class PlayerScript : public ScriptObject
|
||||
virtual void OnQuestRewardItem(Player* player, Item* item, uint32 count) { }
|
||||
|
||||
//Before buying something from any vendor
|
||||
virtual void OnBeforeBuyItemFromVendor(Player* player, uint64 vendorguid, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot) { };
|
||||
virtual void OnBeforeBuyItemFromVendor(Player* /*player*/, uint64 /*vendorguid*/, uint32 /*vendorslot*/, uint32 &/*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/) { };
|
||||
|
||||
//Before buying something from any vendor
|
||||
virtual void OnAfterStoreOrEquipNewItem(Player* /*player*/, uint32 /*vendorslot*/, uint32& /*item*/, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) { };
|
||||
|
||||
virtual void OnAfterUpdateMaxPower(Player* /*player*/, Powers& /*power*/, float& /*value*/) { }
|
||||
};
|
||||
|
||||
class GuildScript : public ScriptObject
|
||||
@@ -1195,6 +1201,8 @@ class ScriptMgr
|
||||
void OnCreateItem(Player* player, Item* item, uint32 count);
|
||||
void OnQuestRewardItem(Player* player, Item* item, uint32 count);
|
||||
void OnBeforeBuyItemFromVendor(Player * player, uint64 vendorguid, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot);
|
||||
void OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, uint32 &item, uint8 count, uint8 bag, uint8 slot, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
|
||||
void OnAfterUpdateMaxPower(Player* player, Powers& power, float& value);
|
||||
|
||||
public: /* GuildScript */
|
||||
|
||||
@@ -1242,6 +1250,8 @@ class ScriptMgr
|
||||
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage);
|
||||
void ModifyHealRecieved(Unit* target, Unit* attacker, uint32& addHealth);
|
||||
uint32 DealDamage(Unit* AttackerUnit, Unit *pVictim, uint32 damage, DamageEffectType damagetype);
|
||||
void OnBeforeRollMeleeOutcomeAgainst(const Unit* attacker, const Unit* victim, WeaponAttackType attType, int32 &crit_chance, int32 &miss_chance, int32 &dodge_chance, int32 &parry_chance, int32 &block_chance);
|
||||
|
||||
|
||||
public: /* MovementHandlerScript */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user