Removed Custom Wired. See Custom Wired Plugin to re-add these.

This commit is contained in:
KrewsOrg 2020-04-07 13:43:59 +01:00
parent 1ea86cb528
commit 629a2d2abe
32 changed files with 0 additions and 2032 deletions

View File

@ -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));

View File

@ -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() {
}
}

View File

@ -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() {
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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() {
}
}

View File

@ -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() {
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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<Integer> invalidTriggers = new ArrayList<>();
room.getRoomSpecialTypes().getTriggers(this.getX(), this.getY()).forEach(new TObjectProcedure<InteractionWiredTrigger>() {
@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);
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}