mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 04:12:37 +01:00
Add forced GiveEffect
This commit is contained in:
parent
27619f484f
commit
7ed20f1386
@ -4161,27 +4161,34 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveEffect(Habbo habbo, int effectId, int duration) {
|
public void giveEffect(Habbo habbo, int effectId, int duration, boolean ignoreChecks) {
|
||||||
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
||||||
this.giveEffect(habbo.getRoomUnit(), effectId, duration);
|
this.giveEffect(habbo.getRoomUnit(), effectId, duration, ignoreChecks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void giveEffect(Habbo habbo, int effectId, int duration) {
|
||||||
|
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
||||||
|
this.giveEffect(habbo.getRoomUnit(), effectId, duration, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
|
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
|
||||||
|
this.giveEffect(roomUnit, effectId, duration, false);
|
||||||
|
}
|
||||||
|
public void giveEffect(RoomUnit roomUnit, int effectId, int duration, boolean ignoreChecks) {
|
||||||
if (roomUnit == null || roomUnit.getRoom() == null) return;
|
if (roomUnit == null || roomUnit.getRoom() == null) return;
|
||||||
|
|
||||||
Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit);
|
Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit);
|
||||||
|
|
||||||
if (habbo == null) return;
|
if (habbo == null) return;
|
||||||
|
|
||||||
if (!habbo.getHabboInfo().isInGame()) {
|
if (!habbo.getHabboInfo().isInGame() || ignoreChecks) {
|
||||||
if (duration == -1 || duration == Integer.MAX_VALUE) {
|
if (duration == -1 || duration == Integer.MAX_VALUE) {
|
||||||
duration = Integer.MAX_VALUE;
|
duration = Integer.MAX_VALUE;
|
||||||
} else {
|
} else {
|
||||||
duration += Emulator.getIntUnixTimestamp();
|
duration += Emulator.getIntUnixTimestamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.allowEffects && !roomUnit.isSwimming) {
|
if ((this.allowEffects || ignoreChecks) && !roomUnit.isSwimming) {
|
||||||
roomUnit.setEffectId(effectId, duration);
|
roomUnit.setEffectId(effectId, duration);
|
||||||
this.sendComposer(new AvatarEffectMessageComposer(roomUnit).compose());
|
this.sendComposer(new AvatarEffectMessageComposer(roomUnit).compose());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user