From 629a2d2abe5cd5b62f4fee158601ed9932aaca4d Mon Sep 17 00:00:00 2001 From: KrewsOrg Date: Tue, 7 Apr 2020 13:43:59 +0100 Subject: [PATCH] Removed Custom Wired. See Custom Wired Plugin to re-add these. --- .../habbo/habbohotel/items/ItemManager.java | 32 ---- .../WiredConditionBattleBanzaiGameActive.java | 74 -------- .../WiredConditionFreezeGameActive.java | 74 -------- .../WiredConditionHabboHasCredits.java | 30 ---- .../WiredConditionHabboHasDiamonds.java | 30 ---- .../WiredConditionHabboHasDuckets.java | 30 ---- .../WiredConditionHabboHasRank.java | 40 ----- .../WiredConditionHabboIsDancing.java | 30 ---- .../WiredConditionHabboNotRank.java | 40 ----- .../WiredConditionHabboOwnsBadge.java | 30 ---- .../WiredConditionMottoContains.java | 84 --------- ...redConditionNotBattleBanzaiGameActive.java | 74 -------- .../WiredConditionNotFreezeGameActive.java | 74 -------- .../WiredConditionNotHabboHasCredits.java | 30 ---- .../WiredConditionNotHabboHasDiamonds.java | 30 ---- .../WiredConditionNotHabboHasDuckets.java | 29 ---- .../WiredConditionNotHabboIsDancing.java | 30 ---- .../WiredConditionNotHabboOwnsBadge.java | 30 ---- .../effects/WiredEffectForwardToRoom.java | 41 ----- .../effects/WiredEffectGiveAchievement.java | 164 ------------------ .../wired/effects/WiredEffectGiveBadge.java | 132 -------------- .../wired/effects/WiredEffectGiveCredits.java | 131 -------------- .../effects/WiredEffectGiveDiamonds.java | 147 ---------------- .../wired/effects/WiredEffectGiveDuckets.java | 133 -------------- .../effects/WiredEffectMatchFurniStaff.java | 18 -- .../effects/WiredEffectOpenHabboPages.java | 31 ---- .../wired/effects/WiredEffectRollerSpeed.java | 118 ------------- .../wired/triggers/WiredTriggerHabboIdle.java | 76 -------- .../WiredTriggerHabboSaysCommand.java | 116 ------------- .../WiredTriggerHabboStartsDancing.java | 29 ---- .../WiredTriggerHabboStopsDancing.java | 29 ---- .../triggers/WiredTriggerHabboUnidle.java | 76 -------- 32 files changed, 2032 deletions(-) delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionBattleBanzaiGameActive.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFreezeGameActive.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasCredits.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDiamonds.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDuckets.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasRank.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboIsDancing.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboNotRank.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboOwnsBadge.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMottoContains.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotBattleBanzaiGameActive.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFreezeGameActive.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasCredits.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDiamonds.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDuckets.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboIsDancing.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboOwnsBadge.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectForwardToRoom.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveAchievement.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveBadge.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveCredits.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDiamonds.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDuckets.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurniStaff.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectOpenHabboPages.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectRollerSpeed.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboIdle.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysCommand.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStartsDancing.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStopsDancing.java delete mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboUnidle.java diff --git a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java index dbfea5f1..85c15810 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java @@ -197,12 +197,7 @@ public class ItemManager { this.interactionsList.add(new ItemInteraction("wf_trg_game_ends", WiredTriggerGameEnds.class)); this.interactionsList.add(new ItemInteraction("wf_trg_bot_reached_stf", WiredTriggerBotReachedFurni.class)); this.interactionsList.add(new ItemInteraction("wf_trg_bot_reached_avtr", WiredTriggerBotReachedHabbo.class)); - this.interactionsList.add(new ItemInteraction("wf_trg_says_command", WiredTriggerHabboSaysCommand.class)); this.interactionsList.add(new ItemInteraction("wf_trg_score_achieved", WiredTriggerScoreAchieved.class)); - this.interactionsList.add(new ItemInteraction("wf_trg_idles", WiredTriggerHabboIdle.class)); - this.interactionsList.add(new ItemInteraction("wf_trg_unidles", WiredTriggerHabboUnidle.class)); - this.interactionsList.add(new ItemInteraction("wf_trg_starts_dancing", WiredTriggerHabboStartsDancing.class)); - this.interactionsList.add(new ItemInteraction("wf_trg_stops_dancing", WiredTriggerHabboStopsDancing.class)); this.interactionsList.add(new ItemInteraction("wf_trg_game_team_win", WiredTriggerTeamWins.class)); this.interactionsList.add(new ItemInteraction("wf_trg_game_team_lose", WiredTriggerTeamLoses.class)); @@ -233,22 +228,12 @@ public class ItemManager { this.interactionsList.add(new ItemInteraction("wf_act_bot_follow_avatar", WiredEffectBotFollowHabbo.class)); this.interactionsList.add(new ItemInteraction("wf_act_bot_clothes", WiredEffectBotClothes.class)); this.interactionsList.add(new ItemInteraction("wf_act_bot_talk_to_avatar", WiredEffectBotTalkToHabbo.class)); - this.interactionsList.add(new ItemInteraction("wf_act_give_diamonds", WiredEffectGiveDiamonds.class)); - this.interactionsList.add(new ItemInteraction("wf_act_give_credits", WiredEffectGiveCredits.class)); - this.interactionsList.add(new ItemInteraction("wf_act_give_duckets", WiredEffectGiveDuckets.class)); - this.interactionsList.add(new ItemInteraction("wf_act_give_badge", WiredEffectGiveBadge.class)); - this.interactionsList.add(new ItemInteraction("wf_act_forward_user", WiredEffectForwardToRoom.class)); - this.interactionsList.add(new ItemInteraction("wf_act_roller_speed", WiredEffectRollerSpeed.class)); this.interactionsList.add(new ItemInteraction("wf_act_raise_furni", WiredEffectRaiseFurni.class)); this.interactionsList.add(new ItemInteraction("wf_act_lower_furni", WiredEffectLowerFurni.class)); this.interactionsList.add(new ItemInteraction("wf_act_give_respect", WiredEffectGiveRespect.class)); this.interactionsList.add(new ItemInteraction("wf_act_alert", WiredEffectAlert.class)); this.interactionsList.add(new ItemInteraction("wf_act_give_handitem", WiredEffectGiveHandItem.class)); - this.interactionsList.add(new ItemInteraction("wf_act_match_to_sshot2", WiredEffectMatchFurniStaff.class)); this.interactionsList.add(new ItemInteraction("wf_act_give_effect", WiredEffectGiveEffect.class)); - this.interactionsList.add(new ItemInteraction("wf_act_open_habbo_pages", WiredEffectOpenHabboPages.class)); - this.interactionsList.add(new ItemInteraction("wf_act_give_achievement", WiredEffectGiveAchievement.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_has_furni_on", WiredConditionFurniHaveFurni.class)); this.interactionsList.add(new ItemInteraction("wf_cnd_furnis_hv_avtrs", WiredConditionFurniHaveHabbo.class)); @@ -274,23 +259,6 @@ public class ItemManager { this.interactionsList.add(new ItemInteraction("wf_cnd_trggrer_on_frn", WiredConditionTriggerOnFurni.class)); this.interactionsList.add(new ItemInteraction("wf_cnd_has_handitem", WiredConditionHabboHasHandItem.class)); this.interactionsList.add(new ItemInteraction("wf_cnd_date_rng_active", WiredConditionDateRangeActive.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_motto_contains", WiredConditionMottoContains.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_battlebanzai", WiredConditionBattleBanzaiGameActive.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_battlebanzai", WiredConditionNotBattleBanzaiGameActive.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_freeze", WiredConditionFreezeGameActive.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_freeze", WiredConditionNotFreezeGameActive.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_has_rank", WiredConditionHabboHasRank.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_not_rank", WiredConditionHabboNotRank.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_has_diamonds", WiredConditionHabboHasDiamonds.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_has_credits", WiredConditionHabboHasCredits.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_has_duckets", WiredConditionHabboHasDuckets.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_habbo_has_diamonds", WiredConditionNotHabboHasDiamonds.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_habbo_has_credits", WiredConditionNotHabboHasCredits.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_habbo_has_duckets", WiredConditionNotHabboHasDuckets.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_owns_badge", WiredConditionHabboOwnsBadge.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_habbo_owns_badge", WiredConditionNotHabboOwnsBadge.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_habbo_is_dancing", WiredConditionHabboIsDancing.class)); - this.interactionsList.add(new ItemInteraction("wf_cnd_not_habbo_is_dancing", WiredConditionNotHabboIsDancing.class)); this.interactionsList.add(new ItemInteraction("wf_xtra_random", WiredExtraRandom.class)); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionBattleBanzaiGameActive.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionBattleBanzaiGameActive.java deleted file mode 100644 index f65b7dfc..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionBattleBanzaiGameActive.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.games.Game; -import com.eu.habbo.habbohotel.games.GameState; -import com.eu.habbo.habbohotel.games.battlebanzai.BattleBanzaiGame; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionBattleBanzaiGameActive extends InteractionWiredCondition { - public static final WiredConditionType type = WiredConditionType.ACTOR_IN_GROUP; - - public WiredConditionBattleBanzaiGameActive(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionBattleBanzaiGameActive(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredConditionType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Game game = room.getGame(BattleBanzaiGame.class); - - return game != null && game.state.equals(GameState.RUNNING); - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFreezeGameActive.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFreezeGameActive.java deleted file mode 100644 index 62009610..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFreezeGameActive.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.games.Game; -import com.eu.habbo.habbohotel.games.GameState; -import com.eu.habbo.habbohotel.games.freeze.FreezeGame; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionFreezeGameActive extends InteractionWiredCondition { - public static final WiredConditionType type = WiredConditionType.ACTOR_IN_GROUP; - - public WiredConditionFreezeGameActive(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionFreezeGameActive(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredConditionType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Game game = room.getGame(FreezeGame.class); - - return game != null && game.state.equals(GameState.RUNNING); - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasCredits.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasCredits.java deleted file mode 100644 index 78e52e31..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasCredits.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboHasCredits extends WiredConditionHabboHasEffect { - public WiredConditionHabboHasCredits(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboHasCredits(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getCredits() >= this.effectId; - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDiamonds.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDiamonds.java deleted file mode 100644 index 41103b76..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDiamonds.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboHasDiamonds extends WiredConditionHabboHasEffect { - public WiredConditionHabboHasDiamonds(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboHasDiamonds(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getCurrencyAmount(5) >= this.effectId; - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDuckets.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDuckets.java deleted file mode 100644 index f6f7b66f..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasDuckets.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboHasDuckets extends WiredConditionHabboHasEffect { - public WiredConditionHabboHasDuckets(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboHasDuckets(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getPixels() >= this.effectId; - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasRank.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasRank.java deleted file mode 100644 index ecf2bc01..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasRank.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredConditionOperator; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboHasRank extends WiredConditionHabboWearsBadge { - public WiredConditionHabboHasRank(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboHasRank(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - try { - return habbo.getHabboInfo().getRank().getId() == Integer.valueOf(this.badge); - } catch (Exception e) { - return false; - } - } - - return false; - } - - @Override - public WiredConditionOperator operator() { - return WiredConditionOperator.OR; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboIsDancing.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboIsDancing.java deleted file mode 100644 index 0c706e6e..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboIsDancing.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.DanceType; -import com.eu.habbo.habbohotel.wired.WiredConditionOperator; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboIsDancing extends WiredConditionGroupMember { - public WiredConditionHabboIsDancing(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboIsDancing(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return roomUnit != null && roomUnit.getDanceType() != DanceType.NONE; - } - - @Override - public WiredConditionOperator operator() { - return WiredConditionOperator.OR; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboNotRank.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboNotRank.java deleted file mode 100644 index 8364e356..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboNotRank.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredConditionOperator; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboNotRank extends WiredConditionHabboWearsBadge { - public WiredConditionHabboNotRank(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboNotRank(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - try { - return habbo.getHabboInfo().getRank().getId() != Integer.valueOf(this.badge); - } catch (Exception e) { - return false; - } - } - - return false; - } - - @Override - public WiredConditionOperator operator() { - return WiredConditionOperator.OR; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboOwnsBadge.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboOwnsBadge.java deleted file mode 100644 index bd7e192a..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboOwnsBadge.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionHabboOwnsBadge extends WiredConditionHabboWearsBadge { - public WiredConditionHabboOwnsBadge(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionHabboOwnsBadge(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getInventory().getBadgesComponent().hasBadge(this.badge); - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMottoContains.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMottoContains.java deleted file mode 100644 index 26bd7e9e..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMottoContains.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredConditionOperator; -import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionMottoContains extends InteractionWiredCondition { - public static final WiredConditionType type = WiredConditionType.ACTOR_WEARS_BADGE; - - private String motto = ""; - - public WiredConditionMottoContains(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionMottoContains(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - return habbo != null && habbo.getHabboInfo().getMotto().contains(this.motto); - } - - @Override - public String getWiredData() { - return this.motto; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - this.motto = set.getString("wired_data"); - } - - @Override - public void onPickUp() { - this.motto = ""; - } - - @Override - public WiredConditionType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.motto); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - packet.readInt(); - - this.motto = packet.readString(); - - return true; - } - - @Override - public WiredConditionOperator operator() { - return WiredConditionOperator.OR; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotBattleBanzaiGameActive.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotBattleBanzaiGameActive.java deleted file mode 100644 index 06e1c102..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotBattleBanzaiGameActive.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.games.Game; -import com.eu.habbo.habbohotel.games.GameState; -import com.eu.habbo.habbohotel.games.battlebanzai.BattleBanzaiGame; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotBattleBanzaiGameActive extends InteractionWiredCondition { - public static final WiredConditionType type = WiredConditionType.NOT_ACTOR_IN_GROUP; - - public WiredConditionNotBattleBanzaiGameActive(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotBattleBanzaiGameActive(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredConditionType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Game game = room.getGame(BattleBanzaiGame.class); - - return game == null || !game.state.equals(GameState.RUNNING); - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFreezeGameActive.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFreezeGameActive.java deleted file mode 100644 index 043a5dbd..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFreezeGameActive.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.games.Game; -import com.eu.habbo.habbohotel.games.GameState; -import com.eu.habbo.habbohotel.games.freeze.FreezeGame; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotFreezeGameActive extends InteractionWiredCondition { - public static final WiredConditionType type = WiredConditionType.NOT_ACTOR_IN_GROUP; - - public WiredConditionNotFreezeGameActive(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotFreezeGameActive(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredConditionType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Game game = room.getGame(FreezeGame.class); - - return game == null || !game.state.equals(GameState.RUNNING); - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasCredits.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasCredits.java deleted file mode 100644 index 6c322788..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasCredits.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotHabboHasCredits extends WiredConditionNotHabboHasEffect { - public WiredConditionNotHabboHasCredits(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotHabboHasCredits(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getCredits() < this.effectId; - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDiamonds.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDiamonds.java deleted file mode 100644 index ea96650f..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDiamonds.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotHabboHasDiamonds extends WiredConditionNotHabboHasEffect { - public WiredConditionNotHabboHasDiamonds(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotHabboHasDiamonds(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getCurrencyAmount(5) < this.effectId; - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDuckets.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDuckets.java deleted file mode 100644 index 98e55738..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasDuckets.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotHabboHasDuckets extends WiredConditionNotHabboHasEffect { - public WiredConditionNotHabboHasDuckets(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotHabboHasDuckets(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return habbo.getHabboInfo().getPixels() < this.effectId; - } - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboIsDancing.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboIsDancing.java deleted file mode 100644 index 81f1d7f2..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboIsDancing.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.DanceType; -import com.eu.habbo.habbohotel.wired.WiredConditionOperator; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotHabboIsDancing extends WiredConditionGroupMember { - public WiredConditionNotHabboIsDancing(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotHabboIsDancing(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return roomUnit != null && roomUnit.getDanceType() == DanceType.NONE; - } - - @Override - public WiredConditionOperator operator() { - return WiredConditionOperator.OR; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboOwnsBadge.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboOwnsBadge.java deleted file mode 100644 index 91cb8d81..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboOwnsBadge.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.conditions; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredConditionNotHabboOwnsBadge extends WiredConditionNotHabboWearsBadge { - public WiredConditionNotHabboOwnsBadge(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredConditionNotHabboOwnsBadge(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - return !habbo.getInventory().getBadgesComponent().hasBadge(this.badge); - } - - return false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectForwardToRoom.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectForwardToRoom.java deleted file mode 100644 index a1c216e3..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectForwardToRoom.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredEffectForwardToRoom extends WiredEffectWhisper { - public WiredEffectForwardToRoom(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectForwardToRoom(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo == null) - return false; - - int roomId; - - try { - roomId = Integer.valueOf(this.message); - } catch (Exception e) { - return false; - } - - if (roomId > 0) - habbo.getClient().sendResponse(new ForwardToRoomComposer(roomId)); - - return true; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveAchievement.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveAchievement.java deleted file mode 100644 index 1a45f426..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveAchievement.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.achievements.Achievement; -import com.eu.habbo.habbohotel.achievements.AchievementManager; -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectGiveAchievement extends WiredEffectGiveBadge { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - public static final String DEFAULT_CONTENT = "ach_achievement:points <- Points are optional"; - private String achievement = DEFAULT_CONTENT; - - public WiredEffectGiveAchievement(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectGiveAchievement(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(true); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.achievement + ""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - try { - this.achievement = packet.readString(); - - int points = 1; - String a = achievement; - if (a.contains(":")) { - a = achievement.split(":")[0]; - try { - points = Integer.valueOf(achievement.split(":")[1]); - } catch (Exception e) { - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("hotel.wired.giveachievement.invalid.points"), RoomChatMessageBubbles.WIRED); - } - } - - Achievement ach = Emulator.getGameEnvironment().getAchievementManager().getAchievement(a); - - if (ach == null) { - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("hotel.wired.giveachievement.invalid.achievement").replace("%achievement%", a), RoomChatMessageBubbles.WIRED); - } - } catch (Exception e) { - e.printStackTrace(); - return false; - } - - packet.readInt(); - this.setDelay(packet.readInt()); - - return true; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - if (!this.achievement.equals(DEFAULT_CONTENT)) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - int points = 1; - String a = achievement; - if (a.contains(":")) { - a = achievement.split(":")[0]; - try { - points = Integer.valueOf(achievement.split(":")[1]); - } catch (Exception e) { - return false; - } - } - - Achievement ach = Emulator.getGameEnvironment().getAchievementManager().getAchievement(a); - - if (ach != null) { - AchievementManager.progressAchievement(habbo, ach, points); - } - } - } - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.achievement; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - this.achievement = DEFAULT_CONTENT; - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - - this.achievement = data[1]; - } - } - - @Override - public void onPickUp() { - this.achievement = DEFAULT_CONTENT; - this.setDelay(0); - } - - @Override - public boolean requiresTriggeringUser() { - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveBadge.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveBadge.java deleted file mode 100644 index 1f071383..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveBadge.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.users.inventory.BadgesComponent; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.wired.WiredRewardAlertComposer; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectGiveBadge extends InteractionWiredEffect { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - private String badge = ""; - - public WiredEffectGiveBadge(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectGiveBadge(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.badge); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - this.badge = packet.readString(); - - packet.readInt(); - this.setDelay(packet.readInt()); - - return true; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo == null) - return false; - - if (this.badge.isEmpty()) - return false; - - if (habbo.getInventory().getBadgesComponent().hasBadge(this.badge)) { - habbo.getClient().sendResponse(new WiredRewardAlertComposer(WiredRewardAlertComposer.REWARD_ALREADY_RECEIVED)); - } else { - BadgesComponent.createBadge(this.badge, habbo); - habbo.getClient().sendResponse(new WiredRewardAlertComposer(WiredRewardAlertComposer.REWARD_RECEIVED_BADGE)); - } - - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.badge; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - this.badge = data[1]; - } - } - - @Override - public void onPickUp() { - this.badge = ""; - this.setDelay(0); - } - - @Override - public boolean requiresTriggeringUser() { - return true; - } -} - diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveCredits.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveCredits.java deleted file mode 100644 index d072d671..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveCredits.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectGiveCredits extends InteractionWiredEffect { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - private int credits = 0; - - public WiredEffectGiveCredits(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectGiveCredits(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(true); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.credits + ""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - try { - this.credits = Integer.valueOf(packet.readString()); - } catch (Exception e) { - return false; - } - - packet.readInt(); - this.setDelay(packet.readInt()); - - return false; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo == null) - return false; - - habbo.giveCredits(this.credits); - - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.credits; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - this.credits = 0; - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - - try { - this.credits = Integer.valueOf(data[1]); - } catch (Exception e) { - } - } - } - - @Override - public void onPickUp() { - this.credits = 0; - this.setDelay(0); - } - - @Override - public boolean requiresTriggeringUser() { - return true; - } -} - diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDiamonds.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDiamonds.java deleted file mode 100644 index dc15d8ac..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDiamonds.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.users.UserPointsComposer; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectGiveDiamonds extends InteractionWiredEffect { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - private int points = 0; - private int pointsType = -1; - - public WiredEffectGiveDiamonds(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectGiveDiamonds(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.points + (this.pointsType == -1 ? "" : ":" + this.pointsType)); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - try { - this.loadFromString(packet.readString()); - } catch (Exception e) { - return false; - } - - packet.readInt(); - this.setDelay(packet.readInt()); - - return true; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo == null) - return false; - - habbo.getHabboInfo().addCurrencyAmount(this.pointsType == -1 ? Emulator.getConfig().getInt("seasonal.primary.type") : this.pointsType, this.points); - habbo.getClient().sendResponse(new UserPointsComposer(habbo.getHabboInfo().getCurrencyAmount(this.pointsType == -1 ? Emulator.getConfig().getInt("seasonal.primary.type") : this.pointsType), this.points, Emulator.getConfig().getInt("seasonal.primary.type"))); - - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.points + (this.pointsType == -1 ? "" : ":" + this.pointsType); - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - this.points = 0; - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - - try { - this.loadFromString(data[1]); - } catch (Exception e) { - } - } - } - - @Override - public void onPickUp() { - this.points = 0; - this.setDelay(0); - } - - private void loadFromString(String data) { - String[] pointsData = data.split(":"); - - this.pointsType = -1; - if (pointsData.length >= 1) { - this.points = Integer.valueOf(pointsData[0]); - } - - if (pointsData.length == 2) { - this.pointsType = Integer.valueOf(pointsData[1]); - } - } - - @Override - public boolean requiresTriggeringUser() { - return true; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDuckets.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDuckets.java deleted file mode 100644 index 21d82d19..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveDuckets.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.users.UserPointsComposer; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectGiveDuckets extends InteractionWiredEffect { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - private int pixels = 0; - - public WiredEffectGiveDuckets(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectGiveDuckets(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.pixels + ""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - try { - this.pixels = Integer.valueOf(packet.readString()); - } catch (Exception e) { - return false; - } - - packet.readInt(); - this.setDelay(packet.readInt()); - - return true; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo == null) - return false; - - habbo.getHabboInfo().addCurrencyAmount(0, this.pixels); - habbo.getClient().sendResponse(new UserPointsComposer(habbo.getHabboInfo().getCurrencyAmount(0), this.pixels, 0)); - - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.pixels; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - this.pixels = 0; - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - - try { - this.pixels = Integer.valueOf(data[1]); - } catch (Exception e) { - } - } - } - - @Override - public void onPickUp() { - this.pixels = 0; - this.setDelay(0); - } - - @Override - public boolean requiresTriggeringUser() { - return true; - } -} - diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurniStaff.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurniStaff.java deleted file mode 100644 index 495c15fe..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurniStaff.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.items.Item; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredEffectMatchFurniStaff extends WiredEffectMatchFurni { - public WiredEffectMatchFurniStaff(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - this.checkForWiredResetPermission = false; - } - - public WiredEffectMatchFurniStaff(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - this.checkForWiredResetPermission = false; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectOpenHabboPages.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectOpenHabboPages.java deleted file mode 100644 index fe399daa..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectOpenHabboPages.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.messages.outgoing.habboway.nux.NuxAlertComposer; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredEffectOpenHabboPages extends WiredEffectWhisper { - public WiredEffectOpenHabboPages(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectOpenHabboPages(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - habbo.getClient().sendResponse(new NuxAlertComposer(this.message)); - } - - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectRollerSpeed.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectRollerSpeed.java deleted file mode 100644 index fd089c22..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectRollerSpeed.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.effects; - -import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredEffectType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import gnu.trove.procedure.TObjectProcedure; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -public class WiredEffectRollerSpeed extends InteractionWiredEffect { - public static final WiredEffectType type = WiredEffectType.SHOW_MESSAGE; - - private int speed = 4; - - public WiredEffectRollerSpeed(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredEffectRollerSpeed(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(0); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.speed + ""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(this.getDelay()); - - if (this.requiresTriggeringUser()) { - List invalidTriggers = new ArrayList<>(); - room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure() { - @Override - public boolean execute(InteractionWiredTrigger object) { - if (!object.isTriggeredByRoomUnit()) { - invalidTriggers.add(object.getBaseItem().getSpriteId()); - } - return true; - } - }); - message.appendInt(invalidTriggers.size()); - for (Integer i : invalidTriggers) { - message.appendInt(i); - } - } else { - message.appendInt(0); - } - } - - @Override - public boolean saveData(ClientMessage packet, GameClient gameClient) { - packet.readInt(); - - try { - this.speed = Integer.valueOf(packet.readString()); - } catch (Exception e) { - return false; - } - packet.readInt(); - this.setDelay(packet.readInt()); - - return true; - } - - @Override - public WiredEffectType getType() { - return type; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - room.setRollerSpeed(this.speed); - - return true; - } - - @Override - public String getWiredData() { - return this.getDelay() + "\t" + this.speed; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String wireData = set.getString("wired_data"); - String[] data = wireData.split("\t"); - this.speed = 0; - - if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); - - try { - this.speed = Integer.valueOf(data[1]); - } catch (Exception e) { - } - } - } - - @Override - public void onPickUp() { - this.speed = 4; - this.setDelay(0); - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboIdle.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboIdle.java deleted file mode 100644 index e1e96145..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboIdle.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.triggers; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredTriggerHabboIdle extends InteractionWiredTrigger { - private static final WiredTriggerType type = WiredTriggerType.IDLES; - - public WiredTriggerHabboIdle(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredTriggerHabboIdle(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return stuff.length > 0 && stuff[0] instanceof Habbo; - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } - - @Override - public WiredTriggerType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(WiredHandler.MAXIMUM_FURNI_SELECTION); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean isTriggeredByRoomUnit() { - return true; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysCommand.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysCommand.java deleted file mode 100644 index c0cc60d8..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysCommand.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.triggers; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomChatMessage; -import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredTriggerHabboSaysCommand extends InteractionWiredTrigger { - private static final WiredTriggerType type = WiredTriggerType.SAY_COMMAND; - - private boolean ownerOnly = false; - private String key = ""; - - public WiredTriggerHabboSaysCommand(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredTriggerHabboSaysCommand(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - Habbo habbo = room.getHabbo(roomUnit); - - if (habbo != null) { - if (this.key.length() > 0) { - if (stuff[0] instanceof String) { - if (((String) stuff[0]).replace(":", "").startsWith(this.key + " ")) { - if (this.ownerOnly && room.getOwnerId() != habbo.getHabboInfo().getId()) - return false; - - habbo.getClient().sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(this.key, habbo, habbo, RoomChatMessageBubbles.ALERT))); - - return true; - } - } - } - } - return false; - } - - @Override - public String getWiredData() { - return (this.ownerOnly ? "1" : "0") + "\t" + this.key; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - String[] data = set.getString("wired_data").split("\t"); - - if (data.length == 2) { - this.ownerOnly = data[0].equalsIgnoreCase("1"); - this.setKey(data[1]); - } - } - - @Override - public void onPickUp() { - this.ownerOnly = false; - this.key = ""; - } - - @Override - public WiredTriggerType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(5); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(this.key); - message.appendInt(0); - message.appendInt(1); - message.appendInt(this.getType().code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - packet.readInt(); - this.ownerOnly = packet.readInt() == 1; - setKey(packet.readString()); - - - return true; - } - - private void setKey(String key) { - if (key.contains(":")) { - key = key.replaceAll(":", ""); - } - - this.key = key; - } - - @Override - public boolean isTriggeredByRoomUnit() { - return true; - } -} diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStartsDancing.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStartsDancing.java deleted file mode 100644 index f3622f82..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStartsDancing.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.triggers; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredTriggerHabboStartsDancing extends WiredTriggerCollision { - public WiredTriggerHabboStartsDancing(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredTriggerHabboStartsDancing(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredTriggerType getType() { - return WiredTriggerType.STARTS_DANCING; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStopsDancing.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStopsDancing.java deleted file mode 100644 index cea8333c..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboStopsDancing.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.triggers; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredTriggerHabboStopsDancing extends WiredTriggerCollision { - public WiredTriggerHabboStopsDancing(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredTriggerHabboStopsDancing(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public WiredTriggerType getType() { - return WiredTriggerType.STOPS_DANCING; - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return true; - } -} \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboUnidle.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboUnidle.java deleted file mode 100644 index e058b1e3..00000000 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboUnidle.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.eu.habbo.habbohotel.items.interactions.wired.triggers; - -import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; -import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; -import com.eu.habbo.messages.ServerMessage; - -import java.sql.ResultSet; -import java.sql.SQLException; - -public class WiredTriggerHabboUnidle extends InteractionWiredTrigger { - private static final WiredTriggerType type = WiredTriggerType.UNIDLES; - - public WiredTriggerHabboUnidle(ResultSet set, Item baseItem) throws SQLException { - super(set, baseItem); - } - - public WiredTriggerHabboUnidle(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { - super(id, userId, item, extradata, limitedStack, limitedSells); - } - - @Override - public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { - return stuff.length > 0 && stuff[0] instanceof Habbo; - } - - @Override - public String getWiredData() { - return ""; - } - - @Override - public void loadWiredData(ResultSet set, Room room) throws SQLException { - - } - - @Override - public void onPickUp() { - - } - - @Override - public WiredTriggerType getType() { - return type; - } - - @Override - public void serializeWiredData(ServerMessage message, Room room) { - message.appendBoolean(false); - message.appendInt(WiredHandler.MAXIMUM_FURNI_SELECTION); - message.appendInt(0); - message.appendInt(this.getBaseItem().getSpriteId()); - message.appendInt(this.getId()); - message.appendString(""); - message.appendInt(0); - message.appendInt(0); - message.appendInt(type.code); - message.appendInt(0); - message.appendInt(0); - } - - @Override - public boolean saveData(ClientMessage packet) { - return true; - } - - @Override - public boolean isTriggeredByRoomUnit() { - return true; - } -} \ No newline at end of file