forked from 2009Scape/Server
Improved timing of pickpocket repeating, and allowed repeating even when caught
This commit is contained in:
parent
63c7fc3f70
commit
ee6f83eb7e
1 changed files with 6 additions and 3 deletions
|
|
@ -68,8 +68,8 @@ class ThievingListeners : InteractionListener {
|
|||
return@on true
|
||||
}
|
||||
|
||||
//Custom portion. Repeat pickpocket, only proceed every other tick
|
||||
if (GameWorld.ticks % 2 == 0) {
|
||||
//Custom portion. Repeat pickpocket, only proceed if it has been long enough since the last pickpocket action
|
||||
if (getAttribute(player, "pickpockettick", 0) <= GameWorld.ticks) {
|
||||
|
||||
player.animator.animate(PICKPOCKET_ANIM)
|
||||
val lootTable = pickpocketRoll(player, pickpocketData.low, pickpocketData.high, pickpocketData.table)
|
||||
|
|
@ -79,7 +79,9 @@ class ThievingListeners : InteractionListener {
|
|||
|
||||
playHurtAudio(player, 20)
|
||||
|
||||
stun(player, pickpocketData.stunTime)
|
||||
//stun(player, pickpocketData.stunTime)
|
||||
stun(player, 0)
|
||||
setAttribute(player, "pickpockettick", GameWorld.ticks + pickpocketData.stunTime)
|
||||
|
||||
player.impactHandler.manualHit(node.asNpc(),RandomFunction.random(pickpocketData.stunDamageMin,pickpocketData.stunDamageMax),ImpactHandler.HitsplatType.NORMAL)
|
||||
|
||||
|
|
@ -87,6 +89,7 @@ class ThievingListeners : InteractionListener {
|
|||
} else {
|
||||
playAudio(player, Sounds.PICK_2581)
|
||||
//player.lock(2)
|
||||
setAttribute(player, "pickpockettick", GameWorld.ticks + 2)
|
||||
lootTable.forEach { player.inventory.add(it) }
|
||||
player.skills.addExperience(Skills.THIEVING,pickpocketData.experience)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue