mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Update GoblinVillagePopulationPlugin.java
This commit is contained in:
parent
f0cde9d264
commit
ad9b6ec1b9
1 changed files with 12 additions and 2 deletions
|
|
@ -1,9 +1,13 @@
|
|||
package plugin.interaction.object;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.crandor.cache.def.impl.ObjectDefinition;
|
||||
import org.crandor.game.interaction.OptionHandler;
|
||||
import org.crandor.game.node.Node;
|
||||
import org.crandor.game.node.entity.npc.NPC;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.world.map.RegionManager;
|
||||
import org.crandor.plugin.InitializablePlugin;
|
||||
import org.crandor.plugin.Plugin;
|
||||
|
||||
|
|
@ -18,8 +22,14 @@ public class GoblinVillagePopulationPlugin extends OptionHandler {
|
|||
|
||||
@Override
|
||||
public boolean handle(Player player, Node node, String option) {
|
||||
int population = 26; //TODO: Find out how to get all goblins in the area.
|
||||
player.getDialogueInterpreter().sendPlainMessage(false, "Welcome to Goblin Village.", "Current population: " + population);
|
||||
int population = 2;
|
||||
final List<NPC> npcs = RegionManager.getLocalNpcs(player);
|
||||
for (NPC n : npcs) {
|
||||
if (n.getName().equals("Goblin")) {
|
||||
population++;
|
||||
player.getDialogueInterpreter().sendPlainMessage(false, "Welcome to Goblin Village.", "Current population: " + population);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue