Public Repository for the Magicbane Shadowbane Emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.jobs;
import engine.Enum.DoorState;
import engine.job.AbstractScheduleJob;
import engine.net.DispatchMessage;
import engine.net.client.msg.DoorTryOpenMsg;
import engine.objects.Blueprint;
import engine.objects.Building;
public class DoorCloseJob extends AbstractScheduleJob {
Building building;
int door;
public DoorCloseJob(Building building, int door) {
super();
this.building = building;
this.door = door;
}
@Override
protected void doJob() {
int doorNumber;
if (this.building == null)
return;
doorNumber = Blueprint.getDoorNumberbyMesh(this.door);
this.building.setDoorState(doorNumber, DoorState.CLOSED);
DoorTryOpenMsg msg = new DoorTryOpenMsg(door, this.building.getObjectUUID(), 0, (byte) 0);
DispatchMessage.sendToAllInRange(building, msg);
}
@Override
protected void _cancelJob() {
}
}