|
RuneHive-Game
|
Handles spawning, rewarding and picking up of pets. More...
Static Public Member Functions | |
| static Task | abandon (Npc npc) |
| The pet abandon task. | |
| static void | buyInsurance (Player player, Item item) |
| Handles purchasing insurance for a pet. | |
| static void | claimLostPets (Player player) |
| Claims all the lost pets. | |
| static boolean | dialogue (Player player, Npc npc) |
| Handles speaking to a pet. | |
| static void | onDeath (Player player) |
| Handles what happens to a pet when a player dies. | |
| static void | onLogin (Player player) |
| Handles what happens to a pet when a player logs in. | |
| static void | onLogout (Player player) |
| Handles what happens to a pet when a player logouts. | |
| static void | onReward (Player player, int item) |
| Handles rewarding with a 100% a chance. | |
| static void | onReward (Player player, int item, int chance) |
| Handles calculating the chance of a player receiving a skilling pet. | |
| static boolean | onReward (Player player, PetData pet) |
| Generates a unique equation for special defined pets. | |
| static boolean | onSpawn (Player player, int item, boolean drop) |
| Handles spawning a pet. | |
| static void | openInsurance (Player player) |
| Handles opening the insurance interface. | |
| static void | openLostPets (Player player) |
| Handles opening the insurance interface. | |
Static Public Attributes | |
| static final int | INSRUANCE_COST = 8000000 |
| The cost of insuring a pet. | |
Static Private Member Functions | |
| static boolean | hasInsurance (Player player, PetData pet) |
| Checks if player already has insurance for a pet. | |
| static void | onObtain (Player player, int item) |
| Handles a player receiving a pet onReward. | |
The pet abandon task.
Definition at line 184 of file Pets.java.
References com.runehive.util.Utility.getInnerBoundaries(), com.runehive.game.world.entity.Entity.getPosition(), com.runehive.game.world.entity.mob.movement.Movement.isMoving, com.runehive.game.world.entity.mob.Mob.movement, com.runehive.util.Utility.randomElement(), com.runehive.game.world.entity.mob.Mob.resetFace(), com.runehive.game.world.entity.mob.Mob.resetWaypoint(), com.runehive.game.world.position.Position.transform(), com.runehive.game.world.entity.mob.npc.Npc.unregister(), and com.runehive.game.world.entity.mob.npc.Npc.walk.
Referenced by onDeath().
Handles purchasing insurance for a pet.
Definition at line 238 of file Pets.java.
References com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.content.pet.PetData.forItem(), com.runehive.util.Utility.formatDigits(), com.runehive.game.world.items.Item.getId(), com.runehive.game.world.items.Item.getName(), hasInsurance(), INSRUANCE_COST, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.petInsurance, com.runehive.game.world.items.containers.ItemContainer.remove(), and com.runehive.content.dialogue.DialogueFactory.sendNpcChat().
|
static |
Claims all the lost pets.
Definition at line 258 of file Pets.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.util.Utility.formatDigits(), com.runehive.game.world.items.containers.ItemContainer.getFreeSlots(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.lostPets, com.runehive.game.world.items.containers.ItemContainer.remove(), and com.runehive.content.dialogue.DialogueFactory.sendNpcChat().
Handles speaking to a pet.
Definition at line 128 of file Pets.java.
References com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.game.world.entity.Entity.equals(), com.runehive.content.pet.PetData.forNpc(), com.runehive.game.world.entity.mob.npc.Npc.getName(), com.runehive.game.world.entity.mob.Mob.id, com.runehive.game.world.entity.mob.npc.Npc.owner, and com.runehive.game.world.entity.mob.player.Player.send().
Checks if player already has insurance for a pet.
Definition at line 317 of file Pets.java.
References com.runehive.game.world.entity.mob.player.Player.petInsurance.
Referenced by buyInsurance(), onDeath(), and openInsurance().
|
static |
Handles what happens to a pet when a player dies.
TODO: MULTIPLE OF THE SAME PET
Definition at line 142 of file Pets.java.
References abandon(), com.runehive.content.pet.PetData.forItem(), com.runehive.content.pet.PetData.forNpc(), com.runehive.game.world.items.Item.getId(), com.runehive.game.world.entity.Entity.getPosition(), hasInsurance(), com.runehive.game.world.entity.mob.Mob.id, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.lostPets, com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.game.world.entity.mob.player.Player.pet, com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.World.schedule(), com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.game.world.entity.mob.npc.Npc.unregister().
Referenced by com.runehive.game.world.entity.mob.player.PlayerDeath.death(), and com.runehive.game.world.entity.mob.player.PlayerDeath.postDeath().
|
static |
Handles what happens to a pet when a player logs in.
Definition at line 224 of file Pets.java.
References com.runehive.game.world.entity.mob.Mob.face(), com.runehive.game.world.entity.mob.Mob.follow(), com.runehive.game.world.entity.mob.Mob.interact(), com.runehive.game.world.entity.mob.player.Player.pet, com.runehive.game.world.entity.mob.npc.Npc.register(), and com.runehive.game.world.World.schedule().
Referenced by com.runehive.game.world.entity.mob.player.PlayerAssistant.login().
|
static |
Handles what happens to a pet when a player logouts.
Definition at line 217 of file Pets.java.
References com.runehive.game.world.entity.mob.player.Player.pet, and com.runehive.game.world.entity.mob.npc.Npc.unregister().
Referenced by com.runehive.game.world.entity.mob.player.Player.unregister().
|
staticprivate |
Handles a player receiving a pet onReward.
Definition at line 69 of file Pets.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.entity.mob.player.Player.bank, com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.util.Utility.findAccessableTile(), com.runehive.content.pet.PetData.forItem(), com.runehive.game.world.items.containers.ItemContainer.hasCapacityFor(), com.runehive.game.world.entity.mob.Mob.id, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.content.collectionlog.CollectionLog.logItem(), onSpawn(), com.runehive.game.world.entity.mob.player.Player.pet, com.runehive.util.MessageColor.RED, com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.content.collectionlog.CollectionLogData.WINTERTODT.
Referenced by onReward(), onReward(), and onReward().
|
static |
Handles rewarding with a 100% a chance.
| player | |
| item | |
| chance |
Definition at line 44 of file Pets.java.
References onObtain().
|
static |
Handles calculating the chance of a player receiving a skilling pet.
Definition at line 33 of file Pets.java.
References onObtain(), and com.runehive.util.Utility.random().
Referenced by com.runehive.content.skill.impl.firemaking.Firemaking.bonfireAction(), com.runehive.content.skill.impl.woodcutting.WoodcuttingAction.chop(), com.runehive.content.skill.impl.thieving.Thieving.clickNpc(), com.runehive.content.skill.impl.runecrafting.Runecraft.clickObject(), com.runehive.content.skill.impl.thieving.Thieving.clickObject(), com.runehive.content.activity.impl.fightcaves.FightCaves.finish(), com.runehive.content.activity.inferno.Inferno.finish(), com.runehive.content.skill.impl.fishing.FishingAction.fish(), com.runehive.game.world.entity.mob.player.PlayerKilling.handle(), com.runehive.content.skill.impl.mining.MiningAction.mine(), com.runehive.content.skill.impl.firemaking.FiremakingAction.onDestruct(), and com.runehive.game.world.entity.mob.npc.drop.NpcDropManager.rollDrop().
Generates a unique equation for special defined pets.
Definition at line 49 of file Pets.java.
References com.runehive.content.pet.PetData.BABY_DARTH, com.runehive.content.pet.PetData.JAD, onObtain(), com.runehive.util.Utility.random(), com.runehive.content.pet.PetData.ROCK_GOLEM, and com.runehive.content.pet.PetData.ROCKY.
|
static |
Handles spawning a pet.
Definition at line 91 of file Pets.java.
References com.runehive.content.achievement.AchievementHandler.activate(), com.runehive.game.world.entity.mob.Mob.animate(), com.runehive.game.world.entity.mob.Mob.face(), com.runehive.util.Utility.findAccessableTile(), com.runehive.content.pet.PetData.forItem(), com.runehive.game.world.entity.mob.player.PlayerRight.getColor(), com.runehive.game.world.entity.mob.player.Player.getName(), com.runehive.content.pet.PetData.getNpc(), com.runehive.game.world.entity.Entity.instance, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.content.achievement.AchievementKey.OBTAIN_PET, com.runehive.game.world.entity.mob.player.Player.pet, com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.entity.mob.player.Player.right, com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.game.world.World.sendMessage().
Referenced by onObtain().
|
static |
Handles opening the insurance interface.
Definition at line 279 of file Pets.java.
References com.runehive.util.Utility.formatDigits(), com.runehive.content.pet.PetData.forOrdinal(), hasInsurance(), INSRUANCE_COST, com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.InterfaceManager.open(), and com.runehive.game.world.entity.mob.player.Player.send().
|
static |
Handles opening the insurance interface.
Definition at line 296 of file Pets.java.
References com.runehive.util.Utility.formatDigits(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.Player.lostPets, com.runehive.game.world.entity.mob.player.InterfaceManager.open(), and com.runehive.game.world.entity.mob.player.Player.send().
|
static |
The cost of insuring a pet.
Definition at line 30 of file Pets.java.
Referenced by buyInsurance(), and openInsurance().