|
@@ -625,10 +625,7 @@ public abstract class L2Character extends L2Object
|
|
|
|
|
|
if (!needHpUpdate(352))
|
|
if (!needHpUpdate(352))
|
|
return;
|
|
return;
|
|
-
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("Broadcast Status Update for " + getObjectId() + "(" + getName() + "). HP: " + getCurrentHp());
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// Create the Server->Client packet StatusUpdate with current HP
|
|
// Create the Server->Client packet StatusUpdate with current HP
|
|
StatusUpdate su = new StatusUpdate(this);
|
|
StatusUpdate su = new StatusUpdate(this);
|
|
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
|
|
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
|
|
@@ -692,9 +689,6 @@ public abstract class L2Character extends L2Object
|
|
|
|
|
|
z += 5;
|
|
z += 5;
|
|
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("Teleporting to: " + x + ", " + y + ", " + z);
|
|
|
|
-
|
|
|
|
// Send a Server->Client packet TeleportToLocationt to the L2Character AND to all L2PcInstance in the _KnownPlayers of the L2Character
|
|
// Send a Server->Client packet TeleportToLocationt to the L2Character AND to all L2PcInstance in the _KnownPlayers of the L2Character
|
|
broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
|
|
broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
|
|
|
|
|
|
@@ -803,8 +797,6 @@ public abstract class L2Character extends L2Object
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine(getName() + " doAttack: target=" + target);
|
|
|
|
|
|
|
|
if (!isAlikeDead())
|
|
if (!isAlikeDead())
|
|
{
|
|
{
|
|
@@ -1207,7 +1199,7 @@ public abstract class L2Character extends L2Object
|
|
// Calculate physical damages
|
|
// Calculate physical damages
|
|
damage1 = (int) Formulas.calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
|
|
damage1 = (int) Formulas.calcPhysDam(this, target, null, shld1, crit1, false, attack.soulshot);
|
|
|
|
|
|
- double range = Math.sqrt(this.getDistanceSq(target));
|
|
|
|
|
|
+ double range = Math.sqrt(getDistanceSq(target));
|
|
if (range < 1600)
|
|
if (range < 1600)
|
|
{
|
|
{
|
|
double dmgmod = 1 - (1 - range / 800) * 0.35;
|
|
double dmgmod = 1 - (1 - range / 800) * 0.35;
|
|
@@ -1443,12 +1435,6 @@ public abstract class L2Character extends L2Object
|
|
int maxRadius = getPhysicalAttackRange();
|
|
int maxRadius = getPhysicalAttackRange();
|
|
int maxAngleDiff = (int) getStat().calcStat(Stats.POWER_ATTACK_ANGLE, 120, null, null);
|
|
int maxAngleDiff = (int) getStat().calcStat(Stats.POWER_ATTACK_ANGLE, 120, null, null);
|
|
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- {
|
|
|
|
- _log.info("doAttackHitByPole: Max radius = " + maxRadius);
|
|
|
|
- _log.info("doAttackHitByPole: Max angle = " + maxAngleDiff);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// o1 x: 83420 y: 148158 (Giran)
|
|
// o1 x: 83420 y: 148158 (Giran)
|
|
// o2 x: 83379 y: 148081 (Giran)
|
|
// o2 x: 83379 y: 148081 (Giran)
|
|
// dx = -41
|
|
// dx = -41
|
|
@@ -4526,7 +4512,7 @@ public abstract class L2Character extends L2Object
|
|
{
|
|
{
|
|
dz = m._zDestination - zPrev; // allow diff
|
|
dz = m._zDestination - zPrev; // allow diff
|
|
}
|
|
}
|
|
- else if (this.isInCombat() && Math.abs(dz) > 200 && (dx * dx + dy * dy) < 40000) // allow mob to climb up to pcinstance
|
|
|
|
|
|
+ else if (isInCombat() && Math.abs(dz) > 200 && (dx * dx + dy * dy) < 40000) // allow mob to climb up to pcinstance
|
|
{
|
|
{
|
|
dz = m._zDestination - zPrev; // climbing
|
|
dz = m._zDestination - zPrev; // climbing
|
|
}
|
|
}
|
|
@@ -4628,7 +4614,7 @@ public abstract class L2Character extends L2Object
|
|
}
|
|
}
|
|
broadcastPacket(new StopMove(this));
|
|
broadcastPacket(new StopMove(this));
|
|
if (Config.MOVE_BASED_KNOWNLIST && updateKnownObjects)
|
|
if (Config.MOVE_BASED_KNOWNLIST && updateKnownObjects)
|
|
- this.getKnownList().findObjects();
|
|
|
|
|
|
+ getKnownList().findObjects();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -4765,10 +4751,7 @@ public abstract class L2Character extends L2Object
|
|
dz = (z - curZ);
|
|
dz = (z - curZ);
|
|
distance = Math.sqrt(dx * dx + dy * dy);
|
|
distance = Math.sqrt(dx * dx + dy * dy);
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("distance to target:" + distance);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// Define movement angles needed
|
|
// Define movement angles needed
|
|
// ^
|
|
// ^
|
|
// | X (x,y)
|
|
// | X (x,y)
|
|
@@ -4793,10 +4776,7 @@ public abstract class L2Character extends L2Object
|
|
|
|
|
|
// If no distance to go through, the movement is canceled
|
|
// If no distance to go through, the movement is canceled
|
|
if (distance < 1 || distance - offset <= 0)
|
|
if (distance < 1 || distance - offset <= 0)
|
|
- {
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("already in range, no movement needed.");
|
|
|
|
-
|
|
|
|
|
|
+ {
|
|
// Notify the AI that the L2Character is arrived at destination
|
|
// Notify the AI that the L2Character is arrived at destination
|
|
getAI().notifyEvent(CtrlEvent.EVT_ARRIVED);
|
|
getAI().notifyEvent(CtrlEvent.EVT_ARRIVED);
|
|
|
|
|
|
@@ -4844,7 +4824,7 @@ public abstract class L2Character extends L2Object
|
|
// Movement checks:
|
|
// Movement checks:
|
|
// when geodata == 2, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
|
|
// when geodata == 2, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
|
|
// when geodata == 1, for l2playableinstance and l2riftinstance only
|
|
// when geodata == 1, for l2playableinstance and l2riftinstance only
|
|
- if ((Config.GEODATA == 2 && !(isL2Attackable() && ((L2Attackable) this).isReturningToSpawnPoint())) || (isPlayer() && !(isInVehicle && distance > 1500)) || (isSummon() && !(this.getAI().getIntention() == AI_INTENTION_FOLLOW)) // assuming intention_follow only when following owner
|
|
|
|
|
|
+ if ((Config.GEODATA == 2 && !(isL2Attackable() && ((L2Attackable) this).isReturningToSpawnPoint())) || (isPlayer() && !(isInVehicle && distance > 1500)) || (isSummon() && !(getAI().getIntention() == AI_INTENTION_FOLLOW)) // assuming intention_follow only when following owner
|
|
|| isAfraid() || this instanceof L2RiftInvaderInstance)
|
|
|| isAfraid() || this instanceof L2RiftInvaderInstance)
|
|
{
|
|
{
|
|
if (isOnGeodataPath())
|
|
if (isOnGeodataPath())
|
|
@@ -4864,14 +4844,14 @@ public abstract class L2Character extends L2Object
|
|
if (curX < L2World.MAP_MIN_X || curX > L2World.MAP_MAX_X || curY < L2World.MAP_MIN_Y || curY > L2World.MAP_MAX_Y)
|
|
if (curX < L2World.MAP_MIN_X || curX > L2World.MAP_MAX_X || curY < L2World.MAP_MIN_Y || curY > L2World.MAP_MAX_Y)
|
|
{
|
|
{
|
|
// Temporary fix for character outside world region errors
|
|
// Temporary fix for character outside world region errors
|
|
- _log.warning("Character " + this.getName() + " outside world area, in coordinates x:" + curX + " y:" + curY);
|
|
|
|
|
|
+ _log.warning("Character " + getName() + " outside world area, in coordinates x:" + curX + " y:" + curY);
|
|
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
|
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
|
if (isPlayer())
|
|
if (isPlayer())
|
|
getActingPlayer().logout();
|
|
getActingPlayer().logout();
|
|
else if (isSummon())
|
|
else if (isSummon())
|
|
return; // preventation when summon get out of world coords, player will not loose him, unsummon handled from pcinstance
|
|
return; // preventation when summon get out of world coords, player will not loose him, unsummon handled from pcinstance
|
|
else
|
|
else
|
|
- this.onDecay();
|
|
|
|
|
|
+ onDecay();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Location destiny = GeoData.getInstance().moveCheck(curX, curY, curZ, x, y, z, getInstanceId());
|
|
Location destiny = GeoData.getInstance().moveCheck(curX, curY, curZ, x, y, z, getInstanceId());
|
|
@@ -4887,11 +4867,11 @@ public abstract class L2Character extends L2Object
|
|
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
|
|
// Pathfinding checks. Only when geodata setting is 2, the LoS check gives shorter result
|
|
// than the original movement was and the LoS gives a shorter distance than 2000
|
|
// than the original movement was and the LoS gives a shorter distance than 2000
|
|
// This way of detecting need for pathfinding could be changed.
|
|
// This way of detecting need for pathfinding could be changed.
|
|
- if (Config.GEODATA == 2 && originalDistance - distance > 30 && distance < 2000 && !this.isAfraid())
|
|
|
|
|
|
+ if (Config.GEODATA == 2 && originalDistance - distance > 30 && distance < 2000 && !isAfraid())
|
|
{
|
|
{
|
|
// Path calculation
|
|
// Path calculation
|
|
// Overrides previous movement check
|
|
// Overrides previous movement check
|
|
- if ((isPlayable() && !isInVehicle) || this.isMinion() || this.isInCombat())
|
|
|
|
|
|
+ if ((isPlayable() && !isInVehicle) || isMinion() || isInCombat())
|
|
{
|
|
{
|
|
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayable());
|
|
m.geoPath = PathFinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId(), isPlayable());
|
|
if (m.geoPath == null || m.geoPath.size() < 2) // No path found
|
|
if (m.geoPath == null || m.geoPath.size() < 2) // No path found
|
|
@@ -4904,7 +4884,7 @@ public abstract class L2Character extends L2Object
|
|
// * Summons will follow their masters no matter what.
|
|
// * Summons will follow their masters no matter what.
|
|
// * Currently minions also must move freely since L2AttackableAI commands
|
|
// * Currently minions also must move freely since L2AttackableAI commands
|
|
// them to move along with their leader
|
|
// them to move along with their leader
|
|
- if (isPlayer() || (!isPlayable() && !this.isMinion() && Math.abs(z - curZ) > 140) || (isSummon() && !((L2Summon) this).getFollowStatus()))
|
|
|
|
|
|
+ if (isPlayer() || (!isPlayable() && !isMinion() && Math.abs(z - curZ) > 140) || (isSummon() && !((L2Summon) this).getFollowStatus()))
|
|
{
|
|
{
|
|
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
|
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
|
return;
|
|
return;
|
|
@@ -4955,7 +4935,7 @@ public abstract class L2Character extends L2Object
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// If no distance to go through, the movement is canceled
|
|
// If no distance to go through, the movement is canceled
|
|
- if (distance < 1 && (Config.GEODATA == 2 || isPlayable() || this instanceof L2RiftInvaderInstance || this.isAfraid()))
|
|
|
|
|
|
+ if (distance < 1 && (Config.GEODATA == 2 || isPlayable() || this instanceof L2RiftInvaderInstance || isAfraid()))
|
|
{
|
|
{
|
|
if (isSummon())
|
|
if (isSummon())
|
|
((L2Summon) this).setFollowStatus(false);
|
|
((L2Summon) this).setFollowStatus(false);
|
|
@@ -4980,10 +4960,7 @@ public abstract class L2Character extends L2Object
|
|
// Does not broke heading on vertical movements
|
|
// Does not broke heading on vertical movements
|
|
if (!verticalMovementOnly)
|
|
if (!verticalMovementOnly)
|
|
setHeading(Util.calculateHeadingFrom(cos, sin));
|
|
setHeading(Util.calculateHeadingFrom(cos, sin));
|
|
-
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("dist:" + distance + "speed:" + speed + " ttt:" + ticksToMove + " heading:" + getHeading());
|
|
|
|
-
|
|
|
|
|
|
+
|
|
m._moveStartTime = GameTimeController.getGameTicks();
|
|
m._moveStartTime = GameTimeController.getGameTicks();
|
|
|
|
|
|
// Set the L2Character _move object to MoveData object
|
|
// Set the L2Character _move object to MoveData object
|
|
@@ -5003,7 +4980,7 @@ public abstract class L2Character extends L2Object
|
|
|
|
|
|
public boolean moveToNextRoutePoint()
|
|
public boolean moveToNextRoutePoint()
|
|
{
|
|
{
|
|
- if (!this.isOnGeodataPath())
|
|
|
|
|
|
+ if (!isOnGeodataPath())
|
|
{
|
|
{
|
|
// Cancel the move action
|
|
// Cancel the move action
|
|
_move = null;
|
|
_move = null;
|
|
@@ -5061,9 +5038,6 @@ public abstract class L2Character extends L2Object
|
|
|
|
|
|
m._moveStartTime = GameTimeController.getGameTicks();
|
|
m._moveStartTime = GameTimeController.getGameTicks();
|
|
|
|
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("time to target:" + ticksToMove);
|
|
|
|
-
|
|
|
|
// Set the L2Character _move object to MoveData object
|
|
// Set the L2Character _move object to MoveData object
|
|
_move = m;
|
|
_move = m;
|
|
|
|
|
|
@@ -5296,8 +5270,6 @@ public abstract class L2Character extends L2Object
|
|
// // update x,y,z with the current calculated position
|
|
// // update x,y,z with the current calculated position
|
|
// stopMove();
|
|
// stopMove();
|
|
//
|
|
//
|
|
- // if (Config.DEBUG)
|
|
|
|
- // _log.fine(this.getName() +":: target reached at: x "+getX()+" y "+getY()+ " z:" + getZ());
|
|
|
|
//
|
|
//
|
|
// if (getPawnTarget() != null)
|
|
// if (getPawnTarget() != null)
|
|
// {
|
|
// {
|
|
@@ -5787,7 +5759,7 @@ public abstract class L2Character extends L2Object
|
|
return false;
|
|
return false;
|
|
if (!(target.isPlayable() && attacker.isPlayable()))
|
|
if (!(target.isPlayable() && attacker.isPlayable()))
|
|
return false;
|
|
return false;
|
|
- if (InstanceManager.getInstance().getInstance(this.getInstanceId()).isPvPInstance())
|
|
|
|
|
|
+ if (InstanceManager.getInstance().getInstance(getInstanceId()).isPvPInstance())
|
|
return false;
|
|
return false;
|
|
|
|
|
|
if (TerritoryWarManager.PLAYER_WITH_WARD_CAN_BE_KILLED_IN_PEACEZONE && TerritoryWarManager.getInstance().isTWInProgress())
|
|
if (TerritoryWarManager.PLAYER_WITH_WARD_CAN_BE_KILLED_IN_PEACEZONE && TerritoryWarManager.getInstance().isTWInProgress())
|
|
@@ -6317,11 +6289,6 @@ public abstract class L2Character extends L2Object
|
|
}
|
|
}
|
|
targetList.add((L2Character) target);
|
|
targetList.add((L2Character) target);
|
|
}
|
|
}
|
|
- //else
|
|
|
|
- //{
|
|
|
|
- // if (Config.DEBUG)
|
|
|
|
- // _log.warning("Class cast bad: "+targets[i].getClass().toString());
|
|
|
|
- //}
|
|
|
|
}
|
|
}
|
|
if (targetList.isEmpty())
|
|
if (targetList.isEmpty())
|
|
{
|
|
{
|
|
@@ -6721,8 +6688,6 @@ public abstract class L2Character extends L2Object
|
|
*/
|
|
*/
|
|
public void disableAllSkills()
|
|
public void disableAllSkills()
|
|
{
|
|
{
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("all skills disabled");
|
|
|
|
_allSkillsDisabled = true;
|
|
_allSkillsDisabled = true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6731,8 +6696,6 @@ public abstract class L2Character extends L2Object
|
|
*/
|
|
*/
|
|
public void enableAllSkills()
|
|
public void enableAllSkills()
|
|
{
|
|
{
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.fine("all skills enabled");
|
|
|
|
_allSkillsDisabled = false;
|
|
_allSkillsDisabled = false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -7001,8 +6964,6 @@ public abstract class L2Character extends L2Object
|
|
angleDiff -= 360;
|
|
angleDiff -= 360;
|
|
if (Math.abs(angleDiff) <= maxAngleDiff)
|
|
if (Math.abs(angleDiff) <= maxAngleDiff)
|
|
{
|
|
{
|
|
- if (Config.DEBUG)
|
|
|
|
- _log.info("Char " + getName() + " is behind " + target.getName());
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -7052,7 +7013,7 @@ public abstract class L2Character extends L2Object
|
|
return false;
|
|
return false;
|
|
maxAngleDiff = maxAngle / 2.;
|
|
maxAngleDiff = maxAngle / 2.;
|
|
angleTarget = Util.calculateAngleFrom(this, target);
|
|
angleTarget = Util.calculateAngleFrom(this, target);
|
|
- angleChar = Util.convertHeadingToDegree(this.getHeading());
|
|
|
|
|
|
+ angleChar = Util.convertHeadingToDegree(getHeading());
|
|
angleDiff = angleChar - angleTarget;
|
|
angleDiff = angleChar - angleTarget;
|
|
if (angleDiff <= -360 + maxAngleDiff)
|
|
if (angleDiff <= -360 + maxAngleDiff)
|
|
angleDiff += 360;
|
|
angleDiff += 360;
|