mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
257f9598db
@ -31,6 +31,8 @@ When making an bug report or a feature request use the template we provide so th
|
|||||||
- Harmonic
|
- Harmonic
|
||||||
- Beny
|
- Beny
|
||||||
- Claudio
|
- Claudio
|
||||||
|
- Alejandro
|
||||||
|
- Harmony
|
||||||
|
|
||||||
## Discord ##
|
## Discord ##
|
||||||
Join us on Discord at https://discord.gg/BzfFsTp
|
Join us on Discord at https://discord.gg/BzfFsTp
|
||||||
|
@ -8,4 +8,13 @@ ADD COLUMN `build_hash` varchar(64) NOT NULL AFTER `version`;
|
|||||||
|
|
||||||
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('scripter.modtool.tickets', '1');
|
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('scripter.modtool.tickets', '1');
|
||||||
|
|
||||||
|
ALTER TABLE `items_crackable`
|
||||||
|
ADD COLUMN `subscription_duration` int(3) NULL AFTER `required_effect`,
|
||||||
|
ADD COLUMN `subscription_type` varchar(255) NULL COMMENT 'hc for Habbo Club, bc for Builders Club' AFTER `subscription_duration`;
|
||||||
|
|
||||||
|
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('invisible.prevent.chat', '0');
|
||||||
|
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('invisible.prevent.chat.error', 'While being invisible you cannot talk.');
|
||||||
|
|
||||||
|
INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('commands.succes.cmd_invisible.updated.back', 'You are now visible again.');
|
||||||
|
|
||||||
#END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3
|
#END DATABASE UPDATE: 2.0.0 RC-2 -> 2.0.0 RC-3
|
@ -2,8 +2,17 @@ package com.eu.habbo.habbohotel.commands;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
|
||||||
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
|
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserRemoveComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
|
||||||
|
import com.eu.habbo.threading.runnables.RoomUnitTeleport;
|
||||||
|
|
||||||
public class InvisibleCommand extends Command
|
public class InvisibleCommand extends Command
|
||||||
{
|
{
|
||||||
@ -17,10 +26,27 @@ public class InvisibleCommand extends Command
|
|||||||
{
|
{
|
||||||
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
|
RoomUnit roomUnit = gameClient.getHabbo().getRoomUnit();
|
||||||
|
|
||||||
|
if (roomUnit.isInvisible()) {
|
||||||
|
RoomLayout roomLayout = roomUnit.getRoom().getLayout();
|
||||||
|
|
||||||
|
new RoomUnitTeleport(roomUnit, roomUnit.getRoom(), roomLayout.getDoorTile().x, roomLayout.getDoorTile().y, roomLayout.getDoorTile().z, 0).run();
|
||||||
|
|
||||||
|
roomUnit.setInvisible(false);
|
||||||
|
roomUnit.setInRoom(true);
|
||||||
|
|
||||||
|
roomUnit.getRoom().sendComposer(new RoomUsersComposer(gameClient.getHabbo()).compose());
|
||||||
|
roomUnit.getRoom().sendComposer(new RoomUserStatusComposer(roomUnit).compose());
|
||||||
|
|
||||||
|
WiredHandler.handle(WiredTriggerType.ENTER_ROOM, roomUnit, roomUnit.getRoom(), null);
|
||||||
|
roomUnit.getRoom().habboEntered(gameClient.getHabbo());
|
||||||
|
|
||||||
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated.back"));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
roomUnit.setInvisible(true);
|
roomUnit.setInvisible(true);
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_invisible.updated"));
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
|
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserRemoveComposer(roomUnit).compose());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -17,6 +17,8 @@ public class CrackableReward
|
|||||||
public final String achievementTick;
|
public final String achievementTick;
|
||||||
public final String achievementCracked;
|
public final String achievementCracked;
|
||||||
public final int requiredEffect;
|
public final int requiredEffect;
|
||||||
|
public final int subscriptionDuration;
|
||||||
|
public final RedeemableSubscriptionType subscriptionType;
|
||||||
|
|
||||||
public CrackableReward(ResultSet set) throws SQLException
|
public CrackableReward(ResultSet set) throws SQLException
|
||||||
{
|
{
|
||||||
@ -25,10 +27,15 @@ public class CrackableReward
|
|||||||
this.achievementTick = set.getString("achievement_tick");
|
this.achievementTick = set.getString("achievement_tick");
|
||||||
this.achievementCracked = set.getString("achievement_cracked");
|
this.achievementCracked = set.getString("achievement_cracked");
|
||||||
this.requiredEffect = set.getInt("required_effect");
|
this.requiredEffect = set.getInt("required_effect");
|
||||||
|
this.subscriptionDuration = set.getInt("subscription_duration");
|
||||||
|
this.subscriptionType = RedeemableSubscriptionType.fromString(set.getString("subscription_type"));
|
||||||
|
|
||||||
|
|
||||||
String[] prizes = set.getString("prizes").split(";");
|
String[] prizes = set.getString("prizes").split(";");
|
||||||
this.prizes = new HashMap<>();
|
this.prizes = new HashMap<>();
|
||||||
|
|
||||||
|
if (set.getString("prizes").isEmpty()) return;
|
||||||
|
|
||||||
this.totalChance = 0;
|
this.totalChance = 0;
|
||||||
for (String prize : prizes)
|
for (String prize : prizes)
|
||||||
{
|
{
|
||||||
@ -59,6 +66,8 @@ public class CrackableReward
|
|||||||
|
|
||||||
public int getRandomReward()
|
public int getRandomReward()
|
||||||
{
|
{
|
||||||
|
if (this.prizes.size() == 0) return 0;
|
||||||
|
|
||||||
int random = Emulator.getRandom().nextInt(this.totalChance);
|
int random = Emulator.getRandom().nextInt(this.totalChance);
|
||||||
|
|
||||||
int notFound = 0;
|
int notFound = 0;
|
||||||
|
@ -175,6 +175,7 @@ public class ItemManager
|
|||||||
this.interactionsList.add(new ItemInteraction("timer", InteractionGameTimer.class));
|
this.interactionsList.add(new ItemInteraction("timer", InteractionGameTimer.class));
|
||||||
this.interactionsList.add(new ItemInteraction("pressureplate_group", InteractionGroupPressurePlate.class));
|
this.interactionsList.add(new ItemInteraction("pressureplate_group", InteractionGroupPressurePlate.class));
|
||||||
this.interactionsList.add(new ItemInteraction("effect_tile_group", InteractionEffectTile.class));
|
this.interactionsList.add(new ItemInteraction("effect_tile_group", InteractionEffectTile.class));
|
||||||
|
this.interactionsList.add(new ItemInteraction("crackable_subscription_box", InteractionRedeemableSubscriptionBox.class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.eu.habbo.habbohotel.items;
|
||||||
|
|
||||||
|
public enum RedeemableSubscriptionType {
|
||||||
|
HABBO_CLUB("hc"),
|
||||||
|
BUILDERS_CLUB("bc");
|
||||||
|
|
||||||
|
public final String subscriptionType;
|
||||||
|
|
||||||
|
RedeemableSubscriptionType(String subscriptionType)
|
||||||
|
{
|
||||||
|
this.subscriptionType = subscriptionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RedeemableSubscriptionType fromString(String subscriptionType) {
|
||||||
|
if (subscriptionType == null) return null;
|
||||||
|
|
||||||
|
switch (subscriptionType) {
|
||||||
|
case "hc":
|
||||||
|
return HABBO_CLUB;
|
||||||
|
case "bc":
|
||||||
|
return BUILDERS_CLUB;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,8 @@ import com.eu.habbo.habbohotel.users.Habbo;
|
|||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
|
import com.eu.habbo.messages.outgoing.users.UserClubComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.users.UserPermissionsComposer;
|
||||||
import com.eu.habbo.threading.runnables.CrackableExplode;
|
import com.eu.habbo.threading.runnables.CrackableExplode;
|
||||||
import com.eu.habbo.util.pathfinding.Rotation;
|
import com.eu.habbo.util.pathfinding.Rotation;
|
||||||
|
|
||||||
@ -77,7 +79,7 @@ public class InteractionCrackable extends HabboItem
|
|||||||
if (this.cracked)
|
if (this.cracked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (client.getHabbo().getRoomUnit().getCurrentLocation().distance(room.getLayout().getTile(this.getX(), this.getY())) > 1.5)
|
if (this.userRequiredToBeAdjacent() && client.getHabbo().getRoomUnit().getCurrentLocation().distance(room.getLayout().getTile(this.getX(), this.getY())) > 1.5)
|
||||||
{
|
{
|
||||||
client.getHabbo().getRoomUnit().setGoalLocation(room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), Rotation.Calculate(client.getHabbo().getRoomUnit().getX(), client.getHabbo().getRoomUnit().getY(), this.getX(), this.getY())));
|
client.getHabbo().getRoomUnit().setGoalLocation(room.getLayout().getTileInFront(room.getLayout().getTile(this.getX(), this.getY()), Rotation.Calculate(client.getHabbo().getRoomUnit().getX(), client.getHabbo().getRoomUnit().getY(), this.getX(), this.getY())));
|
||||||
return;
|
return;
|
||||||
@ -129,6 +131,24 @@ public class InteractionCrackable extends HabboItem
|
|||||||
{
|
{
|
||||||
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement(rewardData.achievementCracked));
|
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement(rewardData.achievementCracked));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rewardData.subscriptionType != null && rewardData.subscriptionDuration > 0) {
|
||||||
|
// subscriptions are given immediately upon cracking
|
||||||
|
switch (rewardData.subscriptionType) {
|
||||||
|
case HABBO_CLUB:
|
||||||
|
if (habbo.getHabboStats().getClubExpireTimestamp() <= Emulator.getIntUnixTimestamp())
|
||||||
|
habbo.getHabboStats().setClubExpireTimestamp(Emulator.getIntUnixTimestamp());
|
||||||
|
|
||||||
|
habbo.getHabboStats().setClubExpireTimestamp(habbo.getHabboStats().getClubExpireTimestamp() + (rewardData.subscriptionDuration * 86400));
|
||||||
|
habbo.getClient().sendResponse(new UserPermissionsComposer(habbo));
|
||||||
|
habbo.getClient().sendResponse(new UserClubComposer(habbo));
|
||||||
|
habbo.getHabboStats().run();
|
||||||
|
break;
|
||||||
|
case BUILDERS_CLUB:
|
||||||
|
habbo.alert("Builders club has not been implemented yet. Sorry!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,6 +187,10 @@ public class InteractionCrackable extends HabboItem
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean userRequiredToBeAdjacent() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void reset(Room room)
|
public void reset(Room room)
|
||||||
{
|
{
|
||||||
this.cracked = false;
|
this.cracked = false;
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.eu.habbo.habbohotel.items.interactions;
|
||||||
|
|
||||||
|
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.RedeemableSubscriptionType;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
|
import com.eu.habbo.messages.outgoing.users.UserClubComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.users.UserPermissionsComposer;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class InteractionRedeemableSubscriptionBox extends InteractionCrackable {
|
||||||
|
public InteractionRedeemableSubscriptionBox(ResultSet set, Item baseItem) throws SQLException {
|
||||||
|
super(set, baseItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
public InteractionRedeemableSubscriptionBox(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
|
||||||
|
super(id, userId, item, extradata, limitedStack, limitedSells);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean userRequiredToBeAdjacent() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -3713,6 +3713,14 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
|
|||||||
if (!habbo.getHabboStats().allowTalk())
|
if (!habbo.getHabboStats().allowTalk())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (habbo.getRoomUnit().isInvisible() && Emulator.getConfig().getBoolean("invisible.prevent.chat", false)) {
|
||||||
|
if (!CommandHandler.handleCommand(habbo.getClient(), roomChatMessage.getUnfilteredMessage())) {
|
||||||
|
habbo.whisper(Emulator.getTexts().getValue("invisible.prevent.chat.error"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
habbo.getHabboStats().chatCounter += 2;
|
habbo.getHabboStats().chatCounter += 2;
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != this)
|
if (habbo.getHabboInfo().getCurrentRoom() != this)
|
||||||
|
@ -42,7 +42,7 @@ public class CrackableExplode implements Runnable
|
|||||||
if (!this.habboItem.resetable())
|
if (!this.habboItem.resetable())
|
||||||
{
|
{
|
||||||
this.room.removeHabboItem(this.habboItem);
|
this.room.removeHabboItem(this.habboItem);
|
||||||
this.room.sendComposer(new RemoveFloorItemComposer(this.habboItem).compose());
|
this.room.sendComposer(new RemoveFloorItemComposer(this.habboItem, true).compose());
|
||||||
this.habboItem.setRoomId(0);
|
this.habboItem.setRoomId(0);
|
||||||
Emulator.getGameEnvironment().getItemManager().deleteItem(this.habboItem);
|
Emulator.getGameEnvironment().getItemManager().deleteItem(this.habboItem);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user