minor clear up of 2handstaff block effect code.

This commit is contained in:
KayenEQ 2014-11-01 20:57:26 -04:00
parent 7b0045290d
commit 39bb2aa811

View File

@ -451,19 +451,16 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) { && (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
float bonusShieldBlock = 0.0f; float bonusShieldBlock = 0.0f;
bonusShieldBlock = aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock; bonusShieldBlock = static_cast<float>(aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock);
RollTable[1] += bonusShieldBlock; RollTable[1] += bonusShieldBlock;
} }
if(damage > 0 && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock) if(IsClient() && damage > 0 && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock)
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) { && (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
bool equiped2 = CastToClient()->m_inv.GetItem(MainPrimary); if(CastToClient()->m_inv.GetItem(MainPrimary)) {
if(equiped2) {
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(MainPrimary)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f; float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HBlunt) { if (CastToClient()->m_inv.GetItem(MainPrimary)->GetItem()->ItemType == ItemType2HBlunt){
bonusStaffBlock = static_cast<float>(aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock);
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] += bonusStaffBlock; RollTable[1] += bonusStaffBlock;
} }
} }
@ -4717,7 +4714,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
if (type == SE_Rune){ if (type == SE_Rune){
for(uint32 slot = 0; slot < buff_max; slot++) { for(uint32 slot = 0; slot < buff_max; slot++) {
if(slot == spellbonuses.MeleeRune[1] && spellbonuses.MeleeRune[0] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)){ if(slot == spellbonuses.MeleeRune[1] && spellbonuses.MeleeRune[0] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)){
uint32 melee_rune_left = buffs[slot].melee_rune; int melee_rune_left = buffs[slot].melee_rune;
if(melee_rune_left > damage) if(melee_rune_left > damage)
{ {
@ -4742,7 +4739,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
else{ else{
for(uint32 slot = 0; slot < buff_max; slot++) { for(uint32 slot = 0; slot < buff_max; slot++) {
if(slot == spellbonuses.AbsorbMagicAtt[1] && spellbonuses.AbsorbMagicAtt[0] && buffs[slot].magic_rune && IsValidSpell(buffs[slot].spellid)){ if(slot == spellbonuses.AbsorbMagicAtt[1] && spellbonuses.AbsorbMagicAtt[0] && buffs[slot].magic_rune && IsValidSpell(buffs[slot].spellid)){
uint32 magic_rune_left = buffs[slot].magic_rune; int magic_rune_left = buffs[slot].magic_rune;
if(magic_rune_left > damage) if(magic_rune_left > damage)
{ {
magic_rune_left -= damage; magic_rune_left -= damage;