package com.argon.player.randomevent.impl;
import com.Server;
import com.argon.player.Client;
import com.argon.utility.Misc;
/**
* @author FUZENSETH
* Credits to Optimum from r-s for the arrays.
*/
public class BirdNest {
/**
* Constants.
*/
public static final int[] BIRD_NEST_IDS = {5070, 5071, 5072, 5073, 5074};
public static final int[] SEED_REWARDS = {5312, 5313, 5314, 5315, 5316, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5317};
public static final int[] RING_REWARDS = {1635, 1637, 1639, 1641, 1643};
/**
* If the nest exists.
* [MENTION=75098]Para[/MENTION]m index
* [MENTION=184045]return[/MENTION]
*/
public static boolean exists(int index) {
for (int nestIndex : BIRD_NEST_IDS)
if (nestIndex == index)
return true;
return false;
}
/**
* Creates the bird's nest on ground.
*/
public static void appendGround(Client p) {
if (Misc.random(10) == 9) {
Server.itemHandler.createGroundItem(p, 5070 + Misc.random(4), p.getX(), p.getY(), 1, p.getId());//Makes any item with the ID of 5070 to 5074 appear on the ground.
p.updateRequired = true;
p.sendMessage("A bird's nest falls out from the tree!", Colours.YELLOW);
}
}
/**
* Searches a bird nest.
* [MENTION=75098]Para[/MENTION]m player
* [MENTION=75098]Para[/MENTION]m id
*/
public static void open(Client player, int id) {
if (player.inDuel || player.isDead)
return;
if (player.getItems().freeSlots() < 2) {
player.sendMessage("You need atleast 2 free inventory slots to search the nest.");
return;
}
player.sendMessage("You search the bird's nest.");
player.getItems().deleteItem2(id, 1);
player.getItems().addItem(5076, 1);
for (int eggNest = 5076; eggNest < 5078; eggNest++)
if (id == eggNest)
player.getItems().addItem(5076 + Misc.random(2), 1);
else if (id == 5073)
player.getItems().addItem(SEED_REWARDS[Misc.random(SEED_REWARDS.length - 1)],
(int) Misc.randomDouble(2,
);
else if (id == 5074)
player.getItems().addItem(RING_REWARDS[Misc.random(RING_REWARDS.length - 1)], 1);
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.