mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-27 05:15:11 -06:00
This commit is contained in:
parent
c5ba5e8609
commit
7e2b5f6d46
1 changed files with 55 additions and 36 deletions
|
|
@ -65,7 +65,16 @@ class FOGRewardsInterface : ComponentPlugin(){
|
|||
return this
|
||||
}
|
||||
|
||||
private fun handleOpcode(item: ShopItem, opcode: Int, player: Player){
|
||||
private fun handleOpcode(item: ShopItem, opcode: Int, player: Player) {
|
||||
if (item.id in shopsaleone) {
|
||||
handleSaleOneOpcode(item,opcode, player)
|
||||
} else {
|
||||
handleOGOpcode(item,opcode, player)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun handleOGOpcode(item: ShopItem, opcode: Int, player: Player){
|
||||
when(opcode){
|
||||
155 -> player.sendMessage("${ItemDefinition.forId(item.id).name.replace("100","")}: costs ${item.price} tokens.")
|
||||
196 -> handleBuyOption(item,1,player)
|
||||
|
|
@ -75,6 +84,14 @@ class FOGRewardsInterface : ComponentPlugin(){
|
|||
}
|
||||
}
|
||||
|
||||
private fun handleSaleOneOpcode(item: ShopItem, opcode: Int, player: Player) {
|
||||
when (opcode) {
|
||||
155 -> player.sendMessage("${ItemDefinition.forId(item.id).name.replace("100","")}: costs ${item.price} tokens.")
|
||||
196 -> handleBuyOption(item,1,player)
|
||||
124 -> player.sendMessage(ItemDefinition.forId(item.id).examine.replace("100",""))
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleBuyOption(item: ShopItem, amount: Int, player: Player){
|
||||
val neededTokens = Item(12852,item.price * amount)
|
||||
if(player.inventory.containsItem(neededTokens)){
|
||||
|
|
@ -88,39 +105,41 @@ class FOGRewardsInterface : ComponentPlugin(){
|
|||
}
|
||||
|
||||
|
||||
val Druidic_Mage_Top = (ShopItem(12894, 300, 1))
|
||||
val Druidic_Mage_Hood = (ShopItem(12887, 100, 1))
|
||||
val Druidic_Mage_Bottom = (ShopItem(12901, 200, 1))
|
||||
val Combat_Robe_Top = (ShopItem(12971, 150, 1))
|
||||
val Combat_Robe_Hood = (ShopItem(12964, 50, 1))
|
||||
val Combat_Robe_Bottom = (ShopItem(12978, 100, 1))
|
||||
val Battle_Robe_Hood = (ShopItem(12866, 250, 1))
|
||||
val Battle_Robe_Top = (ShopItem(12873, 1500, 1))
|
||||
val Battle_Robe_Bottom = (ShopItem(12880, 1000, 1))
|
||||
val Green_Coif = (ShopItem(12936, 150, 1))
|
||||
val Blue_Coif = (ShopItem(12943, 200, 1))
|
||||
val Red_Coif = (ShopItem(12950, 300, 1))
|
||||
val Black_Coif = (ShopItem(12957, 500, 1))
|
||||
val Bronze_Gaunt = (ShopItem(12985, 15, 1))
|
||||
val Iron_Gaunt = (ShopItem(12988, 30, 1))
|
||||
val Steel_Gaunt = (ShopItem(12991, 50, 1))
|
||||
val Black_Gaunt = (ShopItem(12994, 75, 1))
|
||||
val Mithril_Gaunt = (ShopItem(12997, 100, 1))
|
||||
val Adamant_Gaunt = (ShopItem(13000, 150, 1))
|
||||
val Rune_Gaunt = (ShopItem(13003, 200, 1))
|
||||
val Dragon_Gaunt = (ShopItem(13006, 300, 1))
|
||||
val Addy_Spike = (ShopItem(12908, 50, 1))
|
||||
val Addy_Beserk = (ShopItem(12915, 100, 1))
|
||||
val Rune_Spike = (ShopItem(12922, 200, 1))
|
||||
val Rune_Beserk = (ShopItem(12929, 300, 1))
|
||||
val Air_Gloves = (ShopItem(12863, 75, 1))
|
||||
val Water_Gloves = (ShopItem(12864, 75, 1))
|
||||
val Earth_Gloves = (ShopItem(12865, 75, 1))
|
||||
val Irit_Gloves = (ShopItem(12856, 75, 1))
|
||||
val Avantoe_Gloves = (ShopItem(12857, 100, 1))
|
||||
val Kwuarm_Gloves = (ShopItem(12858, 200, 1))
|
||||
val Cadantine_Gloves = (ShopItem(12859, 200, 1))
|
||||
val Swordfish_Gloves = (ShopItem(12860, 200, 1))
|
||||
val Shark_Gloves = (ShopItem(12861, 200, 1))
|
||||
val Dragon_Gloves = (ShopItem(12862, 200, 1))
|
||||
val Druidic_Mage_Top = (ShopItem(12894, 300, 1))
|
||||
val Druidic_Mage_Hood = (ShopItem(12887, 100, 1))
|
||||
val Druidic_Mage_Bottom = (ShopItem(12901, 200, 1))
|
||||
val Combat_Robe_Top = (ShopItem(12971, 150, 1))
|
||||
val Combat_Robe_Hood = (ShopItem(12964, 50, 1))
|
||||
val Combat_Robe_Bottom = (ShopItem(12978, 100, 1))
|
||||
val Battle_Robe_Hood = (ShopItem(12866, 250, 1))
|
||||
val Battle_Robe_Top = (ShopItem(12873, 1500, 1))
|
||||
val Battle_Robe_Bottom = (ShopItem(12880, 1000, 1))
|
||||
val Green_Coif = (ShopItem(12936, 150, 1))
|
||||
val Blue_Coif = (ShopItem(12943, 200, 1))
|
||||
val Red_Coif = (ShopItem(12950, 300, 1))
|
||||
val Black_Coif = (ShopItem(12957, 500, 1))
|
||||
val Bronze_Gaunt = (ShopItem(12985, 15, 1))
|
||||
val Iron_Gaunt = (ShopItem(12988, 30, 1))
|
||||
val Steel_Gaunt = (ShopItem(12991, 50, 1))
|
||||
val Black_Gaunt = (ShopItem(12994, 75, 1))
|
||||
val Mithril_Gaunt = (ShopItem(12997, 100, 1))
|
||||
val Adamant_Gaunt = (ShopItem(13000, 150, 1))
|
||||
val Rune_Gaunt = (ShopItem(13003, 200, 1))
|
||||
val Dragon_Gaunt = (ShopItem(13006, 300, 1))
|
||||
val Addy_Spike = (ShopItem(12908, 50, 1))
|
||||
val Addy_Beserk = (ShopItem(12915, 100, 1))
|
||||
val Rune_Spike = (ShopItem(12922, 200, 1))
|
||||
val Rune_Beserk = (ShopItem(12929, 300, 1))
|
||||
val Air_Gloves = (ShopItem(12863, 75, 1))
|
||||
val Water_Gloves = (ShopItem(12864, 75, 1))
|
||||
val Earth_Gloves = (ShopItem(12865, 75, 1))
|
||||
val Irit_Gloves = (ShopItem(12856, 75, 1))
|
||||
val Avantoe_Gloves = (ShopItem(12857, 100, 1))
|
||||
val Kwuarm_Gloves = (ShopItem(12858, 200, 1))
|
||||
val Cadantine_Gloves = (ShopItem(12859, 200, 1))
|
||||
val Swordfish_Gloves = (ShopItem(12860, 200, 1))
|
||||
val Shark_Gloves = (ShopItem(12861, 200, 1))
|
||||
val Dragon_Gloves = (ShopItem(12862, 200, 1))
|
||||
|
||||
val shopsaleone = setOf(12863,12864,12865,12856,12857,12858,12859,12860,12861,12862)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue