Merge pull request #218 from KayenEQ/Development

Implemented NPC special ability 40 'NPC_CHASE_DISTANCE'
This commit is contained in:
Alex
2014-08-24 11:17:52 -07:00
5 changed files with 42 additions and 3 deletions
+6
View File
@@ -947,6 +947,9 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item
void NPC::RangedAttack(Mob* other)
{
if (!other)
return;
//make sure the attack and ranged timers are up
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){
@@ -954,6 +957,9 @@ void NPC::RangedAttack(Mob* other)
return;
}
if(!CheckLosFN(other))
return;
int attacks = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 0);
attacks = attacks > 0 ? attacks : 1;
for(int i = 0; i < attacks; ++i) {