[6905] Fixed items with both healing and energizing effects

Store fall information also at MSG_MOVE_FALL_LAND
This commit is contained in:
arrai 2008-12-13 18:59:37 +01:00
parent fc5e12c828
commit d97a8d33b9
3 changed files with 30 additions and 6 deletions

View file

@ -362,7 +362,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
GetPlayer()->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
GetPlayer()->m_movementInfo = movementInfo;
if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z)
if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z || recv_data.GetOpcode() == MSG_MOVE_FALL_LAND)
GetPlayer()->SetFallInformation(movementInfo.fallTime, movementInfo.z);
if(GetPlayer()->isMovingOrTurning())

View file

@ -4405,6 +4405,8 @@ uint8 Spell::CheckItems()
uint32 ItemClass = proto->Class;
if (ItemClass == ITEM_CLASS_CONSUMABLE && m_targets.getUnitTarget())
{
// such items should only fail if there is no suitable effect at all - see Rejuvenation Potions for example
uint8 failReason = 0;
for (int i = 0; i < 3; i++)
{
// skip check, pet not required like checks, and for TARGET_PET m_targets.getUnitTarget() is not the real target but the caster
@ -4412,22 +4414,44 @@ uint8 Spell::CheckItems()
continue;
if (m_spellInfo->Effect[i] == SPELL_EFFECT_HEAL)
{
if (m_targets.getUnitTarget()->GetHealth() == m_targets.getUnitTarget()->GetMaxHealth())
return (uint8)SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
{
failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
continue;
}
else
{
failReason = 0;
break;
}
}
// Mana Potion, Rage Potion, Thistle Tea(Rogue), ...
if (m_spellInfo->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
return (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
{
failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
continue;
}
Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
if (m_targets.getUnitTarget()->GetPower(power) == m_targets.getUnitTarget()->GetMaxPower(power))
return (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
{
failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
continue;
}
else
{
failReason = 0;
break;
}
}
}
if (failReason)
return failReason;
}
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "6904"
#define REVISION_NR "6905"
#endif // __REVISION_NR_H__