Make BB teleporters work like in Habbo

This commit is contained in:
Alejandro 2019-05-26 20:14:38 +03:00
parent 10f1606919
commit d1bad8ea15
2 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,7 @@ public class InteractionBattleBanzaiTeleporter extends HabboItem
room.updateItem(target); room.updateItem(target);
roomUnit.setGoalLocation(room.getLayout().getTile(roomUnit.getX(), roomUnit.getY())); roomUnit.setGoalLocation(room.getLayout().getTile(roomUnit.getX(), roomUnit.getY()));
roomUnit.setCanWalk(false); roomUnit.setCanWalk(false);
Emulator.getThreading().run(new BanzaiRandomTeleport(this, target, roomUnit, room), 500); Emulator.getThreading().run(new BanzaiRandomTeleport(this, target, roomUnit, room), 1000);
} }
@Override @Override

View File

@ -1,7 +1,9 @@
package com.eu.habbo.threading.runnables; package com.eu.habbo.threading.runnables;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.users.HabboItem;
@ -28,6 +30,7 @@ public class BanzaiRandomTeleport implements Runnable
this.toItem.setExtradata("0"); this.toItem.setExtradata("0");
this.room.updateItem(this.item); this.room.updateItem(this.item);
this.room.updateItem(this.toItem); this.room.updateItem(this.toItem);
this.habbo.setRotation(RoomUserRotation.fromValue(Emulator.getRandom().nextInt(8)));
this.room.teleportRoomUnitToItem(this.habbo, this.toItem); this.room.teleportRoomUnitToItem(this.habbo, this.toItem);
} }
} }