1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Semi-working attack service

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-30 20:02:19 -03:00
parent 52d4be0bf2
commit ae3007559f
61 changed files with 537 additions and 181 deletions

View File

@@ -254,8 +254,7 @@ public class Lineage2Connection {
* has been written.
*/
public ChannelFuture sendMessage(String message) {
return write(new SM_SYSTEM_MESSAGE(SystemMessage.S1)
.addString(message));
return write(new SM_SYSTEM_MESSAGE(SystemMessage.S1).addString(message));
}
/**
@@ -277,8 +276,8 @@ public class Lineage2Connection {
* the {@link SystemMessage}
* @param args
* the arguments of the message, they will be automatically
* detected and inserted. See {@link SM_SYSTEM_MESSAGE} for
* more about supported formats.
* detected and inserted. See {@link SM_SYSTEM_MESSAGE} for more
* about supported formats.
* @return the {@link ChannelFuture} that will be notified once the packet
* has been written.
* @see SM_SYSTEM_MESSAGE
@@ -293,8 +292,10 @@ public class Lineage2Connection {
packet.addItem((ItemTemplate) obj);
else if (obj instanceof Item)
packet.addItem((Item) obj);
else if (obj instanceof Number)
packet.addNumber((Integer) obj);
}
return write(message.packet);
return write(packet);
}
/**

View File

@@ -54,6 +54,10 @@ public class SM_ATTACK extends AbstractServerPacket {
Collections.addAll(this.hits, hits);
}
public SM_ATTACK(AttackHit... hits) {
this(hits[0].getAttacker(), hits);
}
@Override
public void write(Lineage2Connection conn, ChannelBuffer buffer) {
buffer.writeInt(attacker.getID().getID());