mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-17 12:00:17 -07:00
Bugfixes + shop changes
This commit is contained in:
parent
292a4b3b73
commit
c6aa52b83d
7 changed files with 1152 additions and 1165 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,30 +1,30 @@
|
||||||
package core.game.content.activity.tzhaar;
|
package core.game.content.activity.tzhaar;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import core.game.content.activity.ActivityPlugin;
|
import core.game.content.activity.ActivityPlugin;
|
||||||
import core.game.content.global.BossKillCounter;
|
import core.game.content.global.BossKillCounter;
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.node.entity.skill.slayer.Tasks;
|
|
||||||
import core.game.interaction.Option;
|
import core.game.interaction.Option;
|
||||||
import core.game.node.Node;
|
import core.game.node.Node;
|
||||||
import core.game.node.entity.Entity;
|
import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.player.link.diary.DiaryType;
|
import core.game.node.entity.player.link.diary.DiaryType;
|
||||||
|
import core.game.node.entity.skill.Skills;
|
||||||
|
import core.game.node.entity.skill.slayer.Tasks;
|
||||||
import core.game.node.item.GroundItemManager;
|
import core.game.node.item.GroundItemManager;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
import core.game.node.object.GameObject;
|
import core.game.node.object.GameObject;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
import rs09.game.world.GameWorld;
|
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.game.world.map.build.DynamicRegion;
|
import core.game.world.map.build.DynamicRegion;
|
||||||
import core.game.world.map.zone.ZoneRestriction;
|
import core.game.world.map.zone.ZoneRestriction;
|
||||||
import rs09.game.world.repository.Repository;
|
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.tools.RandomFunction;
|
import core.tools.RandomFunction;
|
||||||
|
import rs09.game.world.GameWorld;
|
||||||
|
import rs09.game.world.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the Tzhaar Fight caves plugin.
|
* Handles the Tzhaar Fight caves plugin.
|
||||||
|
|
@ -60,7 +60,7 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin {
|
||||||
* @param player The player.
|
* @param player The player.
|
||||||
*/
|
*/
|
||||||
public TzhaarFightCavesPlugin(Player player) {
|
public TzhaarFightCavesPlugin(Player player) {
|
||||||
super("fight caves", true, true, true, ZoneRestriction.CANNON);
|
super("fight caves", true, true, true, ZoneRestriction.CANNON, ZoneRestriction.RANDOM_EVENTS);
|
||||||
super.player = player;
|
super.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package rs09.game.content.ame
|
package rs09.game.content.ame
|
||||||
|
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.world.map.zone.ZoneRestriction
|
||||||
import rs09.game.system.SystemLogger
|
import rs09.game.system.SystemLogger
|
||||||
import rs09.game.world.GameWorld
|
import rs09.game.world.GameWorld
|
||||||
|
|
||||||
|
|
@ -15,6 +16,9 @@ class RandomEventManager(val player: Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fireEvent(){
|
fun fireEvent(){
|
||||||
|
if(player.zoneMonitor.isRestricted(ZoneRestriction.RANDOM_EVENTS)){
|
||||||
|
return
|
||||||
|
}
|
||||||
val ame = RandomEvents.values().random()
|
val ame = RandomEvents.values().random()
|
||||||
event = ame.npc.create(player,ame.loot,ame.type)
|
event = ame.npc.create(player,ame.loot,ame.type)
|
||||||
event!!.init()
|
event!!.init()
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class CerterEventInterface : InterfaceListener() {
|
||||||
val OPTION_C_CHILD = 3
|
val OPTION_C_CHILD = 3
|
||||||
val ITEM_CHILD = 7
|
val ITEM_CHILD = 7
|
||||||
val items = mapOf(
|
val items = mapOf(
|
||||||
Items.BRONZE_SCIMITAR_1321 to "a sword",
|
Items.BLACK_SWORD_1283 to "a sword",
|
||||||
Items.BRONZE_SWORD_1277 to "a sword",
|
Items.BRONZE_SWORD_1277 to "a sword",
|
||||||
Items.BRONZE_MED_HELM_1139 to "a helmet",
|
Items.BRONZE_CHAINBODY_1103 to "a platebody",
|
||||||
Items.BRONZE_FULL_HELM_1155 to "a helmet",
|
Items.BLACK_CHAINBODY_1107 to "a platebody",
|
||||||
Items.WOODEN_SHIELD_1171 to "a shield",
|
Items.WOODEN_SHIELD_1171 to "a shield",
|
||||||
Items.BRONZE_KITESHIELD_1189 to "a shield",
|
Items.BRONZE_KITESHIELD_1189 to "a shield",
|
||||||
)
|
)
|
||||||
val falseOptions = arrayOf("a ring","a dragon","a cat","a chestplate","a pair of boots","a fish","a gun","a staff","a cannon","a dwarf","a bow","an arrow","a chinchompa","a chicken","a feather","a ninja","a bot")
|
val falseOptions = arrayOf("a ring","a dragon","a cat","a helmet","a pair of boots","a fish","a gun","a staff","a cannon","a dwarf","a bow","an arrow","a chinchompa","a chicken","a feather","a ninja","a bot")
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
on(CERTER_INTERFACE){player, _, _, buttonID, _, _ ->
|
on(CERTER_INTERFACE){player, _, _, buttonID, _, _ ->
|
||||||
val answer = buttonID - 7
|
val answer = buttonID - 7
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import org.rs09.consts.Items
|
||||||
import rs09.game.node.entity.state.newsys.states.SeedlingState
|
import rs09.game.node.entity.state.newsys.states.SeedlingState
|
||||||
|
|
||||||
private val cans = arrayListOf(Items.WATERING_CAN8_5340,Items.WATERING_CAN7_5339,Items.WATERING_CAN6_5338,Items.WATERING_CAN5_5337,Items.WATERING_CAN4_5336,Items.WATERING_CAN3_5335,Items.WATERING_CAN2_5334,Items.WATERING_CAN1_5333)
|
private val cans = arrayListOf(Items.WATERING_CAN8_5340,Items.WATERING_CAN7_5339,Items.WATERING_CAN6_5338,Items.WATERING_CAN5_5337,Items.WATERING_CAN4_5336,Items.WATERING_CAN3_5335,Items.WATERING_CAN2_5334,Items.WATERING_CAN1_5333)
|
||||||
private val seedlings = arrayListOf(Items.OAK_SEEDLING_5358,Items.WILLOW_SEEDLING_5359,Items.MAPLE_SEEDLING_5360,Items.YEW_SEEDLING_5361,Items.MAGIC_SEEDLING_5362)
|
private val seedlings = arrayListOf(Items.OAK_SEEDLING_5358,Items.WILLOW_SEEDLING_5359,Items.MAPLE_SEEDLING_5360,Items.YEW_SEEDLING_5361,Items.MAGIC_SEEDLING_5362,Items.APPLE_TREE_SEED_5283,Items.BANANA_TREE_SEED_5284,Items.ORANGE_TREE_SEED_5285,Items.CURRY_TREE_SEED_5286,Items.PINEAPPLE_SEED_5287,Items.PAPAYA_TREE_SEED_5288,Items.PALM_TREE_SEED_5289)
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
class SeedlingWaterer : UseWithHandler(*cans.toIntArray()) {
|
class SeedlingWaterer : UseWithHandler(*cans.toIntArray()) {
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ object UseWithPatchHandler{
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
player.lock()
|
||||||
if(player.inventory.remove(plantItem)) {
|
if(player.inventory.remove(plantItem)) {
|
||||||
player.animator.animate(Animation(2291))
|
player.animator.animate(Animation(2291))
|
||||||
player.pulseManager.run(object : Pulse(3) {
|
player.pulseManager.run(object : Pulse(3) {
|
||||||
|
|
@ -175,6 +175,7 @@ object UseWithPatchHandler{
|
||||||
if(p.patch.type == PatchType.TREE || p.patch.type == PatchType.FRUIT_TREE){
|
if(p.patch.type == PatchType.TREE || p.patch.type == PatchType.FRUIT_TREE){
|
||||||
player.inventory.add(Item(Items.PLANT_POT_5356))
|
player.inventory.add(Item(Items.PLANT_POT_5356))
|
||||||
}
|
}
|
||||||
|
player.unlock()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -51,16 +51,16 @@ class BarbFishingPulse(player: Player) : SkillPulse<NPC>(player,NPC(1176)) {
|
||||||
val stragiXP = arrayOf(5,6,7)
|
val stragiXP = arrayOf(5,6,7)
|
||||||
val fishXP = arrayOf(50,70,80)
|
val fishXP = arrayOf(50,70,80)
|
||||||
val reward = getRandomFish()
|
val reward = getRandomFish()
|
||||||
val success = rollSuccess(when(reward){
|
val success = rollSuccess(when(reward.id){
|
||||||
Item(11328) -> 48
|
11328 -> 48
|
||||||
Item(11330) -> 58
|
11330 -> 58
|
||||||
Item(11332) -> 70
|
11332 -> 70
|
||||||
else -> 99
|
else -> 99
|
||||||
})
|
})
|
||||||
val index = (when(reward){
|
val index = (when(reward.id){
|
||||||
Item(11328) -> 0
|
11328 -> 0
|
||||||
Item(11330) -> 1
|
11330 -> 1
|
||||||
Item(11332) -> 2
|
11332 -> 2
|
||||||
else -> 0
|
else -> 0
|
||||||
})
|
})
|
||||||
if(success){
|
if(success){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue