[10957] Implement auras SPELL_AURA_MOD_DISARM_OFFHAND (254) and SPELL_AURA_MOD_DISARM_RANGED (278).

Thanks to Qsa prepare for mangos.

Note: single unsure case: is block chance must be show or set to 0 in shield disarm time.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
QAston 2011-01-04 05:20:56 +03:00 committed by VladimirMangos
parent 883e88fad5
commit 4fe41fb335
9 changed files with 76 additions and 30 deletions

View file

@ -353,6 +353,9 @@ void Unit::Update( uint32 update_diff, uint32 p_time )
bool Unit::haveOffhandWeapon() const
{
if (!IsUseEquipedWeapon(OFF_ATTACK))
return false;
if(GetTypeId() == TYPEID_PLAYER)
return ((Player*)this)->GetWeaponForAttack(OFF_ATTACK,true,true);
else
@ -3327,7 +3330,7 @@ float Unit::GetUnitBlockChance() const
if(GetTypeId() == TYPEID_PLAYER)
{
Player const* player = (Player const*)this;
if(player->CanBlock() )
if(player->CanBlock() && player->IsUseEquipedWeapon(OFF_ATTACK))
{
Item *tmpitem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if(tmpitem && !tmpitem->IsBroken() && tmpitem->GetProto()->Block)