You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
+18
-2
@@ -1,14 +1,30 @@
|
||||
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;
|
||||
|
||||
public class ActivateEffectEvent extends MessageHandler {
|
||||
@Override
|
||||
public void handle() throws Exception {
|
||||
int effectId = this.packet.readInt();
|
||||
Habbo habbo = this.client.getHabbo();
|
||||
if (habbo == null) return;
|
||||
|
||||
if (this.client.getHabbo().getInventory().getEffectsComponent().ownsEffect(effectId)) {
|
||||
this.client.getHabbo().getInventory().getEffectsComponent().activateEffect(effectId);
|
||||
if (habbo.getInventory().getEffectsComponent().ownsEffect(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