mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-15 19:10:18 -07:00
Barrows equipment now lasts for 15 hours of combat instead of 40 minutes of combat.
This commit is contained in:
parent
178bbbc05c
commit
b6f3411acd
5 changed files with 65 additions and 50 deletions
|
|
@ -69,4 +69,5 @@
|
|||
< --- ABOVE Released December 4, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Dec-4-2021 ---- >
|
||||
- Shooting star discovery bonus xp is now gradually disbursed instead of lump-sum.
|
||||
- Spending points to cancel your slayer task no longer sets your task streak to 0.
|
||||
- Stars now have bots that will spawn and help mine for stars higher than level 5.
|
||||
- Stars now have bots that will spawn and help mine for stars higher than level 5.
|
||||
- Barrows equipment now lasts for 15 hours of combat instead of 40 minutes of combat.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import core.game.node.entity.player.Player;
|
|||
import core.game.node.entity.player.link.diary.AchievementDiary;
|
||||
import core.game.node.entity.player.link.diary.DiaryType;
|
||||
import core.game.node.item.Item;
|
||||
import rs09.game.node.entity.equipment.BarrowsEquipmentRegister;
|
||||
|
||||
/**
|
||||
* Represents the dialogue plugin used for the bob npc who repairs items.
|
||||
|
|
@ -388,6 +389,7 @@ public final class BobDialogue extends DialoguePlugin {
|
|||
* @return the price.
|
||||
*/
|
||||
public static int getFormatedCost(String name, Item item) {
|
||||
int ticks = BarrowsEquipmentRegister.TICKS;
|
||||
int[] degrades = new int[] { 100, 75, 50, 25, 0 };
|
||||
for (int i = 0; i < prices.length; i++) {
|
||||
String check = (String) prices[i][0];
|
||||
|
|
@ -399,7 +401,7 @@ public final class BobDialogue extends DialoguePlugin {
|
|||
break;
|
||||
}
|
||||
}
|
||||
degrade -= 25 - (25 * (item.getCharge() * 0.001));
|
||||
degrade -= 25 - (25 * ((double)item.getCharge() / (double)ticks));
|
||||
int max = (int) prices[i][1] * 1000;
|
||||
return (int) (max - (max * (degrade * 0.01)));
|
||||
}
|
||||
|
|
@ -571,4 +573,4 @@ public final class BobDialogue extends DialoguePlugin {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,14 @@ class EquipmentDegrader{
|
|||
companion object StaticDegrader { //Use a static companion object for lists and registers so they persist across instances
|
||||
val itemList = arrayListOf<Int>()
|
||||
val setList = arrayListOf<ArrayList<Int>>()
|
||||
fun register(item: Int){
|
||||
val itemCharges = hashMapOf<Int, Int>()
|
||||
fun register(charges: Int, item: Int){
|
||||
itemList.add(item)
|
||||
itemCharges.put(item, charges)
|
||||
}
|
||||
|
||||
fun registerSet(items: Array<Int>){
|
||||
setList.add(ArrayList(items.map { item -> item.also { register(item) } }))
|
||||
fun registerSet(charges: Int, items: Array<Int>){
|
||||
setList.add(ArrayList(items.map { item -> item.also { register(charges, item) } }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +56,7 @@ class EquipmentDegrader{
|
|||
charge = 0
|
||||
}
|
||||
if(this.charge <= 0) {
|
||||
val charges = itemCharges.getOrElse(this.id, { 1000 })
|
||||
if (set?.size!! > 2) {
|
||||
p?.equipment?.remove(this)
|
||||
p?.sendMessage("Your $name has degraded.")
|
||||
|
|
@ -61,7 +64,7 @@ class EquipmentDegrader{
|
|||
p?.inventory?.add(Item(set.getNext(this.id)))
|
||||
p?.sendMessage("Your $name has broken.")
|
||||
} else {
|
||||
p?.equipment?.add(Item(set.getNext(this.id)), slot, false, false)
|
||||
p?.equipment?.add(Item(set.getNext(this.id), 1, charges), slot, false, false)
|
||||
p?.equipment?.refresh()
|
||||
}
|
||||
} else if (set.size == 2) {
|
||||
|
|
@ -71,7 +74,7 @@ class EquipmentDegrader{
|
|||
} else {
|
||||
p?.equipment?.remove(this)
|
||||
p?.sendMessage("Your $name has degraded.")
|
||||
p?.equipment?.add(Item(set.getNext(this.id)), slot, false, false)
|
||||
p?.equipment?.add(Item(set.getNext(this.id), 1, charges), slot, false, false)
|
||||
p?.equipment?.refresh()
|
||||
}
|
||||
}
|
||||
|
|
@ -85,4 +88,4 @@ class EquipmentDegrader{
|
|||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@ import core.plugin.Plugin
|
|||
|
||||
@Initializable
|
||||
class BarrowsEquipmentRegister : Plugin<Any>{
|
||||
public companion object {
|
||||
// Barrows equipment lasts for 15 hours of combat, and each piece has 4 stages of degredation
|
||||
@JvmField
|
||||
public val TICKS = (15 * 6000) / 4
|
||||
}
|
||||
|
||||
val DHAROK_HELM = arrayOf(4716,4880,4881,4882,4883,4884)
|
||||
val DHAROK_AXE = arrayOf(4718,4886,4887,4888,4889,4890)
|
||||
val DHAROK_BODY = arrayOf(4720,4892,4893,4894,4895,4896)
|
||||
|
|
@ -37,30 +43,30 @@ class BarrowsEquipmentRegister : Plugin<Any>{
|
|||
val KARIL_SKIRT = arrayOf(4738,4946,4947,4948,4949,4950)
|
||||
|
||||
override fun newInstance(arg: Any?): Plugin<Any> {
|
||||
EquipmentDegrader.registerSet(AHRIM_HOOD)
|
||||
EquipmentDegrader.registerSet(AHRIM_STAFF)
|
||||
EquipmentDegrader.registerSet(AHRIM_TOP)
|
||||
EquipmentDegrader.registerSet(AHRIM_SKIRT)
|
||||
EquipmentDegrader.registerSet(KARIL_COIF)
|
||||
EquipmentDegrader.registerSet(KARIL_CBOW)
|
||||
EquipmentDegrader.registerSet(KARIL_TOP)
|
||||
EquipmentDegrader.registerSet(KARIL_SKIRT)
|
||||
EquipmentDegrader.registerSet(DHAROK_HELM)
|
||||
EquipmentDegrader.registerSet(DHAROK_AXE)
|
||||
EquipmentDegrader.registerSet(DHAROK_BODY)
|
||||
EquipmentDegrader.registerSet(DHAROK_LEGS)
|
||||
EquipmentDegrader.registerSet(GUTHAN_HELM)
|
||||
EquipmentDegrader.registerSet(GUTHAN_SPEAR)
|
||||
EquipmentDegrader.registerSet(GUTHAN_BODY)
|
||||
EquipmentDegrader.registerSet(GUTHAN_SKIRT)
|
||||
EquipmentDegrader.registerSet(TORAG_HELM)
|
||||
EquipmentDegrader.registerSet(TORAG_HAMMER)
|
||||
EquipmentDegrader.registerSet(TORAG_BODY)
|
||||
EquipmentDegrader.registerSet(TORAG_LEGS)
|
||||
EquipmentDegrader.registerSet(VERAC_HELM)
|
||||
EquipmentDegrader.registerSet(VERAC_FLAIL)
|
||||
EquipmentDegrader.registerSet(VERAC_BRASS)
|
||||
EquipmentDegrader.registerSet(VERAC_SKIRT)
|
||||
EquipmentDegrader.registerSet(TICKS, AHRIM_HOOD)
|
||||
EquipmentDegrader.registerSet(TICKS, AHRIM_STAFF)
|
||||
EquipmentDegrader.registerSet(TICKS, AHRIM_TOP)
|
||||
EquipmentDegrader.registerSet(TICKS, AHRIM_SKIRT)
|
||||
EquipmentDegrader.registerSet(TICKS, KARIL_COIF)
|
||||
EquipmentDegrader.registerSet(TICKS, KARIL_CBOW)
|
||||
EquipmentDegrader.registerSet(TICKS, KARIL_TOP)
|
||||
EquipmentDegrader.registerSet(TICKS, KARIL_SKIRT)
|
||||
EquipmentDegrader.registerSet(TICKS, DHAROK_HELM)
|
||||
EquipmentDegrader.registerSet(TICKS, DHAROK_AXE)
|
||||
EquipmentDegrader.registerSet(TICKS, DHAROK_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, DHAROK_LEGS)
|
||||
EquipmentDegrader.registerSet(TICKS, GUTHAN_HELM)
|
||||
EquipmentDegrader.registerSet(TICKS, GUTHAN_SPEAR)
|
||||
EquipmentDegrader.registerSet(TICKS, GUTHAN_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, GUTHAN_SKIRT)
|
||||
EquipmentDegrader.registerSet(TICKS, TORAG_HELM)
|
||||
EquipmentDegrader.registerSet(TICKS, TORAG_HAMMER)
|
||||
EquipmentDegrader.registerSet(TICKS, TORAG_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, TORAG_LEGS)
|
||||
EquipmentDegrader.registerSet(TICKS, VERAC_HELM)
|
||||
EquipmentDegrader.registerSet(TICKS, VERAC_FLAIL)
|
||||
EquipmentDegrader.registerSet(TICKS, VERAC_BRASS)
|
||||
EquipmentDegrader.registerSet(TICKS, VERAC_SKIRT)
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
@ -68,4 +74,4 @@ class BarrowsEquipmentRegister : Plugin<Any>{
|
|||
return Unit
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import core.plugin.Plugin
|
|||
|
||||
@Initializable
|
||||
class PVPEquipmentRegister : Plugin<Any> {
|
||||
// PVP equipment lasts for 1 hour of combat, which is 6000 ticks
|
||||
val TICKS = 6000
|
||||
|
||||
val VESTA_BODY = arrayOf(13887,13889)
|
||||
val VESTA_SKIRT = arrayOf(13893,13895)
|
||||
val VESTA_SWORD = arrayOf(13899,13901)
|
||||
|
|
@ -27,21 +30,21 @@ class PVPEquipmentRegister : Plugin<Any> {
|
|||
|
||||
|
||||
override fun newInstance(arg: Any?): Plugin<Any> {
|
||||
EquipmentDegrader.registerSet(VESTA_BODY)
|
||||
EquipmentDegrader.registerSet(VESTA_SKIRT)
|
||||
EquipmentDegrader.registerSet(VESTA_SWORD)
|
||||
EquipmentDegrader.registerSet(VESTA_SPEAR)
|
||||
EquipmentDegrader.registerSet(STATIUS_BODY)
|
||||
EquipmentDegrader.registerSet(STATIUS_HAMMER)
|
||||
EquipmentDegrader.registerSet(STATIUS_HELM)
|
||||
EquipmentDegrader.registerSet(STATIUS_LEGS)
|
||||
EquipmentDegrader.registerSet(ZUREL_BOTTOM)
|
||||
EquipmentDegrader.registerSet(ZURIEL_HOOD)
|
||||
EquipmentDegrader.registerSet(ZURIEL_STAFF)
|
||||
EquipmentDegrader.registerSet(ZURIEL_TOP)
|
||||
EquipmentDegrader.registerSet(MORRIGAN_BODY)
|
||||
EquipmentDegrader.registerSet(MORRIGAN_CHAP)
|
||||
EquipmentDegrader.registerSet(MORRIGAN_COIF)
|
||||
EquipmentDegrader.registerSet(TICKS, VESTA_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, VESTA_SKIRT)
|
||||
EquipmentDegrader.registerSet(TICKS, VESTA_SWORD)
|
||||
EquipmentDegrader.registerSet(TICKS, VESTA_SPEAR)
|
||||
EquipmentDegrader.registerSet(TICKS, STATIUS_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, STATIUS_HAMMER)
|
||||
EquipmentDegrader.registerSet(TICKS, STATIUS_HELM)
|
||||
EquipmentDegrader.registerSet(TICKS, STATIUS_LEGS)
|
||||
EquipmentDegrader.registerSet(TICKS, ZUREL_BOTTOM)
|
||||
EquipmentDegrader.registerSet(TICKS, ZURIEL_HOOD)
|
||||
EquipmentDegrader.registerSet(TICKS, ZURIEL_STAFF)
|
||||
EquipmentDegrader.registerSet(TICKS, ZURIEL_TOP)
|
||||
EquipmentDegrader.registerSet(TICKS, MORRIGAN_BODY)
|
||||
EquipmentDegrader.registerSet(TICKS, MORRIGAN_CHAP)
|
||||
EquipmentDegrader.registerSet(TICKS, MORRIGAN_COIF)
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
@ -49,4 +52,4 @@ class PVPEquipmentRegister : Plugin<Any> {
|
|||
return Unit
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue