mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Implemented NPC special ability 40 'NPC_CHASE_DISTANCE'
Param 0: Sets max distance you need to be away from an npc for it to chase you. Param 1: Sets min distance you need to be from npc for it to chase you. Usage: Ideally used with ranged attack npcs / casters who you DO NOT WANT to chase you unless you get too close or too far or out of sight.
This commit is contained in:
@@ -965,6 +965,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()))
|
||||
@@ -973,6 +976,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) {
|
||||
|
||||
Reference in New Issue
Block a user