mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Update InteractionTrap.java
This commit is contained in:
parent
2aace7ef9a
commit
b087b8ace9
@ -22,7 +22,8 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
if (!this.getExtradata().equals("0")) {
|
if (this.getExtradata().equals("0") || roomUnit == null || room.getHabbo(roomUnit) == null) return;
|
||||||
|
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
int effect = habbo.getClient().getHabbo().getRoomUnit().getEffectId();
|
int effect = habbo.getClient().getHabbo().getRoomUnit().getEffectId();
|
||||||
roomUnit.stopWalking();
|
roomUnit.stopWalking();
|
||||||
@ -33,11 +34,9 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
delay = 3000;
|
delay = 3000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roomUnit != null) {
|
|
||||||
if (this.getBaseItem().getEffectF() > 0 || this.getBaseItem().getEffectM() > 0) {
|
if (this.getBaseItem().getEffectF() > 0 || this.getBaseItem().getEffectM() > 0) {
|
||||||
if (roomUnit.getRoomUnitType().equals(RoomUnitType.USER)) {
|
if (roomUnit.getRoomUnitType().equals(RoomUnitType.USER)) {
|
||||||
|
|
||||||
if (habbo != null) {
|
|
||||||
if (habbo.getHabboInfo().getGender().equals(HabboGender.M) && this.getBaseItem().getEffectM() > 0 && habbo.getRoomUnit().getEffectId() != this.getBaseItem().getEffectM()) {
|
if (habbo.getHabboInfo().getGender().equals(HabboGender.M) && this.getBaseItem().getEffectM() > 0 && habbo.getRoomUnit().getEffectId() != this.getBaseItem().getEffectM()) {
|
||||||
room.giveEffect(habbo, this.getBaseItem().getEffectM(), -1);
|
room.giveEffect(habbo, this.getBaseItem().getEffectM(), -1);
|
||||||
return;
|
return;
|
||||||
@ -55,11 +54,9 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
roomUnit.setCanWalk(true);
|
roomUnit.setCanWalk(true);
|
||||||
room.giveEffect(roomUnit, effect, -1);
|
room.giveEffect(roomUnit, effect, -1);
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user