You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
🆕 Effect selection in user dropdown
This commit is contained in:
+18
-2
@@ -1,14 +1,30 @@
|
|||||||
package com.eu.habbo.messages.incoming.users;
|
package com.eu.habbo.messages.incoming.users;
|
||||||
|
|
||||||
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
|
|
||||||
public class ActivateEffectEvent extends MessageHandler {
|
public class ActivateEffectEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() throws Exception {
|
public void handle() throws Exception {
|
||||||
int effectId = this.packet.readInt();
|
int effectId = this.packet.readInt();
|
||||||
|
Habbo habbo = this.client.getHabbo();
|
||||||
|
if (habbo == null) return;
|
||||||
|
|
||||||
if (this.client.getHabbo().getInventory().getEffectsComponent().ownsEffect(effectId)) {
|
if (habbo.getInventory().getEffectsComponent().ownsEffect(effectId)) {
|
||||||
this.client.getHabbo().getInventory().getEffectsComponent().activateEffect(effectId);
|
habbo.getInventory().getEffectsComponent().activateEffect(effectId);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int rankId = habbo.getHabboInfo().getRank().getId();
|
||||||
|
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, rankId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Room room = habbo.getHabboInfo().getCurrentRoom();
|
||||||
|
if (room == null || habbo.getHabboInfo().getRiding() != null) return;
|
||||||
|
|
||||||
|
room.giveEffect(habbo, effectId, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user