mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-28 05:45:10 -06:00
PENANCE_HEALER_5242 stats added,
Penance healers can be posioned by Healer
This commit is contained in:
parent
f6936ab2dc
commit
a98462b6cf
4 changed files with 132 additions and 4 deletions
|
|
@ -81687,16 +81687,28 @@
|
|||
"aggressive": "true"
|
||||
},
|
||||
{
|
||||
"attack_level": "9",
|
||||
"strength_level": "8",
|
||||
"defence_level": "9",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5238",
|
||||
"defence_animation": "5105",
|
||||
"death_animation": "5106",
|
||||
"lifepoints": "27",
|
||||
"melee_animation": "5107",
|
||||
"range_animation": "5107",
|
||||
"attack_speed": "4",
|
||||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "32",
|
||||
"attack_level": "13",
|
||||
"strength_level": "15",
|
||||
"defence_level": "14",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5239",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81707,6 +81719,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "37",
|
||||
"attack_level": "20",
|
||||
"strength_level": "18",
|
||||
"defence_level": "19",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5240",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81717,6 +81735,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "43",
|
||||
"attack_level": "22",
|
||||
"strength_level": "23",
|
||||
"defence_level": "21",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5241",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81727,6 +81751,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "49",
|
||||
"attack_level": "26",
|
||||
"strength_level": "27",
|
||||
"defence_level": "25",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5242",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81737,6 +81767,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "55",
|
||||
"attack_level": "30",
|
||||
"strength_level": "32",
|
||||
"defence_level": "28",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5243",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81747,6 +81783,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "60",
|
||||
"attack_level": "33",
|
||||
"strength_level": "36",
|
||||
"defence_level": "34",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5244",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81757,6 +81799,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "67",
|
||||
"attack_level": "40",
|
||||
"strength_level": "38",
|
||||
"defence_level": "36",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5245",
|
||||
"defence_animation": "5105",
|
||||
|
|
@ -81767,6 +81815,12 @@
|
|||
"magic_animation": "5107"
|
||||
},
|
||||
{
|
||||
"lifepoints": "76",
|
||||
"attack_level": "40",
|
||||
"strength_level": "44",
|
||||
"defence_level": "38",
|
||||
"magic_level": "1",
|
||||
"range_level": "1",
|
||||
"name": "Penance Healer",
|
||||
"id": "5246",
|
||||
"defence_animation": "5105",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,19 @@
|
|||
package content.minigame.barbassault
|
||||
|
||||
import content.minigame.barbassault.arena.BarbassaultSession
|
||||
import core.api.getTimer
|
||||
import core.api.hasTimerActive
|
||||
import core.api.registerTimer
|
||||
import core.api.spawnTimer
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.ImpactHandler
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.system.timer.PersistTimer
|
||||
import core.game.system.timer.RSTimer
|
||||
import core.game.system.timer.TimerFlag
|
||||
import core.game.system.timer.impl.Poison
|
||||
import core.game.system.timer.impl.PoisonImmunity
|
||||
import core.tools.secondsToTicks
|
||||
|
||||
//thank you Ceikry
|
||||
|
||||
|
|
@ -220,3 +232,36 @@ fun getBARoleForPlayer(player: Player): BarbRole? {
|
|||
* @return `true` if the player has the specified role, otherwise `false`.
|
||||
*/
|
||||
fun isBARole(player: Player, role: BarbRole) = getBARoleForPlayer(player) == role
|
||||
|
||||
|
||||
class BAPoison : PersistTimer (secondsToTicks(3), "BA-poison", flags = arrayOf(TimerFlag.ClearOnDeath)) {
|
||||
lateinit var damageSource: Entity
|
||||
var severity = 0
|
||||
|
||||
override fun run(entity: Entity): Boolean {
|
||||
entity.impactHandler.manualHit(damageSource,(severity + 4) / 5,ImpactHandler.HitsplatType.POISON)
|
||||
severity--
|
||||
return severity > 0
|
||||
}
|
||||
|
||||
override fun getTimer(vararg args: Any): RSTimer {
|
||||
val timer = BAPoison()
|
||||
timer.damageSource = args[0] as? Entity ?: return timer
|
||||
timer.severity = args[1] as? Int ?: return timer
|
||||
return timer
|
||||
}
|
||||
}
|
||||
|
||||
fun applyBAPoison (entity: Entity, source: Entity, severity: Int) {
|
||||
val existingTimer = getTimer<BAPoison>(entity)
|
||||
if (existingTimer != null) {
|
||||
if (existingTimer.severity > severity) {
|
||||
return
|
||||
} else {
|
||||
existingTimer.severity = severity
|
||||
existingTimer.damageSource = source
|
||||
}
|
||||
} else {
|
||||
registerTimer(entity, spawnTimer<BAPoison>(source, severity))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package content.minigame.barbassault.arena
|
||||
|
||||
|
||||
import content.global.ame.events.evilbob.EvilBobUtils
|
||||
import content.minigame.barbassault.*
|
||||
import content.minigame.barbassault.BAGraphics.BLUE_EGG_BREAK_875
|
||||
import content.minigame.barbassault.BAGraphics.GREEN_EGG_BREAK_873
|
||||
import content.minigame.barbassault.BAGraphics.RED_EGG_BREAK_874
|
||||
import content.minigame.barbassault.arena.BarbAssEvent.EggCollected
|
||||
import content.minigame.barbassault.arena.BarbAssEvent.HitpointsHealed
|
||||
import content.minigame.barbassault.arena.BarbAssEvent.WrongPoisonUsed
|
||||
import content.minigame.barbassault.arena.BarbassaultSession.AttackerStyle
|
||||
import content.minigame.barbassault.arena.npcs.PENANCE_HEALER_IDS
|
||||
import content.minigame.barbassault.arena.scenery.EggCannon
|
||||
import content.minigame.barbassault.arena.scenery.EggCannon.Companion.loadEggHopper
|
||||
import content.minigame.barbassault.arena.scenery.EggCannon.Companion.loadHopperEggs
|
||||
|
|
@ -18,8 +21,10 @@ import core.game.interaction.IntType
|
|||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.Node
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.BattleState
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import core.game.node.entity.combat.ImpactHandler
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.info.LogType
|
||||
|
|
@ -27,6 +32,7 @@ import core.game.node.entity.player.info.PlayerMonitor
|
|||
import core.game.node.item.GroundItem
|
||||
import core.game.node.item.Item
|
||||
import core.game.system.task.Pulse
|
||||
import core.game.system.timer.impl.Poison
|
||||
import core.game.world.GameWorld.Pulser
|
||||
import core.game.world.map.Direction
|
||||
import core.game.world.map.Location
|
||||
|
|
@ -146,7 +152,20 @@ class BarbassaultArenaListener : InteractionListener {
|
|||
}
|
||||
return@on true
|
||||
}
|
||||
|
||||
onUseWith(IntType.NPC, intArrayOf(Items.POISONED_TOFU_10539,Items.POISONED_MEAT_10541,Items.POISONED_WORMS_10540), *PENANCE_HEALER_IDS) { player, used, target ->
|
||||
val session = getBASession(player) ?: return@onUseWith true
|
||||
val currentCall = (session.roleCalls[BarbRole.HEALER] as? BarbassaultSession.HealerCall)?.required?.itemId()
|
||||
removeItem(player,used)
|
||||
if (used.id == currentCall) {
|
||||
//todo fine tune the severity
|
||||
applyBAPoison(target as Entity,player,20)
|
||||
target.impactHandler.manualHit ( player,4, ImpactHandler.HitsplatType.POISON )
|
||||
return@onUseWith true
|
||||
}
|
||||
sendMessage(player,"that's the wrong type of poisoned food to use! Penalty!")
|
||||
session.eventBus.emit(WrongPoisonUsed(player))
|
||||
return@onUseWith true
|
||||
}
|
||||
onUseWithPlayer(*All_HEALING_VIALS) { player, _, target ->
|
||||
target as Player
|
||||
//todo find Healing sound
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ import content.minigame.barbassault.BarbRole
|
|||
import content.minigame.barbassault.arena.BarbAssEvent
|
||||
import content.minigame.barbassault.getBASession
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.npc.NPCBehavior
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.system.config.NPCConfigParser
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
val PENANCE_HEALER_IDS = listOf(
|
||||
val PENANCE_HEALER_IDS = intArrayOf(
|
||||
//NPCs.PENANCE_HEALER_5043,//tut
|
||||
NPCs.PENANCE_HEALER_5238,
|
||||
NPCs.PENANCE_HEALER_5239,
|
||||
|
|
@ -21,18 +24,25 @@ val PENANCE_HEALER_IDS = listOf(
|
|||
NPCs.PENANCE_HEALER_5245,
|
||||
NPCs.PENANCE_HEALER_5246
|
||||
)
|
||||
class PenanceHealerNPC : NPCBehavior(*PENANCE_HEALER_IDS.toIntArray()) {
|
||||
class PenanceHealerNPC : NPCBehavior(*PENANCE_HEALER_IDS) {
|
||||
override fun getXpMultiplier(self: NPC, attacker: Entity): Double {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
|
||||
override fun onCreation (self: NPC) {
|
||||
self.setAttribute("barbass-role", BarbRole.HEALER)
|
||||
self.isWalks = true
|
||||
self.walkRadius = 24
|
||||
// self.isIgnoreAttackRestrictions(self)
|
||||
//self.getSkills().setStaticLevel(Skills.HITPOINTS,15)
|
||||
|
||||
}
|
||||
//sendMessage(player,"that's the wrong type of poisoned food to use! Penalty!")
|
||||
override fun tick(self: NPC): Boolean {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
override fun onDeathFinished(self: NPC, killer: Entity) {
|
||||
super.onDeathFinished(self, killer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue