mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-22 19:05:11 -06:00
Healer interface started
This commit is contained in:
parent
10b4a6a42a
commit
e2c117f5be
1 changed files with 62 additions and 0 deletions
|
|
@ -0,0 +1,62 @@
|
|||
package content.minigame.barbassault.arena
|
||||
|
||||
import content.minigame.barbassault.BarbRole
|
||||
import content.minigame.barbassault.lobby.CurrentTeam
|
||||
import content.minigame.barbassault.lobby.CurrentTeam.modelZoom
|
||||
import core.api.sendItemOnInterface
|
||||
import core.api.sendItemZoomOnInterface
|
||||
import core.api.setInterfaceModel
|
||||
import core.api.setInterfaceText
|
||||
import core.game.component.Component
|
||||
import core.game.component.ComponentDefinition
|
||||
import core.game.component.ComponentPlugin
|
||||
import core.game.node.entity.player.Player
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import org.rs09.consts.Components
|
||||
|
||||
// Todo find actual varbits for controlling the interface
|
||||
@Initializable
|
||||
class HealerInterface : ComponentPlugin() {
|
||||
override fun newInstance(arg: Any?): Plugin<Any> {
|
||||
ComponentDefinition.forId(HealerIface.ID).plugin = this
|
||||
return this
|
||||
}
|
||||
override fun open(player: Player?, component: Component?) {
|
||||
super.open(player, component)
|
||||
player ?: return
|
||||
val uiSlot = CurrentTeam.team[1]
|
||||
// setInterfaceText(player, "nameText", CurrentTeam.ID, uiSlot.name)
|
||||
setInterfaceText(player, "7", HealerIface.ID, 7)
|
||||
// setInterfaceText(player, "slot1name", HealerIface.ID, 3)//slot1name
|
||||
// setInterfaceText(player, "slot2name", HealerIface.ID, 9)//slot2Name
|
||||
// setInterfaceText(player, "slot3name", HealerIface.ID, 14)//slot3Name
|
||||
// setInterfaceText(player, "slot4name", HealerIface.ID, 19)//slot4Name
|
||||
setInterfaceText(player, "11", HealerIface.ID, 11)
|
||||
setInterfaceText(player, "12", HealerIface.ID, 12)
|
||||
// setInterfaceText(player, "6", CurrentTeam.ID, 6)
|
||||
|
||||
setInterfaceModel(player, 20578, HealerIface.ID, 24, modelZoom,572,0)
|
||||
sendItemZoomOnInterface(player, HealerIface.ID, 24, 10559,1940)
|
||||
//player.packetDispatch.sendRepositionOnInterface(HealerIface.ID, 24, 45, 46)
|
||||
}
|
||||
|
||||
override fun handle( player: Player?, component: Component?, opcode: Int, button: Int, slot: Int, itemId: Int): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
object HealerIface {
|
||||
const val ID = Components.BARBASSAULT_OVER_HEAL_488
|
||||
val modelZoom = 2372//1940
|
||||
val ROLE_MODEL_MAP = mapOf(BarbRole.ATTACKER to 20561, BarbRole.COLLECTOR to 20563, BarbRole.DEFENDER to 20566, BarbRole.HEALER to 20569)
|
||||
data class Slot(val roleChild: Int, val nameChild: Int, val hpChild:Int, val helpChild: Int)
|
||||
val team = listOf(
|
||||
Slot(16, 3,4,5),
|
||||
Slot(17, 9,10,8),
|
||||
Slot(18, 14,15,13),
|
||||
Slot(19, 19,20,18),
|
||||
)
|
||||
fun formatHp(current: Int, max: Int) = "HP $current/$max"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue