Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredTrigger.java

62 lines
1.7 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.items.interactions;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
import com.eu.habbo.messages.ClientMessage;
import com.eu.habbo.messages.outgoing.wired.WiredTriggerDataComposer;
import java.sql.ResultSet;
import java.sql.SQLException;
2019-05-26 20:14:53 +02:00
public abstract class InteractionWiredTrigger extends InteractionWired {
2018-07-06 15:30:00 +02:00
private int delay;
2019-05-26 20:14:53 +02:00
protected InteractionWiredTrigger(ResultSet set, Item baseItem) throws SQLException {
2018-07-06 15:30:00 +02:00
super(set, baseItem);
}
2019-05-26 20:14:53 +02:00
protected InteractionWiredTrigger(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
2018-07-06 15:30:00 +02:00
super(id, userId, item, extradata, limitedStack, limitedSells);
}
@Override
2019-05-26 20:14:53 +02:00
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
2018-07-06 15:30:00 +02:00
return true;
}
@Override
2019-05-26 20:14:53 +02:00
public boolean isWalkable() {
2018-07-06 15:30:00 +02:00
return true;
}
@Override
2019-05-26 20:14:53 +02:00
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
if (client != null) {
if (room.hasRights(client.getHabbo())) {
2018-07-06 15:30:00 +02:00
client.sendResponse(new WiredTriggerDataComposer(this, room));
this.activateBox(room);
}
}
}
public abstract WiredTriggerType getType();
public abstract boolean saveData(ClientMessage packet);
2019-05-26 20:14:53 +02:00
protected int getDelay() {
return this.delay;
2018-07-06 15:30:00 +02:00
}
2019-05-26 20:14:53 +02:00
protected void setDelay(int value) {
this.delay = value;
2018-07-06 15:30:00 +02:00
}
2019-05-26 20:14:53 +02:00
public boolean isTriggeredByRoomUnit() {
2018-07-06 15:30:00 +02:00
return false;
}
}