mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Merge branch 'dev' of https://git.krews.org/morningstar/Arcturus-Community into dev
This commit is contained in:
commit
246bbc80a8
@ -44,6 +44,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
private final THashMap<Integer, HabboItem> gameTiles;
|
private final THashMap<Integer, HabboItem> gameTiles;
|
||||||
private int tileCount;
|
private int tileCount;
|
||||||
private int countDown;
|
private int countDown;
|
||||||
|
private int countDown2;
|
||||||
|
|
||||||
public BattleBanzaiGame(Room room) {
|
public BattleBanzaiGame(Room room) {
|
||||||
super(BattleBanzaiGameTeam.class, BattleBanzaiGamePlayer.class, room, true);
|
super(BattleBanzaiGameTeam.class, BattleBanzaiGamePlayer.class, room, true);
|
||||||
@ -58,8 +59,12 @@ public class BattleBanzaiGame extends Game {
|
|||||||
public void initialise() {
|
public void initialise() {
|
||||||
if (!this.state.equals(GameState.IDLE))
|
if (!this.state.equals(GameState.IDLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* The first countdown is activated for the first two seconds emitting only the blue light (second interaction),
|
||||||
|
the second, after another two seconds, completely activates the sphere (third interaction).
|
||||||
|
*/
|
||||||
this.countDown = 3;
|
this.countDown = 3;
|
||||||
|
this.countDown2 = 2;
|
||||||
|
|
||||||
this.resetMap();
|
this.resetMap();
|
||||||
|
|
||||||
@ -105,8 +110,15 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
if (this.countDown == 0) {
|
if (this.countDown == 0) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
||||||
item.setExtradata("2");
|
item.setExtradata("1");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
|
if(this.countDown2 > 0) {
|
||||||
|
this.countDown2--;
|
||||||
|
if(this.countDown2 == 0) {
|
||||||
|
item.setExtradata("2");
|
||||||
|
this.room.updateItemState(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,26 +60,30 @@ public class InteractionMannequin extends HabboItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
||||||
String[] lookCode = this.getExtradata().split(":")[1].split("\\.");
|
String lookCode = this.getExtradata().split(":")[1];
|
||||||
|
String newFigure = "";
|
||||||
|
|
||||||
StringBuilder look = new StringBuilder();
|
for (String playerFigurePart : client.getHabbo().getHabboInfo().getLook().split("\\.")) {
|
||||||
for (String part : client.getHabbo().getHabboInfo().getLook().split("\\.")) {
|
if (!playerFigurePart.startsWith("ch") && !playerFigurePart.startsWith("lg"))
|
||||||
String type = part.split("-")[0];
|
newFigure += playerFigurePart + ".";
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (String s : lookCode) {
|
|
||||||
if (s.contains(type)) {
|
|
||||||
found = true;
|
|
||||||
look.append(s).append(".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
look.append(part).append(".");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client.getHabbo().getHabboInfo().setLook(look.substring(0, look.length() - 1));
|
if (lookCode.isEmpty()) return;
|
||||||
|
String newFigureParts = lookCode;
|
||||||
|
|
||||||
|
for (String newFigurePart : newFigureParts.split("\\.")) {
|
||||||
|
if (newFigurePart.startsWith("hd"))
|
||||||
|
newFigureParts = newFigureParts.replace(newFigurePart, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newFigureParts.equals("")) return;
|
||||||
|
|
||||||
|
final String figure = newFigure + newFigureParts;
|
||||||
|
|
||||||
|
if (figure.length() > 512)
|
||||||
|
return;
|
||||||
|
|
||||||
|
client.getHabbo().getHabboInfo().setLook(figure);
|
||||||
room.sendComposer(new RoomUserDataComposer(client.getHabbo()).compose());
|
room.sendComposer(new RoomUserDataComposer(client.getHabbo()).compose());
|
||||||
client.sendResponse(new UserDataComposer(client.getHabbo()));
|
client.sendResponse(new UserDataComposer(client.getHabbo()));
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,13 @@ public class RequestGuildBuyEvent extends MessageHandler {
|
|||||||
base += 3;
|
base += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(name.length() > 29){
|
||||||
|
this.client.sendResponse(new GuildEditFailComposer(GuildEditFailComposer.INVALID_GUILD_NAME));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(description.length() > 254){
|
||||||
|
return;
|
||||||
|
}
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge, colorOne, colorTwo);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge, colorOne, colorTwo);
|
||||||
|
|
||||||
r.setGuild(guild.getId());
|
r.setGuild(guild.getId());
|
||||||
@ -107,4 +114,4 @@ public class RequestGuildBuyEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user