Projectile clipping, PassDoor fix (#176)

* Numbered packet sizes.
Corrected sound packet length to 6 from 5.
Corrected sound packet in server.
Teleport sound now plays correctly.
Corrected modern teleport animation playthrough.
Removed redundant teleport delay.

* Changed sendSound packet size back to 5 and removed type attribute to maintain compatibility with Parabot.

* After running around an object to attack the player will no longer wait a number of ticks to start attacking again.
Fixed an issue where walkTo being called from CycleEvents would not execute correctly.
Player will no longer face a killed npc after it respawns.
Added projectile clipping.
Added a new algorithm for player->player/npc following that accounts for projectile clipping.
This commit is contained in:
mikeysasse
2019-11-11 14:20:02 -06:00
committed by Daniel Ginovker
parent a4e4b89d99
commit c827d46ca0
66 changed files with 1293 additions and 480 deletions
@@ -244,21 +244,8 @@ public class ActionSender {
public ActionSender frame174(int sound, int vol, int delay) {
player.outStream.createFrame(174);
player.outStream.writeWord(sound);
player.outStream.writeByte(vol);
player.outStream.writeWord(delay);
player.updateRequired = true;
player.appearanceUpdateRequired = true;
return this;
}
public ActionSender frame174(int id, int type, int delay, int volume) {
if (player.outStream != null && player != null && id != -1) {
player.outStream.createFrame(174);
player.outStream.writeWord(id);
player.outStream.writeWord(delay);
player.outStream.writeWord(volume);
player.flushOutStream();
}
player.outStream.writeByte(vol);
return this;
}
@@ -567,8 +554,6 @@ public class ActionSender {
public ActionSender sendSound(int id, int volume, int delay) {
frame174(id, volume, delay);
player.updateRequired = true;
player.appearanceUpdateRequired = true;
return this;
}
@@ -43,7 +43,7 @@ public class ClickObject implements PacketType {
int[] size = object.getObjectSize();
player.startCurrentTask(1, new CycleEvent() {
CycleEvent objectWalkToEvent = new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if (objectX != player.objectX || objectY != player.objectY || objectId != player.objectId) {
@@ -66,7 +66,10 @@ public class ClickObject implements PacketType {
@Override
public void stop() {}
});
};
player.startCurrentTask(1, objectWalkToEvent);
objectWalkToEvent.execute(player.getCurrentTask()); // cheap hax for instant event execution, since we don't support it
}
@Override