[Request] Lair

Game suggestions/implementation requests.
Post Reply
User avatar
Dempah
Froob
Posts: 34
Joined: Thu Nov 09, 2023 8:06 pm
Has thanked: 1 time
Been thanked: 7 times

[Request] Lair

Post by Dempah »

ground_drops.json (Egg spawn)

Code: Select all

  {
    "item_id": "1944",
    "loc_data": "{1,2453,4476,0,3604515}"
  },
npc_spawns.json (Black dragons are 1:1 for february 2009)

Code: Select all

  {
    "npc_id": "51",
    "loc_data": "{2439,4389,0,1,0}"
  },
  {
    "npc_id": "4673",
    "loc_data": "{2465,4363,0,1,1}"
  },
  {
    "npc_id": "4674",
    "loc_data": "{2459,4358,0,1,4}"
  },
  {
    "npc_id": "4675",
    "loc_data": "{2455,4371,0,1,1}"
  },
  {
    "npc_id": "4676",
    "loc_data": "{2447,4360,0,1,1}"
  },
npc_configs.json (missing)

Code: Select all

{
    "id": "51",
    "name": "Baby dragon",
    "examine": "Young but still dangerous.",
    "aggressive": "true",
    "bonuses": "124,130,137,184,176,128,168,145,104,54,0,0,0,0,0",
    "lifepoints": "160",
    "combat_audio": "407,405,406",
    "safespot": null,
    "attack_level": "102",
    "strength_level": "103",
    "defence_level": "112",
    "magic_level": "116",
    "range_level": "80",
    "melee_animation": "25",
    "defence_animation": "26",
    "magic_animation": "25",
    "death_animation": "28",
    "respawn_delay": "25",
    "weakness": "0"
  },
listener (After May, remove interactions with the egg)

Code: Select all


import core.game.node.scenery.Scenery as Object

class EvilChickenLairListener : InteractionListener {

	companion object {
		private const val CHICKEN_SHRINE  = Scenery.CHICKEN_SHRINE_12093
		private const val TUNNEL_ENTRANCE = Scenery.TUNNEL_ENTRANCE_12253
		private const val ENTRANCE_ROPE   = Scenery.TUNNEL_ENTRANCE_12254
		private const val ROPE_SCENERY    = Scenery.ROPE_12255
		private const val PORTAL_ENTRANCE = Scenery.PORTAL_12260

		private val REQUIRED_ITEMS = intArrayOf(Items.RAW_CHICKEN_2138, Items.EGG_1944)
		private const val ROPE = Items.ROPE_954

		private val TP_ANIM_START = Animation(2755)
		private val TP_ANIM_ENDED = Animation(2757)

		private val ENTER_LOCATION = location(2461, 4356, 0)
		private val EXIT_LOCATION  = location(2453, 4476, 0)
	}

	override fun defineListeners() {

		onUseWith(IntType.SCENERY, REQUIRED_ITEMS, CHICKEN_SHRINE) { player, used, _ ->
			if (!hasRequirement(player, "Tower of Life")) return@onUseWith false
			if(used.id != Items.RAW_CHICKEN_2138) {
				sendMessage(player, "Nice idea, but nothing interesting happens.")
				return@onUseWith false
			}
			if (!removeItem(player, used.asItem())) {
				sendMessage(player, "Nothing interesting happens.")
			} else {
				lock(player, 3)
				queueScript(player, 1, QueueStrength.SOFT) { stage: Int ->
					when (stage) {
						0 -> {
							animate(player, TP_ANIM_START)
							return@queueScript keepRunning(player)
						}

						1 -> {
							teleport(player, ENTER_LOCATION)
							animate(player, TP_ANIM_ENDED)
							return@queueScript stopExecuting(player)
						}

						else -> return@queueScript stopExecuting(player)
					}
				}
			}
			return@onUseWith true
		}

		on(PORTAL_ENTRANCE, IntType.SCENERY, "use") { player, _ ->
			teleport(player, EXIT_LOCATION)
			return@on true
		}

		onUseWith(IntType.SCENERY, ROPE, TUNNEL_ENTRANCE) { player, used, _ ->
			if (!removeItem(player, used.asItem())) {
				sendMessage(player, "Nothing interesting happens.")
			} else {
				replaceScenery(Object(TUNNEL_ENTRANCE, location(2455, 4380, 0)), ENTRANCE_ROPE, 80)
			}
			return@onUseWith true
		}

		on(ENTRANCE_ROPE, IntType.SCENERY, "climb-down") { player, _ ->
			teleport(player, location(2441, 4381, 0))
			return@on true
		}

		on(ROPE_SCENERY, IntType.SCENERY, "climb-up") { player, _ ->
			teleport(player, location(2457, 4380, 0))
			return@on true
		}
	}

}
I added in order to save someone time.

@Edit. Fixed.
quit.
Post Reply