Merge branch 'dev' into 'dev'

Added effect_vendingmachine_no_sides

See merge request morningstar/Arcturus-Community!526
This commit is contained in:
Harmonic 2022-04-10 14:57:45 +00:00
commit f73cab18bb
2 changed files with 44 additions and 0 deletions

View File

@ -180,6 +180,7 @@ public class ItemManager {
this.interactionsList.add(new ItemInteraction("handitem_tile", InteractionHanditemTile.class)); this.interactionsList.add(new ItemInteraction("handitem_tile", InteractionHanditemTile.class));
this.interactionsList.add(new ItemInteraction("effect_giver", InteractionEffectGiver.class)); this.interactionsList.add(new ItemInteraction("effect_giver", InteractionEffectGiver.class));
this.interactionsList.add(new ItemInteraction("effect_vendingmachine", InteractionEffectVendingMachine.class)); this.interactionsList.add(new ItemInteraction("effect_vendingmachine", InteractionEffectVendingMachine.class));
this.interactionsList.add(new ItemInteraction("effect_vendingmachine_no_sides", InteractionEffectVendingMachineNoSides.class));
this.interactionsList.add(new ItemInteraction("crackable_monster", InteractionMonsterCrackable.class)); this.interactionsList.add(new ItemInteraction("crackable_monster", InteractionMonsterCrackable.class));
this.interactionsList.add(new ItemInteraction("snowboard_slope", InteractionSnowboardSlope.class)); this.interactionsList.add(new ItemInteraction("snowboard_slope", InteractionSnowboardSlope.class));
this.interactionsList.add(new ItemInteraction("pressureplate_group", InteractionGroupPressurePlate.class)); this.interactionsList.add(new ItemInteraction("pressureplate_group", InteractionGroupPressurePlate.class));

View File

@ -0,0 +1,43 @@
package com.eu.habbo.habbohotel.items.interactions;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
import gnu.trove.set.hash.THashSet;
import java.sql.ResultSet;
import java.sql.SQLException;
public class InteractionEffectVendingMachineNoSides extends InteractionVendingMachine {
public InteractionEffectVendingMachineNoSides(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);
this.setExtradata("0");
}
public InteractionEffectVendingMachineNoSides(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
super(id, userId, item, extradata, limitedStack, limitedSells);
this.setExtradata("0");
}
@Override
public void giveVendingMachineItem(Room room, RoomUnit unit) {
room.giveEffect(unit, this.getBaseItem().getRandomVendingItem(), 30);
}
@Override
public THashSet<RoomTile> getActivatorTiles(Room room) {
THashSet<RoomTile> tiles = new THashSet<RoomTile>();
for(int x = -1; x <= 1; x++) {
for(int y = -1; y <= 1; y++) {
RoomTile tile = room.getLayout().getTile((short)(this.getX() + x), (short)(this.getY() + y));
if(tile != null) {
tiles.add(tile);
}
}
}
return tiles;
}
}