Polearm auto attack rework.
This commit is contained in:
parent
5967cd7be1
commit
70c624ed4a
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1317,59 +1317,47 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
*/
|
*/
|
||||||
private boolean doAttackHitByPole(Attack attack, L2Character target, int sAtk)
|
private boolean doAttackHitByPole(Attack attack, L2Character target, int sAtk)
|
||||||
{
|
{
|
||||||
// double angleChar;
|
// Perform the main target hit.
|
||||||
final int maxRadius = _stat.getPhysicalAttackRange();
|
boolean hitted = doAttackHitSimple(attack, target, 100, sAtk);
|
||||||
final int maxAngleDiff = _stat.getPhysicalAttackAngle();
|
|
||||||
|
|
||||||
// o1 x: 83420 y: 148158 (Giran)
|
|
||||||
// o2 x: 83379 y: 148081 (Giran)
|
|
||||||
// dx = -41
|
|
||||||
// dy = -77
|
|
||||||
// distance between o1 and o2 = 87.24
|
|
||||||
// arctan2 = -120 (240) degree (excel arctan2(dx, dy); java arctan2(dy, dx))
|
|
||||||
//
|
|
||||||
// o2
|
|
||||||
//
|
|
||||||
// o1 ----- (heading)
|
|
||||||
// In the diagram above:
|
|
||||||
// o1 has a heading of 0/360 degree from horizontal (facing East)
|
|
||||||
// Degree of o2 in respect to o1 = -120 (240) degree
|
|
||||||
//
|
|
||||||
// o2 / (heading)
|
|
||||||
// /
|
|
||||||
// o1
|
|
||||||
// In the diagram above
|
|
||||||
// o1 has a heading of -80 (280) degree from horizontal (facing north east)
|
|
||||||
// Degree of o2 in respect to 01 = -40 (320) degree
|
|
||||||
|
|
||||||
// Get char's heading degree
|
|
||||||
// angleChar = Util.convertHeadingToDegree(getHeading());
|
|
||||||
|
|
||||||
// H5 Changes: without Polearm Mastery (skill 216) max simultaneous attacks is 3 (1 by default + 2 in skill 3599).
|
// H5 Changes: without Polearm Mastery (skill 216) max simultaneous attacks is 3 (1 by default + 2 in skill 3599).
|
||||||
final int attackRandomCountMax = (int) _stat.calcStat(Stats.ATTACK_COUNT_MAX, 1, null, null);
|
int attackCountMax = (int) _stat.calcStat(Stats.ATTACK_COUNT_MAX, 1, null, null);
|
||||||
int attackcount = 0;
|
if (attackCountMax > 1)
|
||||||
|
{
|
||||||
// if (angleChar <= 0) angleChar += 360;
|
final int maxRadius = _stat.getPhysicalAttackRange();
|
||||||
|
final int maxAngleDiff = _stat.getPhysicalAttackAngle();
|
||||||
boolean hitted = doAttackHitSimple(attack, target, 100, sAtk);
|
|
||||||
double attackpercent = 85;
|
double attackpercent = 85;
|
||||||
for (L2Character obj : L2World.getInstance().getVisibleObjects(this, L2Character.class, maxRadius))
|
for (L2Character obj : L2World.getInstance().getVisibleObjects(this, L2Character.class, maxRadius))
|
||||||
{
|
{
|
||||||
|
// Skip main target.
|
||||||
if (obj == target)
|
if (obj == target)
|
||||||
{
|
|
||||||
continue; // do not hit twice
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj.isPet() && isPlayer() && (((L2PetInstance) obj).getOwner() == getActingPlayer()))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is within attack angle.
|
||||||
if (!isFacing(obj, maxAngleDiff))
|
if (!isFacing(obj, maxAngleDiff))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (obj.isPet() && isPlayer() && (((L2PetInstance) obj).getOwner() == getActingPlayer()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (isAttackable() && obj.isPlayer() && _target.isAttackable())
|
if (isAttackable() && obj.isPlayer() && _target.isAttackable())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -1380,22 +1368,15 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (!obj.isAlikeDead())
|
|
||||||
{
|
|
||||||
if ((obj == getAI().getAttackTarget()) || obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hitted |= doAttackHitSimple(attack, obj, attackpercent, sAtk);
|
hitted |= doAttackHitSimple(attack, obj, attackpercent, sAtk);
|
||||||
attackpercent /= 1.15;
|
attackpercent /= 1.15;
|
||||||
|
if (--attackCountMax <= 0)
|
||||||
attackcount++;
|
|
||||||
if (attackcount > attackRandomCountMax)
|
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Return true if one hit isn't missed
|
// Return true if one hit isn't missed
|
||||||
return hitted;
|
return hitted;
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
@ -1153,10 +1153,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType);
|
||||||
final Attack attack = new Attack(this, target);
|
final Attack attack = new Attack(this, target);
|
||||||
|
|
||||||
boolean shotConsumed = false;
|
boolean shotConsumed = false;
|
||||||
|
|
||||||
// Calculate the main target hit
|
// Calculate the main target hit.
|
||||||
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
Hit hit = generateHit(target, weapon, shotConsumed, isDual);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
@ -1184,26 +1183,34 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip dead or fake dead target.
|
||||||
|
if (obj.isAlikeDead())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if target is auto attackable.
|
||||||
|
if (!obj.isAutoAttackable(this))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if target is within attack angle.
|
// Check if target is within attack angle.
|
||||||
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
if (Math.abs(calculateDirectionTo(obj) - headingAngle) > physicalAttackAngle)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch a simple attack against the L2Character targeted
|
// Launch a simple attack against the additional target.
|
||||||
if (obj.isAutoAttackable(this))
|
|
||||||
{
|
|
||||||
hit = generateHit(obj, weapon, shotConsumed, false);
|
hit = generateHit(obj, weapon, shotConsumed, false);
|
||||||
attack.addHit(hit);
|
attack.addHit(hit);
|
||||||
shotConsumed = hit.isShotUsed();
|
shotConsumed = hit.isShotUsed();
|
||||||
|
|
||||||
if (--attackCountMax <= 0)
|
if (--attackCountMax <= 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return attack;
|
return attack;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user