mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Mant more cmangos Cata commits applied
Commit:
This commit is contained in:
parent
6db0ba8ae9
commit
8cac2f42db
51 changed files with 964 additions and 270 deletions
|
|
@ -2076,36 +2076,40 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
|||
// This seems to reduce the victims time until next attack if your attack was parried
|
||||
if (damageInfo->TargetState == VICTIMSTATE_PARRY)
|
||||
{
|
||||
// Get attack timers
|
||||
float offtime = float(pVictim->getAttackTimer(OFF_ATTACK));
|
||||
float basetime = float(pVictim->getAttackTimer(BASE_ATTACK));
|
||||
// Reduce attack time
|
||||
if (pVictim->haveOffhandWeapon() && offtime < basetime)
|
||||
if (pVictim->GetTypeId() != TYPEID_UNIT ||
|
||||
!(((Creature*)pVictim)->GetCreatureInfo()->ExtraFlags & CREATURE_EXTRA_FLAG_NO_PARRY_HASTEN))
|
||||
{
|
||||
float percent20 = pVictim->GetAttackTime(OFF_ATTACK) * 0.20f;
|
||||
float percent60 = 3.0f * percent20;
|
||||
if (offtime > percent20 && offtime <= percent60)
|
||||
// Get attack timers
|
||||
float offtime = float(pVictim->getAttackTimer(OFF_ATTACK));
|
||||
float basetime = float(pVictim->getAttackTimer(BASE_ATTACK));
|
||||
// Reduce attack time
|
||||
if (pVictim->haveOffhandWeapon() && offtime < basetime)
|
||||
{
|
||||
pVictim->setAttackTimer(OFF_ATTACK, uint32(percent20));
|
||||
float percent20 = pVictim->GetAttackTime(OFF_ATTACK) * 0.20f;
|
||||
float percent60 = 3.0f * percent20;
|
||||
if (offtime > percent20 && offtime <= percent60)
|
||||
{
|
||||
pVictim->setAttackTimer(OFF_ATTACK, uint32(percent20));
|
||||
}
|
||||
else if (offtime > percent60)
|
||||
{
|
||||
offtime -= 2.0f * percent20;
|
||||
pVictim->setAttackTimer(OFF_ATTACK, uint32(offtime));
|
||||
}
|
||||
}
|
||||
else if (offtime > percent60)
|
||||
else
|
||||
{
|
||||
offtime -= 2.0f * percent20;
|
||||
pVictim->setAttackTimer(OFF_ATTACK, uint32(offtime));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float percent20 = pVictim->GetAttackTime(BASE_ATTACK) * 0.20f;
|
||||
float percent60 = 3.0f * percent20;
|
||||
if (basetime > percent20 && basetime <= percent60)
|
||||
{
|
||||
pVictim->setAttackTimer(BASE_ATTACK, uint32(percent20));
|
||||
}
|
||||
else if (basetime > percent60)
|
||||
{
|
||||
basetime -= 2.0f * percent20;
|
||||
pVictim->setAttackTimer(BASE_ATTACK, uint32(basetime));
|
||||
float percent20 = pVictim->GetAttackTime(BASE_ATTACK) * 0.20f;
|
||||
float percent60 = 3.0f * percent20;
|
||||
if (basetime > percent20 && basetime <= percent60)
|
||||
{
|
||||
pVictim->setAttackTimer(BASE_ATTACK, uint32(percent20));
|
||||
}
|
||||
else if (basetime > percent60)
|
||||
{
|
||||
basetime -= 2.0f * percent20;
|
||||
pVictim->setAttackTimer(BASE_ATTACK, uint32(basetime));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10736,9 +10740,9 @@ void CharmInfo::LoadPetActionBar(const std::string& data)
|
|||
for (iter = tokens.begin(), index = ACTION_BAR_INDEX_START; index < ACTION_BAR_INDEX_END; ++iter, ++index)
|
||||
{
|
||||
// use unsigned cast to avoid sign negative format use at long-> ActiveStates (int) conversion
|
||||
uint8 type = (uint8)atol((*iter).c_str());
|
||||
uint8 type = (uint8)std::stoul((*iter).c_str());
|
||||
++iter;
|
||||
uint32 action = atol((*iter).c_str());
|
||||
uint32 action = std::stoul((*iter).c_str());
|
||||
|
||||
PetActionBar[index].SetActionAndType(action, ActiveStates(type));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue