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

52 lines
1.6 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.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
import java.sql.ResultSet;
import java.sql.SQLException;
2019-05-26 20:14:53 +02:00
public class InteractionPyramid extends InteractionGate {
2018-07-06 15:30:00 +02:00
private int nextChange;
2019-05-26 20:14:53 +02:00
public InteractionPyramid(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
public InteractionPyramid(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);
}
2019-05-26 20:14:53 +02:00
public void change(Room room) {
if (!(this.getExtradata().equals("0") || this.getExtradata().equals("1")))
2018-07-06 15:30:00 +02:00
this.setExtradata("0");
2019-05-26 20:14:53 +02:00
if (room != null) {
if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) {
2018-07-06 15:30:00 +02:00
int state = Integer.valueOf(this.getExtradata());
state = Math.abs(state - 1);
this.setExtradata(state + "");
room.updateItemState(this);
this.nextChange = Emulator.getIntUnixTimestamp() + 1 + (Emulator.getRandom().nextInt(Emulator.getConfig().getInt("pyramids.max.delay")));
}
}
}
2019-05-26 20:14:53 +02:00
public int getNextChange() {
2018-07-06 15:30:00 +02:00
return this.nextChange;
}
@Override
2019-05-26 20:14:53 +02:00
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
2018-07-06 15:30:00 +02:00
}
2018-10-07 00:28:00 +02:00
@Override
2019-05-26 20:14:53 +02:00
public boolean isUsable() {
2018-10-07 00:28:00 +02:00
return false;
}
2018-07-06 15:30:00 +02:00
}