Merge branch 'Development' of https://github.com/KayenEQ/Server into KayenEQ-Development

This commit is contained in:
KimLS 2014-08-22 00:21:11 -07:00
commit 85bd837a66
3 changed files with 105 additions and 104 deletions

View File

@ -1569,12 +1569,8 @@ 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() {

View File

@ -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));
@ -1080,6 +1084,7 @@ void NPC::RangedAttack(Mob* other)
TrySkillProc(other, skillinuse, 0, false, MainRange); TrySkillProc(other, skillinuse, 0, false, MainRange);
CommonBreakInvisible(); CommonBreakInvisible();
}
} }
uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg)

View File

@ -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);
} }
} }
} }