mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +00:00
fixes
This commit is contained in:
parent
6b45b2bc52
commit
28ad768c0a
@ -722,7 +722,7 @@ public:
|
|||||||
int32 ReduceAllDamage(int32 damage);
|
int32 ReduceAllDamage(int32 damage);
|
||||||
|
|
||||||
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false, bool CanAvoid=true);
|
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false, bool CanAvoid=true);
|
||||||
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const Item_Struct* item=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0);
|
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const Item_Struct* item=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 ammo_id=0, int AmmoSlot=0);
|
||||||
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0);
|
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0);
|
||||||
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const Item_Struct *AmmoItem=nullptr, int AmmoSlot=0);
|
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const Item_Struct *AmmoItem=nullptr, int AmmoSlot=0);
|
||||||
bool TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot);
|
bool TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot);
|
||||||
|
|||||||
@ -199,7 +199,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
|
|||||||
SetAttackTimer();
|
SetAttackTimer();
|
||||||
ThrowingAttack(GetTarget());
|
ThrowingAttack(GetTarget());
|
||||||
if (CheckDoubleRangedAttack())
|
if (CheckDoubleRangedAttack())
|
||||||
RangedAttack(GetTarget(), true);
|
ThrowingAttack(GetTarget(), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//ranged attack (archery)
|
//ranged attack (archery)
|
||||||
@ -1074,18 +1074,18 @@ void Mob::ProjectileAttack()
|
|||||||
disable = false;
|
disable = false;
|
||||||
Mob* target = entity_list.GetMobID(ProjectileAtk[i].target_id);
|
Mob* target = entity_list.GetMobID(ProjectileAtk[i].target_id);
|
||||||
|
|
||||||
float distance = 0.0f;
|
if (target && target->IsMoving()){ //Only recalculate hit increment if target moving
|
||||||
|
float distance = target->CalculateDistance(ProjectileAtk[i].origin_x, ProjectileAtk[i].origin_y, ProjectileAtk[i].origin_z);
|
||||||
if (target && IsMoving()){ //Only recalculate hit increment if target moving
|
|
||||||
distance = target->CalculateDistance(ProjectileAtk[i].origin_x, ProjectileAtk[i].origin_y, ProjectileAtk[i].origin_z);
|
|
||||||
float hit = 60.0f + (distance / 1.8f); //Calcuation: 60 = Animation Lag, 1.8 = Speed modifier for speed of (4)
|
float hit = 60.0f + (distance / 1.8f); //Calcuation: 60 = Animation Lag, 1.8 = Speed modifier for speed of (4)
|
||||||
ProjectileAtk[i].hit_increment = static_cast<uint16>(hit);
|
ProjectileAtk[i].hit_increment = static_cast<uint16>(hit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProjectileAtk[i].hit_increment <= ProjectileAtk[i].increment){
|
if (ProjectileAtk[i].hit_increment <= ProjectileAtk[i].increment){
|
||||||
|
|
||||||
if (ProjectileAtk[i].skill == SkillArchery)
|
if (target){
|
||||||
DoArcheryAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0,ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_id, nullptr, ProjectileAtk[i].ammo_slot);
|
if (ProjectileAtk[i].skill == SkillArchery)
|
||||||
|
DoArcheryAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0,ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_id, nullptr, ProjectileAtk[i].ammo_slot);
|
||||||
|
}
|
||||||
|
|
||||||
ProjectileAtk[i].increment = 0;
|
ProjectileAtk[i].increment = 0;
|
||||||
ProjectileAtk[i].target_id = 0;
|
ProjectileAtk[i].target_id = 0;
|
||||||
@ -1323,7 +1323,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
else if(DistNoRootNoZ(*GetTarget()) < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
else if(DistNoRootNoZ(*GetTarget()) < (RuleI(Combat, MinRangedAttackDist)*RuleI(Combat, MinRangedAttackDist))){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Shout("SLOT = %i", ammo_slot);
|
||||||
if(!IsAttackAllowed(GetTarget()) ||
|
if(!IsAttackAllowed(GetTarget()) ||
|
||||||
IsCasting() ||
|
IsCasting() ||
|
||||||
IsSitting() ||
|
IsSitting() ||
|
||||||
@ -1345,7 +1345,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
CommonBreakInvisible();
|
CommonBreakInvisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item_Struct* item, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime)
|
void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item_Struct* item, uint16 weapon_damage, int16 chance_mod,int16 focus, int ReuseTime, uint32 ammo_id, int AmmoSlot)
|
||||||
{
|
{
|
||||||
if (!CanDoSpecialAttack(other))
|
if (!CanDoSpecialAttack(other))
|
||||||
return;
|
return;
|
||||||
@ -1358,8 +1358,12 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
|
|
||||||
int16 WDmg = 0;
|
int16 WDmg = 0;
|
||||||
|
|
||||||
if (!weapon_damage && item != nullptr)
|
if (!weapon_damage){
|
||||||
WDmg = GetWeaponDamage(other, item);
|
if (IsClient() && RangeWeapon)
|
||||||
|
WDmg = GetWeaponDamage(other, RangeWeapon);
|
||||||
|
else if (item)
|
||||||
|
WDmg = GetWeaponDamage(other, item);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
WDmg = weapon_damage;
|
WDmg = weapon_damage;
|
||||||
|
|
||||||
@ -1396,7 +1400,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
other->AddToHateList(this, 2*WDmg, 0, false);
|
other->AddToHateList(this, 2*WDmg, 0, false);
|
||||||
other->Damage(this, TotalDmg, SPELL_UNKNOWN, SkillThrowing);
|
other->Damage(this, TotalDmg, SPELL_UNKNOWN, SkillThrowing);
|
||||||
|
|
||||||
if (TotalDmg > 0 && HasSkillProcSuccess() && GetTarget() && other && !other->HasDied()){
|
if (TotalDmg > 0 && HasSkillProcSuccess() && other && !other->HasDied()){
|
||||||
if (ReuseTime)
|
if (ReuseTime)
|
||||||
TrySkillProc(other, SkillThrowing, ReuseTime);
|
TrySkillProc(other, SkillThrowing, ReuseTime);
|
||||||
else
|
else
|
||||||
@ -1404,10 +1408,10 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((RangeWeapon != nullptr) && GetTarget() && other && (other->GetHP() > -10))
|
if((RangeWeapon != nullptr) && other && (other->GetHP() > -10))
|
||||||
TryWeaponProc(RangeWeapon, other, MainRange);
|
TryWeaponProc(RangeWeapon, other, MainRange);
|
||||||
|
|
||||||
if (HasSkillProcs() && GetTarget() && other && !other->HasDied()){
|
if (HasSkillProcs() && other && !other->HasDied()){
|
||||||
if (ReuseTime)
|
if (ReuseTime)
|
||||||
TrySkillProc(other, SkillThrowing, ReuseTime);
|
TrySkillProc(other, SkillThrowing, ReuseTime);
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user