mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-17 03:02:35 +01:00
Update ActionDip.java
This commit is contained in:
parent
502ac555d3
commit
ef0b5080cb
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWater;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetAction;
|
||||
import com.eu.habbo.habbohotel.pets.PetVocalsType;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
@ -17,13 +18,20 @@ public class ActionDip extends PetAction {
|
||||
public boolean apply(Pet pet, Habbo habbo, String[] data) {
|
||||
THashSet<HabboItem> waterItems = pet.getRoom().getRoomSpecialTypes().getItemsOfType(InteractionWater.class);
|
||||
|
||||
if (waterItems.isEmpty())
|
||||
if (waterItems.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HabboItem waterPatch = (HabboItem) waterItems.toArray()[Emulator.getRandom().nextInt(waterItems.size())];
|
||||
|
||||
pet.getRoomUnit().setGoalLocation(pet.getRoom().getLayout().getTile(waterPatch.getX(), waterPatch.getY()));
|
||||
|
||||
if (pet.getHappyness() > 70) {
|
||||
pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL));
|
||||
} else {
|
||||
pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user