mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 02:52:25 +00:00
Fix for NPC ranged attacks not allowing for multiple hits
if set by special attack 11, also changed paramater 0 (which was incorrectly set as both 'amount of attacks' and 'min range' 0 = amount attacks 4 = min attack range Fix to spell directional effect targeting.
This commit is contained in:
parent
2e80e56af1
commit
8394cc9e2b
@ -1569,13 +1569,9 @@ void Mob::AI_Process() {
|
|||||||
//Do Ranged attack here
|
//Do Ranged attack here
|
||||||
if(doranged)
|
if(doranged)
|
||||||
{
|
{
|
||||||
int attacks = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 0);
|
|
||||||
attacks = attacks > 0 ? attacks : 1;
|
|
||||||
for(int i = 0; i < attacks; ++i) {
|
|
||||||
RangedAttack(target);
|
RangedAttack(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void NPC::AI_DoMovement() {
|
void NPC::AI_DoMovement() {
|
||||||
float walksp = GetMovespeed();
|
float walksp = GetMovespeed();
|
||||||
|
|||||||
@ -973,6 +973,10 @@ void NPC::RangedAttack(Mob* other)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int attacks = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 0);
|
||||||
|
attacks = attacks > 0 ? attacks : 1;
|
||||||
|
for(int i = 0; i < attacks; ++i) {
|
||||||
|
|
||||||
//if we have SPECATK_RANGED_ATK set then we range attack without weapon or ammo
|
//if we have SPECATK_RANGED_ATK set then we range attack without weapon or ammo
|
||||||
const Item_Struct* weapon = nullptr;
|
const Item_Struct* weapon = nullptr;
|
||||||
const Item_Struct* ammo = nullptr;
|
const Item_Struct* ammo = nullptr;
|
||||||
@ -982,7 +986,7 @@ void NPC::RangedAttack(Mob* other)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sa_min_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 0); //Min Range of NPC attack
|
int sa_min_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 4); //Min Range of NPC attack
|
||||||
int sa_max_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 1); //Max Range of NPC attack
|
int sa_max_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 1); //Max Range of NPC attack
|
||||||
|
|
||||||
float min_range = static_cast<float>(RuleI(Combat, MinRangedAttackDist));
|
float min_range = static_cast<float>(RuleI(Combat, MinRangedAttackDist));
|
||||||
@ -1081,6 +1085,7 @@ void NPC::RangedAttack(Mob* other)
|
|||||||
|
|
||||||
CommonBreakInvisible();
|
CommonBreakInvisible();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg)
|
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2143,7 +2143,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
{
|
{
|
||||||
if(CheckLosFN((*iter)) || spells[spell_id].npc_no_los){
|
if(CheckLosFN((*iter)) || spells[spell_id].npc_no_los){
|
||||||
(*iter)->CalcSpellPowerDistanceMod(spell_id, 0, this);
|
(*iter)->CalcSpellPowerDistanceMod(spell_id, 0, this);
|
||||||
SpellOnTarget(spell_id, spell_target, false, true, resist_adjust);
|
SpellOnTarget(spell_id, (*iter), false, true, resist_adjust);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user