Fixed drill sergeant completion reward drop bug
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package content.global.ame.events.drilldemon
|
||||
|
||||
import core.api.*
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.zone.ZoneBorders
|
||||
@@ -18,26 +19,26 @@ object DrillDemonUtils {
|
||||
val DD_SIGN_JUMP = 3
|
||||
val DD_CORRECT_OFFSET = "/save:drilldemon:offset"
|
||||
val DD_CORRECT_COUNTER = "/save:drilldemon:numcorrect"
|
||||
val DD_AREA = ZoneBorders(3158,4817, 3168, 4823)
|
||||
val DD_AREA = ZoneBorders(3158, 4817, 3168, 4823)
|
||||
val DD_NPC = NPCs.SERGEANT_DAMIEN_2790
|
||||
|
||||
fun teleport(player: Player){
|
||||
setAttribute(player, DD_KEY_RETURN_LOC,player.location)
|
||||
fun teleport(player: Player) {
|
||||
setAttribute(player, DD_KEY_RETURN_LOC, player.location)
|
||||
teleport(player, Location.create(3163, 4819, 0))
|
||||
player.interfaceManager.closeDefaultTabs()
|
||||
setComponentVisibility(player, 548, 69, true)
|
||||
setComponentVisibility(player, 746, 12, true)
|
||||
}
|
||||
|
||||
fun changeSignsAndAssignTask(player: Player){
|
||||
fun changeSignsAndAssignTask(player: Player) {
|
||||
setVarp(player, DD_SIGN_VARP, 0)
|
||||
val tempList = arrayListOf(DD_SIGN_JOG, DD_SIGN_JUMP, DD_SIGN_PUSHUP, DD_SIGN_SITUP).shuffled().toMutableList()
|
||||
val tempOffsetList = arrayListOf(1335, 1336, 1337, 1338).shuffled().toMutableList()
|
||||
val task = tempList.random()
|
||||
val taskOffset = tempOffsetList.random()
|
||||
|
||||
setAttribute(player, DD_KEY_TASK,task)
|
||||
setAttribute(player, DD_CORRECT_OFFSET,taskOffset)
|
||||
setAttribute(player, DD_KEY_TASK, task)
|
||||
setAttribute(player, DD_CORRECT_OFFSET, taskOffset)
|
||||
|
||||
tempList.remove(task)
|
||||
tempOffsetList.remove(taskOffset)
|
||||
@@ -47,7 +48,7 @@ object DrillDemonUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun getVarbitForId(id: Int): Int{
|
||||
fun getVarbitForId(id: Int): Int {
|
||||
return when (id) {
|
||||
10076 -> 1335
|
||||
10077 -> 1336
|
||||
@@ -57,7 +58,7 @@ object DrillDemonUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun getMatTask(id: Int, player: Player): Int{
|
||||
fun getMatTask(id: Int, player: Player): Int {
|
||||
return getVarbit(player, getVarbitForId(id))
|
||||
}
|
||||
|
||||
@@ -85,6 +86,7 @@ object DrillDemonUtils {
|
||||
}
|
||||
|
||||
fun reward(player: Player) {
|
||||
queueScript(player, 2, QueueStrength.SOFT) {
|
||||
val hasHat = hasAnItem(player, Items.CAMO_HELMET_6656).container != null
|
||||
val hasShirt = hasAnItem(player, Items.CAMO_TOP_6654).container != null
|
||||
val hasPants = hasAnItem(player, Items.CAMO_BOTTOMS_6655).container != null
|
||||
@@ -94,5 +96,8 @@ object DrillDemonUtils {
|
||||
!hasPants -> addItemOrDrop(player, Items.CAMO_BOTTOMS_6655)
|
||||
else -> addItemOrDrop(player, Items.COINS_995, 500)
|
||||
}
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package content.global.ame.events.drilldemon
|
||||
|
||||
import core.api.*
|
||||
import core.api.getAttribute
|
||||
import core.api.sendItemDialogue
|
||||
import core.api.unlock
|
||||
import core.game.dialogue.DialogueFile
|
||||
import core.game.dialogue.FacialExpression
|
||||
import core.game.node.entity.npc.NPC
|
||||
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
Reference in New Issue
Block a user