L2JMobius

Public Development => Solved/Invalid Bug Reports => Topic started by: evilfrogy on April 05, 2022, 03:00:31 PM

Title: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 03:00:31 PM
It is impossible to attack the guards of the castle, the gate, etc. The server defines me as a defender, although I attack.

(https://i.ibb.co/cXfmRPj/unknown.png) (https://ibb.co/qFqZhzv)
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 03:37:10 PM
Your report is invalid.
(https://i.ibb.co/02K6G8q/image.png) (https://ibb.co/tKzvJkB)
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 03:44:04 PM
They hit me, but i cant. Why my report is invalid?  :'(

I use the latest version from git.
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 03:46:38 PM
It is impossible to attack the guards of the castle, the gate, etc.

They hit me, but i cant.

When you decide how things work, someone might take the time to help you.
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 03:52:44 PM
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 03:55:16 PM
It is impossible to attack the guards of the castle, the gate, etc.

They hit me, but i cant.

When you decide how things work, someone might take the time to help you.

I'm sorry you have to waste your time on me. I just don't understand what I'm doing wrong. Can you explain to me please? I registered for the siege as an attacker, but I can't attack the guards.
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 04:41:03 PM
Do you use geodata?
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 04:53:42 PM
Do you use geodata?
No, I thought it was already built into the server. Need to install geodata?
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 05:06:16 PM
You do.
Readme.txt
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 05:26:49 PM
You do.
Readme.txt
I did it but the result is the same
(https://i.ibb.co/dmBXWvF/geodata.png) (https://ibb.co/ph2N0Tc)
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 05:49:32 PM
Try this.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/model/actor/Player.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Player.java (revision 10046)
+++ java/org/l2jmobius/gameserver/model/actor/Player.java (working copy)
@@ -1657,7 +1657,7 @@
 
  // Check first castle mid victory.
  final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
- if ((castle != null) && !castle.isFirstMidVictory())
+ if ((castle != null) && !castle.isFirstMidVictory() && !(target instanceof Defender))
  {
  return true;
  }
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 06:05:29 PM
Try this.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/model/actor/Player.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Player.java (revision 10046)
+++ java/org/l2jmobius/gameserver/model/actor/Player.java (working copy)
@@ -1657,7 +1657,7 @@
 
  // Check first castle mid victory.
  final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
- if ((castle != null) && !castle.isFirstMidVictory())
+ if ((castle != null) && !castle.isFirstMidVictory() && !(target instanceof Defender))
  {
  return true;
  }

Thank you very much, you are the best administrator that I have seen. There is no limit to my respect! its work fine for me!


Now i can kill guards, but still cant attack gates, and use aoe spells.
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 06:13:02 PM
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 06:13:49 PM
Try this instead.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/model/actor/Player.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/Player.java (revision 10046)
+++ java/org/l2jmobius/gameserver/model/actor/Player.java (working copy)
@@ -1657,13 +1657,13 @@
 
  // Check first castle mid victory.
  final Castle castle = CastleManager.getInstance().getCastleById(_siegeSide);
- if ((castle != null) && !castle.isFirstMidVictory())
+ final Player targetPlayer = target.getActingPlayer();
+ if ((castle != null) && (targetPlayer != null) && !castle.isFirstMidVictory())
  {
  return true;
  }
 
  // If target isn't a player, is self, isn't on same siege or not on same state, not friends.
- final Player targetPlayer = target.getActingPlayer();
  if ((targetPlayer == null) || (targetPlayer == this) || (targetPlayer.getSiegeSide() != _siegeSide) || (_siegeState != targetPlayer.getSiegeState()))
  {
  return false;
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 05, 2022, 07:50:45 PM
Still not working right.  Can't use aoe skills. Unrecorded players cannot be attacked either.

Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 05, 2022, 08:09:57 PM
Do not test with GM characters.
You take in consideration first mid victory?
Title: Re: Impossible to attack the defenders of the castle
Post by: Mobius on April 06, 2022, 12:59:09 AM
Latest patch committed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/547bde436f0303392c3c59d3b96fa6b043844ed2
Title: Re: Impossible to attack the defenders of the castle
Post by: evilfrogy on April 06, 2022, 12:10:28 PM
Before the FirstMidvictory, the following situation may happen: player 1 is registered for the siege as an attacker. Player 2 is not registered for the siege. Player 1 cannot hit player 2, in turn player 2 can hit player 1. This is wrong. Players should be able to beat each other. However, if player 3 is also registered for the siege, player 1 and player 3 should not beat each other until an intermediate victory - now its work.

I haven't figured out all the functions yet, so I can't offer a solution now. But it is clear to me that we need a check on a neutral player and everyone should beat him. Thank you so much for your help!