L2JMobius
Free Users => General Discussion => Topic started by: Susuy on June 28, 2022, 05:37:38 PM
-
I'm adding the townWar event and so far everything is working correctly with the exception of using skills.
Can anyone who can help me with this?
players attack each other with weapons but fighters don't use offensive skills or debuffs and mages don't attack with magic during the event. I couldn't find which part of the code to modify...
-
turn the zone pvp during event?
-
yes, anyway the event works as it should, the cursor changes to a sword like in sieges. it is possible to kill the other player by attacking with F1, respawn is normal, add pvp points too. what is not possible is to attack using skills
-
Index: java/org/l2jmobius/gameserver/model/actor/Player.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Player.java (revision 10372)
+++ java/org/l2jmobius/gameserver/model/actor/Player.java (working copy)
@@ -8373,7 +8373,7 @@
// Check if the attacker is a Playable
if (attacker.isPlayable())
{
- if (isInsideZone(ZoneId.PEACE))
+ if (isInsideZone(ZoneId.PEACE) && !eventIsActive())
{
return false;
}
-
did not work
-
did not work
it been example.
You need make implementation of "is Event Activity" or change it on FALSE
-
I use "isInTownWarEvent()" which does the same thing. the problem is in the amount as they restrict.
in Player.java and in Creature.java there are messages informing that the player cannot attack in a peaceful area, I modified the verification and now the players attack with magic! but for some reason they stopped attacking physically. the mobius tip didn't work. what made them physically attack each other was before "if (attacker.isPlayable())" I added
if (attacker.isPlayable() && isInTownWarEvent())
after I added checks in Player and Creature to release skills now only skills work and stopped attacking each other physically
-
Try!!!
Player.java
public boolean isAutoAttackable(Creature attacker)
{
if (attacker == null)
{
return false;
}
// Check if the attacker isn't the Player Pet
if ((attacker == this) || (attacker == _summon))
{
return false;
}
+if (attacker.isInTownWarEvent())
+{
+ return true;
+}
Creature.java
public boolean isInsidePeaceZone(Player attacker)
{
+ if (attacker.isPlayer() && attacker.isInTownWarEvent())
+ {
+ return false;
+ }
return isInsidePeaceZone(attacker, this);
}
probably the chars will attack each other
-
Try!!!
Player.java
public boolean isAutoAttackable(Creature attacker)
{
if (attacker == null)
{
return false;
}
// Check if the attacker isn't the Player Pet
if ((attacker == this) || (attacker == _summon))
{
return false;
}
+if (attacker.isInTownWarEvent())
+{
+ return true;
+}
Creature.java
public boolean isInsidePeaceZone(Player attacker)
{
+ if (attacker.isPlayer() && attacker.isInTownWarEvent())
+ {
+ return false;
+ }
return isInsidePeaceZone(attacker, this);
}
probably the chars will attack each other
it worked, thank you very much
-
Guys, I came back with the same problem in a different way!
During the townWar event players attack each other and use skills correctly but some skills still don't work.
Massive and area skills do not work. the skill rush for example, when the player tries to use nothing happens. can anyone help me with this?
-
I had the same problem and I managed to solve it this way
--- a/java/org/l2jmobius/gameserver/model/skill/Skill.java
+++ b/java/org/l2jmobius/gameserver/model/skill/Skill.java
@@ -1109,7 +1109,7 @@ public class Skill implements IIdentifiable
return false;
}
- if (skill.isBad() && target.isInsideZone(ZoneId.PEACE))
+ if (skill.isBad() && target.isInsideZone(ZoneId.PEACE) && !targetPlayer.isInTownWarEvent())
{
return false;
}
@@ -1139,7 +1139,7 @@ public class Skill implements IIdentifiable
return false;
}
- if (!sourceInArena && !(targetPlayer.isInsideZone(ZoneId.PVP) && !targetPlayer.isInsideZone(ZoneId.SIEGE)))
+ if (!sourceInArena && !(targetPlayer.isInsideZone(ZoneId.PVP) && !targetPlayer.isInsideZone(ZoneId.SIEGE)) && !targetPlayer.isInTownWarEvent())
-
solved, now the whole event works perfectly