mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Merge branch 'wired-bot-fix' into 'dev'
wired bot fix See merge request morningstar/Arcturus-Community!258
This commit is contained in:
commit
045bd05c35
@ -68,12 +68,13 @@ public class WiredEffectBotClothes extends InteractionWiredEffect {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
if (bots.size() > 1) {
|
|
||||||
|
if (bots.size() != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (Bot bot : bots) {
|
|
||||||
|
Bot bot = bots.get(0);
|
||||||
bot.setFigure(this.botLook);
|
bot.setFigure(this.botLook);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -86,15 +86,14 @@ public class WiredEffectBotFollowHabbo extends InteractionWiredEffect {
|
|||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
if (habbo != null) {
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
if (bots.size() > 1) {
|
|
||||||
return false;
|
if (habbo != null && bots.size() == 1) {
|
||||||
}
|
Bot bot = bots.get(0);
|
||||||
for (Bot bot : bots) {
|
|
||||||
if (this.mode == 1)
|
if (this.mode == 1) {
|
||||||
bot.startFollowingHabbo(habbo);
|
bot.startFollowingHabbo(habbo);
|
||||||
else
|
} else {
|
||||||
bot.stopFollowingHabbo();
|
bot.stopFollowingHabbo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,13 +88,11 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
if (habbo != null) {
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
if (bots.size() > 1) {
|
|
||||||
return false;
|
if (habbo != null && bots.size() == 1) {
|
||||||
}
|
Bot bot = bots.get(0);
|
||||||
for (Bot bot : bots) {
|
|
||||||
List<Runnable> tasks = new ArrayList<>();
|
List<Runnable> tasks = new ArrayList<>();
|
||||||
tasks.add(new RoomUnitGiveHanditem(habbo.getRoomUnit(), room, this.itemId));
|
tasks.add(new RoomUnitGiveHanditem(habbo.getRoomUnit(), room, this.itemId));
|
||||||
tasks.add(new RoomUnitGiveHanditem(bot.getRoomUnit(), room, 0));
|
tasks.add(new RoomUnitGiveHanditem(bot.getRoomUnit(), room, 0));
|
||||||
@ -105,7 +103,6 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect {
|
|||||||
failedReach.add(() -> tasks.forEach(Runnable::run));
|
failedReach.add(() -> tasks.forEach(Runnable::run));
|
||||||
|
|
||||||
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(bot.getRoomUnit(), habbo.getRoomUnit(), room, tasks, failedReach));
|
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(bot.getRoomUnit(), habbo.getRoomUnit(), room, tasks, failedReach));
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -83,16 +83,21 @@ public class WiredEffectBotTalk extends InteractionWiredEffect {
|
|||||||
.replace(Emulator.getTexts().getValue("wired.variable.pixels"), habbo.getHabboInfo().getPixels() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.pixels"), habbo.getHabboInfo().getPixels() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
if (bots.size() > 1) {
|
|
||||||
|
if (bots.size() != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (Bot bot : bots) {
|
|
||||||
if (this.mode == 1)
|
Bot bot = bots.get(0);
|
||||||
|
|
||||||
|
if (this.mode == 1) {
|
||||||
bot.shout(message);
|
bot.shout(message);
|
||||||
else
|
} else {
|
||||||
bot.talk(message);
|
bot.talk(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,19 +103,22 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect {
|
|||||||
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
if (bots.size() > 1) {
|
|
||||||
|
if (bots.size() != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (Bot bot : bots) {
|
|
||||||
|
Bot bot = bots.get(0);
|
||||||
|
|
||||||
if (this.mode == 1) {
|
if (this.mode == 1) {
|
||||||
bot.whisper(m, habbo);
|
bot.whisper(m, habbo);
|
||||||
} else {
|
} else {
|
||||||
bot.talk(habbo.getHabboInfo().getUsername() + ": " + m);
|
bot.talk(habbo.getHabboInfo().getUsername() + ": " + m);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,15 +139,15 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
|
|
||||||
if (bots.isEmpty())
|
if (bots.size() != 1) {
|
||||||
return false;
|
|
||||||
|
|
||||||
if (bots.size() > 1) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (Bot bot : bots) {
|
|
||||||
|
Bot bot = bots.get(0);
|
||||||
|
|
||||||
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
|
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
|
||||||
int j = 1;
|
int j = 1;
|
||||||
|
|
||||||
for (HabboItem item : this.items) {
|
for (HabboItem item : this.items) {
|
||||||
if (item.getRoomId() != 0 && item.getRoomId() == bot.getRoom().getId()) {
|
if (item.getRoomId() != 0 && item.getRoomId() == bot.getRoom().getId()) {
|
||||||
if (i == j) {
|
if (i == j) {
|
||||||
@ -158,7 +158,6 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -88,14 +88,13 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
|
||||||
if (this.items.isEmpty())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
|
|
||||||
if (bots.isEmpty())
|
if (this.items.isEmpty() || bots.size() != 1) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bot bot = bots.get(0);
|
||||||
THashSet<HabboItem> items = new THashSet<>();
|
THashSet<HabboItem> items = new THashSet<>();
|
||||||
|
|
||||||
for (HabboItem item : this.items) {
|
for (HabboItem item : this.items) {
|
||||||
@ -108,10 +107,6 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.items.size() > 0) {
|
if (this.items.size() > 0) {
|
||||||
if (bots.size() > 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (Bot bot : bots) {
|
|
||||||
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
|
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for (HabboItem item : this.items) {
|
for (HabboItem item : this.items) {
|
||||||
@ -125,7 +120,6 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user