Refactored lunar spellbook code

Rewrote humidify spell
This commit is contained in:
bushtail
2023-09-07 06:47:10 +00:00
committed by Ryan
parent 6cd35dc482
commit 42f0b7c3b2
5 changed files with 346 additions and 281 deletions
@@ -1,6 +1,7 @@
package content.global.skill.magic package content.global.skill.magic
import core.api.playAudio import core.api.playAudio
import core.api.playGlobalAudio
import core.api.setAttribute import core.api.setAttribute
import core.cache.def.impl.ItemDefinition import core.cache.def.impl.ItemDefinition
import core.game.node.Node import core.game.node.Node
@@ -73,11 +74,38 @@ abstract class SpellListener(val bookName: String) : Listener {
player.skills.addExperience(Skills.MAGIC,amount) player.skills.addExperience(Skills.MAGIC,amount)
} }
fun visualizeSpell(player: Player,anim:Animation,gfx: Graphics,soundID: Int = -1){ /**
* @param player The player to visualize the spell on
* @param anim The animation object. I.e. Animation(Animations.LUNAR_SPELLBOOK_*)
* @param gfx The graphics object. I.e. Graphics(Graphics.LUNAR_SPELLBOOK_*, height in int)
* @param soundID The sound to play, either raw integer or from the Sounds ConstLib. Defaults to -1 (Nothing).
* @param delay The delay that should be applied before the sound plays, defaults to 0.
* @param global Whether the sound should be played globally instead of per-player. Defaults to true.
*/
fun visualizeSpell(player: Player, anim: Animation, gfx: Graphics, soundID: Int = -1, delay: Int = 0, global: Boolean = true){
if(player.getAttribute("tablet-spell",false)) return if(player.getAttribute("tablet-spell",false)) return
player.visualize(anim, gfx) player.visualize(anim, gfx)
if(soundID != -1){ if(soundID != -1){
playAudio(player, soundID) if(global) playGlobalAudio(player.location, soundID, delay)
else playAudio(player, soundID, delay)
}
}
/**
* @param player The player to visualize the spell on
* @param anim The integer ID of the animation, found in the Animations ConstLib.
* @param gfx The integer ID of the graphics to show, found in the Graphics ConstLib.
* @param height How high the graphics should display above the ground(?). Defaults to 0.
* @param soundID The sound to play, either raw integer or from the Sounds ConstLib. Defaults to -1 (Nothing).
* @param delay The delay that should be applied before the sound plays, defaults to 0.
* @param global Whether the sound should be played globally instead of per-player. Defaults to true.
*/
fun visualizeSpell(player: Player, anim: Int, gfx: Int, height: Int = 0, soundID: Int = -1, delay: Int = 0, global: Boolean = true) {
if(player.getAttribute("tablet-spell",false)) return
player.visualize(Animation(anim), Graphics(gfx, height))
if(soundID != -1){
if(global) playGlobalAudio(player.location, soundID, delay)
else playAudio(player, soundID, delay)
} }
} }
@@ -1,93 +0,0 @@
package content.global.skill.magic.lunar;
import core.game.node.entity.combat.spell.MagicSpell;
import core.game.node.entity.combat.spell.Runes;
import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.combat.spell.SpellType;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.node.item.Item;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Initializable;
import core.plugin.Plugin;
import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.playGlobalAudio;
/**
* Represents the humidify spell.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class HumidifySpell extends MagicSpell {
/**
* Represents the animation of this graphics.
*/
private static final Animation ANIMATION = new Animation(6294);
/**
* Repesents the graphick, next spells of this spell.
*/
private static final Graphics GRAPHIC = new Graphics(1061);
/**
* Represents the empty vessels.
*/
private static final int[] EMPTY = { 229, 1831, 1829, 1827, 1825, 1925, 1923, 1935, 5331, 5332, 5333, 5334, 5335, 5337, 5338, 5339, 6667, 7688, 731, 1980, 434 };
/**
* Represents the full vessels.
*/
private static final int[] FULL = { 227, 1823, 1823, 1823, 1823, 1929, 1921, 1937, 5340, 5340, 5340, 5340, 5340, 5340, 5340, 5340, 6668, 7690, 732, 4458, 1761 };
/**
* Constructs a new {@code CureOtherSpell} {@code Object}.
*/
public HumidifySpell() {
super(SpellBook.LUNAR, 68, 65, ANIMATION, null, null, new Item[] { new Item(Runes.ASTRAL_RUNE.getId(), 1), new Item(Runes.WATER_RUNE.getId(), 3), new Item(Runes.FIRE_RUNE.getId(), 1) });
}
@Override
public Plugin<SpellType> newInstance(SpellType arg) throws Throwable {
SpellBook.LUNAR.register(7, this);
return this;
}
@Override
public boolean cast(Entity entity, Node target) {
Player p = (Player) entity;
boolean good = false;
for (int i = 0; i < EMPTY.length; i++) {
if (p.getInventory().contains(EMPTY[i], 1)) {
good = true;
break;
}
}
if (!good) {
p.sendMessage("You need something which holds water in order to do this spell.");
return false;
}
if (!super.meetsRequirements(p, true, true)) {
return false;
}
p.lock(ANIMATION.getDuration() + 1);
p.animate(ANIMATION);
p.graphics(GRAPHIC);
playGlobalAudio(p.getLocation(), Sounds.LUNAR_HUMIDIFY_3614, 20);
for (int k = 0; k < 28; k++) {
for (int i = 0; i < 21; i++) {
if (p.getInventory().contains(EMPTY[i], 1)) {
if (p.getInventory().remove(new Item(EMPTY[i]))) {
p.getInventory().add(new Item(FULL[i]));
}
}
}
}
return true;
}
}
@@ -3,41 +3,8 @@ package content.global.skill.magic.lunar
import core.api.* import core.api.*
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.node.item.Item
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import org.rs09.consts.Items import org.rs09.consts.Items
// Animations
val BAKE_PIE_ANIM = Animation(4413)
val STATSPY_ANIM = Animation(6293)
val CURE_PLANT_ANIM = Animation(4409)
val NPC_CONTACT_ANIM = Animation(4413)
val PLANK_MAKE_ANIM = Animation(6298)
val STRING_JEWELLERY_ANIM = Animation(4412)
val SUPERGLASS_MAKE_ANIM = Animation(4413)
val FERTILE_SOIL_ANIM = Animation(4413)
val CURE_ME_ANIM = Animation(4411)
val CURE_GROUP_ANIM = Animation(4409)
val CURE_OTHER_ANIM = Animation(4411)
val ENERGY_TRANSFER_ANIM = Animation(4411)
val HUNTER_KIT_ANIM = Animation(6303)
// Graphics
val BAKE_PIE_GFX = Graphics(746,75)
val STATSPY_GFX = Graphics(1059)
val CURE_PLANT_GFX = Graphics(742,100)
val NPC_CONTACT_GFX = Graphics(730,130)
val PLANK_MAKE_GFX = Graphics(1063, 120)
val STRING_JEWELLERY_GFX = Graphics(728, 100)
val SUPERGLASS_MAKE_GFX = Graphics(729, 120)
val FERTILE_SOIL_GFX = Graphics(724)
val CURE_ME_GFX = Graphics(731, 90)
val CURE_GROUP_GFX = Graphics(751, 130)
val CURE_OTHER_GFX = Graphics(738, 130)
val ENERGY_TRANSFER_GFX = Graphics(738, 90)
val HUNTER_KIT_GFX = Graphics(1024)
private val HunterKitContents = intArrayOf( private val HunterKitContents = intArrayOf(
Items.NOOSE_WAND_10150, Items.NOOSE_WAND_10150,
Items.BUTTERFLY_NET_10010, Items.BUTTERFLY_NET_10010,
@@ -62,7 +29,7 @@ class HunterKitInteraction : InteractionListener {
} }
} }
enum class JewelleryString(val unstrung: Int, val strung: Int) { enum class StringJewelleryItems(val unstrung: Int, val strung: Int) {
GOLD(Items.GOLD_AMULET_1673, Items.GOLD_AMULET_1692), GOLD(Items.GOLD_AMULET_1673, Items.GOLD_AMULET_1692),
SAPPHIRE(Items.SAPPHIRE_AMULET_1675, Items.SAPPHIRE_AMULET_1694), SAPPHIRE(Items.SAPPHIRE_AMULET_1675, Items.SAPPHIRE_AMULET_1694),
EMERALD(Items.EMERALD_AMULET_1677, Items.EMERALD_AMULET_1696), EMERALD(Items.EMERALD_AMULET_1677, Items.EMERALD_AMULET_1696),
@@ -74,7 +41,7 @@ enum class JewelleryString(val unstrung: Int, val strung: Int) {
HOLY(Items.UNSTRUNG_SYMBOL_1714, Items.UNBLESSED_SYMBOL_1716), HOLY(Items.UNSTRUNG_SYMBOL_1714, Items.UNBLESSED_SYMBOL_1716),
UNHOLY(Items.UNSTRUNG_EMBLEM_1720, Items.UNPOWERED_SYMBOL_1722); UNHOLY(Items.UNSTRUNG_EMBLEM_1720, Items.UNPOWERED_SYMBOL_1722);
companion object { companion object {
val productOfString = values().associate { it.unstrung to it.strung } private val productOfString = values().associate { it.unstrung to it.strung }
fun forId(id: Int): Int { fun forId(id: Int): Int {
return productOfString[id]!! return productOfString[id]!!
} }
@@ -85,3 +52,36 @@ enum class JewelleryString(val unstrung: Int, val strung: Int) {
} }
} }
enum class HumidifyItems(val empty: Int, val full: Int) {
VIAL(Items.VIAL_229, Items.VIAL_OF_WATER_227),
WATERSKIN0(Items.WATERSKIN0_1831, Items.WATERSKIN4_1823),
WATERSKIN1(Items.WATERSKIN1_1829, Items.WATERSKIN4_1823),
WATERSKIN2(Items.WATERSKIN2_1827, Items.WATERSKIN4_1823),
WATERSKIN3(Items.WATERSKIN3_1825, Items.WATERSKIN4_1823),
BUCKET(Items.BUCKET_1925, Items.BUCKET_OF_WATER_1929),
BOWL(Items.BOWL_1923, Items.BOWL_OF_WATER_1921),
JUG(Items.JUG_1935, Items.JUG_OF_WATER_1937),
WATERING_CAN0(Items.WATERING_CAN_5331, Items.WATERING_CAN8_5340),
WATERING_CAN1(Items.WATERING_CAN1_5333, Items.WATERING_CAN8_5340),
WATERING_CAN2(Items.WATERING_CAN2_5334, Items.WATERING_CAN8_5340),
WATERING_CAN3(Items.WATERING_CAN3_5335, Items.WATERING_CAN8_5340),
WATERING_CAN4(Items.WATERING_CAN4_5336, Items.WATERING_CAN8_5340),
WATERING_CAN5(Items.WATERING_CAN5_5337, Items.WATERING_CAN8_5340),
WATERING_CAN6(Items.WATERING_CAN6_5338, Items.WATERING_CAN8_5340),
WATERING_CAN7(Items.WATERING_CAN7_5339, Items.WATERING_CAN8_5340),
FISHBOWL(Items.FISHBOWL_6667, Items.FISHBOWL_6668),
KETTLE(Items.KETTLE_7688, Items.FULL_KETTLE_7690),
ENCHANTED_VIAL(Items.ENCHANTED_VIAL_731, Items.HOLY_WATER_732),
CUP(Items.EMPTY_CUP_1980, Items.CUP_OF_WATER_4458);
companion object {
private val productOfFill = values().associate { it.empty to it.full }
fun forId(id: Int): Int {
return productOfFill[id]!!
}
fun emptyContains(id: Int): Boolean {
return productOfFill.contains(id)
}
}
}
@@ -22,126 +22,40 @@ import core.game.system.task.Pulse
import core.game.world.map.Location import core.game.world.map.Location
import core.game.world.map.RegionManager import core.game.world.map.RegionManager
import core.game.world.repository.Repository import core.game.world.repository.Repository
import core.game.world.update.flag.context.Animation
import core.tools.RandomFunction import core.tools.RandomFunction
import org.rs09.consts.Components import org.rs09.consts.*
import org.rs09.consts.Items
import org.rs09.consts.Sounds
import kotlin.math.floor import kotlin.math.floor
class LunarListeners : SpellListener("lunar"), Commands { class LunarListeners : SpellListener("lunar"), Commands {
override fun defineListeners() { override fun defineListeners() {
// Level 0
onCast(Lunar.HOME_TELEPORT, NONE) { player, _ -> onCast(Lunar.HOME_TELEPORT, NONE) { player, _ ->
requires(player) requires(player)
player.teleporter.send(Location.create(2100, 3914, 0),TeleportManager.TeleportType.HOME) player.teleporter.send(Location.create(2100, 3914, 0),TeleportManager.TeleportType.HOME)
setDelay(player,true) setDelay(player,true)
} }
onCast(Lunar.MOONCLAN_TELEPORT, NONE) { player, _ -> // Level 65
requires(player,69, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,2)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,66.0, Location.create(2111, 3916, 0))
}
onCast(Lunar.MOONCLAN_GR_TELEPORT, NONE) { player, _ ->
requires(player,70, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,4)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,67.0,"Moonclan Island",Location.create(2111, 3916, 0))
}
onCast(Lunar.OURANIA_TELEPORT, NONE) { player, _ ->
requires(player,71, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,6)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,69.0, Location.create(2469, 3247, 0))
}
onCast(Lunar.WATERBIRTH_TELEPORT, NONE){ player, _ ->
requires(player,72, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,71.0, Location.create(2527, 3739, 0))
}
onCast(Lunar.WATERBIRTH_GR_TELEPORT, NONE) { player, _ ->
requires(player,73, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555,5)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,72.0,"Waterbirth Island", Location.create(2527, 3739, 0))
}
onCast(Lunar.BARBARIAN_TELEPORT, NONE) { player, _ ->
requires(player,75, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,3)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,76.0, Location.create(2544, 3572, 0))
}
onCast(Lunar.BARBARIAN_GR_TELEPORT, NONE) { player, _ ->
requires(player,77, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,6)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,77.0,"Barbarian Outpost", Location.create(2544, 3572, 0))
}
onCast(Lunar.KHAZARD_TELEPORT, NONE) { player, _ ->
requires(player,78, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,4)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,80.0, Location.create(2656, 3157, 0))
}
onCast(Lunar.KHAZARD_GR_TELEPORT, NONE) { player, _ ->
requires(player,79, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,8)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,81.0, "Port Khazard", Location.create(2656, 3157, 0))
}
onCast(Lunar.FISHING_GUILD_TELEPORT, NONE) { player, _ ->
requires(player,85, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,89.0, Location.create(2611, 3393, 0))
}
onCast(Lunar.FISHING_GUILD_GR_TELEPORT, NONE) { player, _ ->
requires(player,86, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,14)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,90.0,"Fishing Guild", Location.create(2611, 3393, 0))
}
onCast(Lunar.CATHERBY_TELEPORT, NONE) { player, _ ->
requires(player,87, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,92.0, Location.create(2804, 3433, 0))
}
onCast(Lunar.CATHERBY_GR_TELEPORT, NONE) { player, _ ->
requires(player,88, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,15)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,93.0,"Catherby", Location.create(2804, 3433, 0))
}
onCast(Lunar.ICE_PLATEAU_TELEPORT, NONE) { player, _ ->
requires(player,89, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,8)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,96.0, Location.create(2972, 3873, 0))
}
onCast(Lunar.ICE_PLATEAU_GR_TELEPORT, NONE) { player, _ ->
requires(player,90, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,16)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,99.0, "Ice Plateau", Location.create(2972, 3873, 0))
}
onCast(Lunar.BAKE_PIE, NONE) { player, _ -> onCast(Lunar.BAKE_PIE, NONE) { player, _ ->
requires(player,65, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.FIRE_RUNE_554,5), Item(Items.WATER_RUNE_555,4))) requires(player,65, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.FIRE_RUNE_554,5), Item(Items.WATER_RUNE_555,4)))
bakePie(player) bakePie(player)
} }
onCast(Lunar.MONSTER_EXAMINE, NPC) { player, node -> // Level 66
requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.MIND_RUNE_558), Item(Items.COSMIC_RUNE_564)))
examineMonster(player,node!!.asNpc())
}
onCast(Lunar.CURE_PLANT, OBJECT) { player, node -> onCast(Lunar.CURE_PLANT, OBJECT) { player, node ->
requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.EARTH_RUNE_557,8))) requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.EARTH_RUNE_557,8)))
curePlant(player,node!!.asScenery()) curePlant(player,node!!.asScenery())
} }
// Level 66
onCast(Lunar.MONSTER_EXAMINE, NPC) { player, node ->
requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.MIND_RUNE_558), Item(Items.COSMIC_RUNE_564)))
examineMonster(player,node!!.asNpc())
}
// Level 67
onCast(Lunar.NPC_CONTACT, NONE) { player, _ -> onCast(Lunar.NPC_CONTACT, NONE) { player, _ ->
requires(player,67, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.COSMIC_RUNE_564), Item(Items.AIR_RUNE_556,2))) requires(player,67, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.COSMIC_RUNE_564), Item(Items.AIR_RUNE_556,2)))
player.interfaceManager.open(Component(429)) player.interfaceManager.open(Component(429))
@@ -149,49 +63,223 @@ class LunarListeners : SpellListener("lunar"), Commands {
removeRunes(player) removeRunes(player)
addXP(player,63.0) addXP(player,63.0)
setDelay(player,false) setDelay(player,false)
visualizeSpell(player, NPC_CONTACT_ANIM, NPC_CONTACT_GFX,3618) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_NPC_CONTACT_4413, Graphics.LUNAR_SPELLBOOK_NPC_CONTACT_728, 130,3618)
} }
} }
onCast(Lunar.PLANK_MAKE, ITEM) { player, node -> // Level 68
requires(player, 86, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.NATURE_RUNE_561, 1), Item(Items.EARTH_RUNE_557, 15))) onCast(Lunar.CURE_OTHER, PLAYER) { player, node ->
plankMake(player, node!!.asItem()) node?.let { cureOther(player, node) }
} }
onCast(Lunar.STRING_JEWELLERY, NONE) { player, _ -> // Level 68
requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) onCast(Lunar.HUMIDIFY, NONE) { player, _ ->
stringJewellery(player) requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.WATER_RUNE_555, 3), Item(Items.FIRE_RUNE_554, 1)))
humidify(player)
} }
// Level 69
onCast(Lunar.MOONCLAN_TELEPORT, NONE) { player, _ ->
requires(player,69, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,2)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,66.0, Location.create(2111, 3916, 0))
}
// Level 70
onCast(Lunar.MOONCLAN_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,70, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,4)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,67.0,"Moonclan Island",Location.create(2111, 3916, 0))
}
// Level 71
onCast(Lunar.OURANIA_TELEPORT, NONE) { player, _ ->
requires(
player,
71,
arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.EARTH_RUNE_557, 6))
)
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player, 69.0, Location.create(2469, 3247, 0))
}
// Level 71
onCast(Lunar.CURE_ME, NONE) { player, _ ->
cureMe(player)
}
// Level 71
onCast(Lunar.HUNTER_KIT, NONE) { player, _ ->
if(freeSlots(player) == 0) sendMessage(player, "Not enough inventory space!").also { return@onCast }
hunterKit(player)
}
// Level 72
onCast(Lunar.WATERBIRTH_TELEPORT, NONE){ player, _ ->
requires(player,72, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,71.0, Location.create(2527, 3739, 0))
}
// Level 73
onCast(Lunar.WATERBIRTH_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,73, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555,5)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,72.0,"Waterbirth Island", Location.create(2527, 3739, 0))
}
// Level 74
onCast(Lunar.CURE_GROUP, NONE) { player, _ ->
cureGroup(player)
}
// Level 75
/**
* Stat Spy
*/
// Level 75
onCast(Lunar.BARBARIAN_TELEPORT, NONE) { player, _ ->
requires(player,75, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,3)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,76.0, Location.create(2544, 3572, 0))
}
// Level 76
onCast(Lunar.BARBARIAN_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,77, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,6)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,77.0,"Barbarian Outpost", Location.create(2544, 3572, 0))
}
// Level 77
onCast(Lunar.SUPERGLASS_MAKE, NONE) { player, _ -> onCast(Lunar.SUPERGLASS_MAKE, NONE) { player, _ ->
requires(player, 77, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.FIRE_RUNE_554, 6), Item(Items.AIR_RUNE_556, 10))) requires(player, 77, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.FIRE_RUNE_554, 6), Item(Items.AIR_RUNE_556, 10)))
superglassMake(player) superglassMake(player)
} }
// Level 78
onCast(Lunar.KHAZARD_TELEPORT, NONE) { player, _ ->
requires(player,78, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,4)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,80.0, Location.create(2656, 3157, 0))
}
// Level 79
onCast(Lunar.KHAZARD_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,79, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,8)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,81.0, "Port Khazard", Location.create(2656, 3157, 0))
}
// Level 79
/**
* Dream
*/
// Level 80
onCast(Lunar.STRING_JEWELLERY, NONE) { player, _ ->
requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5)))
stringJewellery(player)
}
// Level 81
/**
* Stat Restore Pot Share
*/
// Level 82
/**
* Magic Imbue
*/
// Level 83
onCast(Lunar.FERTILE_SOIL, OBJECT) { player, node -> onCast(Lunar.FERTILE_SOIL, OBJECT) { player, node ->
node?.let { fertileSoil(player, node.asScenery()) } node?.let { fertileSoil(player, node.asScenery()) }
} }
onCast(Lunar.CURE_ME, NONE) { player, _ -> // Level 84
cureMe(player) /**
* Boost Potion Share
*/
// Level 85
onCast(Lunar.FISHING_GUILD_TELEPORT, NONE) { player, _ ->
requires(player,85, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,89.0, Location.create(2611, 3393, 0))
} }
onCast(Lunar.CURE_GROUP, NONE) { player, _ -> // Level 86
cureGroup(player) onCast(Lunar.FISHING_GUILD_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,86, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,14)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,90.0,"Fishing Guild", Location.create(2611, 3393, 0))
} }
onCast(Lunar.CURE_OTHER, PLAYER) { player, node -> // Level 86
node?.let { cureOther(player, node) } onCast(Lunar.PLANK_MAKE, ITEM) { player, node ->
requires(player, 86, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.NATURE_RUNE_561, 1), Item(Items.EARTH_RUNE_557, 15)))
plankMake(player, node!!.asItem())
} }
// Level 87
onCast(Lunar.CATHERBY_TELEPORT, NONE) { player, _ ->
requires(player,87, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,92.0, Location.create(2804, 3433, 0))
}
// Level 88
onCast(Lunar.CATHERBY_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,88, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,15)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,93.0,"Catherby", Location.create(2804, 3433, 0))
}
// Level 89
onCast(Lunar.ICE_PLATEAU_TELEPORT, NONE) { player, _ ->
requires(player,89, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,8)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendTeleport(player,96.0, Location.create(2972, 3873, 0))
}
// Level 90
onCast(Lunar.ICE_PLATEAU_GROUP_TELEPORT, NONE) { player, _ ->
requires(player,90, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,16)))
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
sendGroupTeleport(player,99.0, "Ice Plateau", Location.create(2972, 3873, 0))
}
// Level 91
onCast(Lunar.ENERGY_TRANSFER, PLAYER) { player, node -> onCast(Lunar.ENERGY_TRANSFER, PLAYER) { player, node ->
node?.let { energyTransfer(player, node) } node?.let { energyTransfer(player, node) }
} }
onCast(Lunar.HUNTER_KIT, NONE) { player, _ -> // Level 92
if(freeSlots(player) == 0) sendMessage(player, "Not enough inventory space!").also { return@onCast } /**
hunterKit(player) * Heal Other
} */
// Level 93
/**
* Vengeance Other
*/
// Level 94
/**
* Vengeance
*/
// Level 95
/**
* Heal Group
*/
// Level 96
/**
* Spellbook Swap
*/
} }
// Lunar spellbook-related debug commands // Lunar spellbook-related debug commands
@@ -215,6 +303,19 @@ class LunarListeners : SpellListener("lunar"), Commands {
sendMessage(player, "::poison username damage") sendMessage(player, "::poison username damage")
} }
} }
define("humidifykit", privilege = Privilege.ADMIN) { player, _ ->
if(freeSlots(player) < 24) {
sendMessage(player, "Not enough free space.")
return@define
} else {
addItem(player, Items.ASTRAL_RUNE_9075, 100)
addItem(player, Items.WATER_RUNE_555, 300)
addItem(player, Items.FIRE_RUNE_554, 100)
for(item in HumidifyItems.values()) {
addItem(player, item.empty)
}
}
}
} }
private fun plankMake(player: Player, item: Item) { private fun plankMake(player: Player, item: Item) {
@@ -229,7 +330,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
lock(player, 3) lock(player, 3)
setDelay(player, false) setDelay(player, false)
visualizeSpell(player, PLANK_MAKE_ANIM, PLANK_MAKE_GFX, 3617) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Graphics.LUNAR_SPELLBOOK_PLANK_MAKE_1063, 120, Sounds.LUNAR_MAKE_PLANK_3617)
removeRunes(player) removeRunes(player)
replaceSlot(player, item.slot, plankType.plank) replaceSlot(player, item.slot, plankType.plank)
addXP(player, 90.0) addXP(player, 90.0)
@@ -281,7 +382,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
patch.cureDisease() patch.cureDisease()
removeRunes(player) removeRunes(player)
addXP(player,60.0) addXP(player,60.0)
visualizeSpell(player, CURE_PLANT_ANIM, CURE_PLANT_GFX) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748, 100, Sounds.LUNAR_CURE_GROUP_2882)
setDelay(player,false) setDelay(player,false)
} }
@@ -292,7 +393,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
player.faceLocation(npc.location) player.faceLocation(npc.location)
visualizeSpell(player, STATSPY_ANIM, STATSPY_GFX,3620) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060, soundID = Sounds.LUNAR_STAT_SPY_3620)
removeRunes(player) removeRunes(player)
addXP(player,66.0) addXP(player,66.0)
setDelay(player,false) setDelay(player,false)
@@ -330,10 +431,10 @@ class LunarListeners : SpellListener("lunar"), Commands {
var counter = 0 var counter = 0
override fun pulse(): Boolean { override fun pulse(): Boolean {
if(playerPies.isEmpty()) return true if(playerPies.isEmpty()) return true
if(counter == 0) delay = BAKE_PIE_ANIM.definition.durationTicks + 1 if(counter == 0) delay = Animation(Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413).definition.durationTicks + 1
val item = playerPies.get(0) val item = playerPies[0]
val pie = CookableItems.forId(item.id) val pie = CookableItems.forId(item.id)
visualizeSpell(player, BAKE_PIE_ANIM, BAKE_PIE_GFX, 2879) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 75, Sounds.LUNAR_BAKE_PIE_2879)
addXP(player,60.0) addXP(player,60.0)
player.skills.addExperience(Skills.COOKING,pie.experience) player.skills.addExperience(Skills.COOKING,pie.experience)
setDelay(player,false) setDelay(player,false)
@@ -357,7 +458,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
private fun sendGroupTeleport(player: Player, xp: Double, destName: String, loc: Location){ private fun sendGroupTeleport(player: Player, xp: Double, destName: String, loc: Location){
RegionManager.getLocalPlayers(player,1).forEach { RegionManager.getLocalPlayers(player,1).forEach {
if(it == player) return@forEach if(it == player) return@forEach
if(it.isTeleBlocked()) return@forEach if(it.isTeleBlocked) return@forEach
if(!it.isActive) return@forEach if(!it.isActive) return@forEach
if(!it.settings.isAcceptAid) return@forEach if(!it.settings.isAcceptAid) return@forEach
if(it.ironmanManager.isIronman) return@forEach if(it.ironmanManager.isIronman) return@forEach
@@ -374,7 +475,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
for(item in player.inventory.toArray()) { for(item in player.inventory.toArray()) {
if(item == null) continue if(item == null) continue
if(!JewelleryString.unstrungContains(item.id)) continue if(!StringJewelleryItems.unstrungContains(item.id)) continue
playerJewellery.add(item) playerJewellery.add(item)
} }
@@ -385,13 +486,13 @@ class LunarListeners : SpellListener("lunar"), Commands {
if (playerJewellery.isEmpty()) if (playerJewellery.isEmpty())
return true return true
requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5)))
if(counter == 0) delay = animationDuration(STRING_JEWELLERY_ANIM) + 1 if(counter == 0) delay = animationDuration(Animation(Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412)) + 1
val item = playerJewellery[0] val item = playerJewellery[0]
val strung = JewelleryString.forId(item.id) val strung = StringJewelleryItems.forId(item.id)
setDelay(player,false) setDelay(player,false)
if(removeItem(player, item) && addItem(player, strung)) { if(removeItem(player, item) && addItem(player, strung)) {
removeRunes(player, true) removeRunes(player, true)
visualizeSpell(player, STRING_JEWELLERY_ANIM, STRING_JEWELLERY_GFX, 2903) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 100, Sounds.LUNAR_STRING_AMULET_2903)
rewardXP(player, Skills.CRAFTING, 4.0) rewardXP(player, Skills.CRAFTING, 4.0)
addXP(player, 83.0) addXP(player, 83.0)
playerJewellery.remove(item) playerJewellery.remove(item)
@@ -404,11 +505,11 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
private fun superglassMake(player: Player) { private fun superglassMake(player: Player) {
val GLASSWEED = hashSetOf(Items.SODA_ASH_1781, Items.SEAWEED_401, Items.SWAMP_WEED_10978) val GLASS_WEEDS = hashSetOf(Items.SODA_ASH_1781, Items.SEAWEED_401, Items.SWAMP_WEED_10978)
val inv = player.inventory.toArray() val inv = player.inventory.toArray()
var playerWeed: Int = amountInInventory(player, Items.SODA_ASH_1781) + amountInInventory(player, Items.SEAWEED_401) + amountInInventory(player, Items.SWAMP_WEED_10978) var playerWeed: Int = amountInInventory(player, Items.SODA_ASH_1781) + amountInInventory(player, Items.SEAWEED_401) + amountInInventory(player, Items.SWAMP_WEED_10978)
var playerSand: Int = amountInInventory(player, Items.BUCKET_OF_SAND_1783) var playerSand: Int = amountInInventory(player, Items.BUCKET_OF_SAND_1783)
var index: Int = 0 var index = 0
fun addMolten(): Boolean { fun addMolten(): Boolean {
if(RandomFunction.randomDouble(1.0) < 0.3) { if(RandomFunction.randomDouble(1.0) < 0.3) {
@@ -425,7 +526,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
for (item in inv) { for (item in inv) {
if (item == null) continue if (item == null) continue
if (index == size) break if (index == size) break
if (GLASSWEED.contains(item.id)) { if (GLASS_WEEDS.contains(item.id)) {
if (removeItem(player, item) && removeItem(player, Items.BUCKET_OF_SAND_1783) && addMolten()) { if (removeItem(player, item) && removeItem(player, Items.BUCKET_OF_SAND_1783) && addMolten()) {
index++ index++
} else { } else {
@@ -439,7 +540,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
if(index == size && size != 0) { if(index == size && size != 0) {
removeRunes(player, true) removeRunes(player, true)
visualizeSpell(player, SUPERGLASS_MAKE_ANIM, SUPERGLASS_MAKE_GFX, 2896) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 120, Sounds.LUNAR_HEATGLASS_2896)
rewardXP(player, Skills.CRAFTING, 10.0) rewardXP(player, Skills.CRAFTING, 10.0)
addXP(player, 78.0) addXP(player, 78.0)
} }
@@ -468,8 +569,8 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
requires(player, 83, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.NATURE_RUNE_561, 2), Item(Items.EARTH_RUNE_557, 15))) requires(player, 83, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.NATURE_RUNE_561, 2), Item(Items.EARTH_RUNE_557, 15)))
removeRunes(player, true) removeRunes(player, true)
animate(player, FERTILE_SOIL_ANIM) animate(player, Animations.LUNAR_SPELLBOOK_FERTILE_SOIL_4413)
sendGraphics(FERTILE_SOIL_GFX, target.location) sendGraphics(Graphics.LUNAR_SPELLBOOK_FERTILE_SOIL_724, target.location)
playGlobalAudio(target.location, Sounds.LUNAR_FERTILIZE_2891) playGlobalAudio(target.location, Sounds.LUNAR_FERTILIZE_2891)
patch.compost = CompostType.SUPER patch.compost = CompostType.SUPER
sendMessage(player, "You fertilize the soil.") sendMessage(player, "You fertilize the soil.")
@@ -483,7 +584,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2))) requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2)))
removeRunes(player, true) removeRunes(player, true)
visualizeSpell(player, CURE_ME_ANIM, CURE_ME_GFX, 2880) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 90, Sounds.LUNAR_CURE_2884)
curePoison(player) curePoison(player)
addXP(player, 69.0) addXP(player, 69.0)
playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900) playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900)
@@ -493,7 +594,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
private fun cureGroup(player: Player) { private fun cureGroup(player: Player) {
requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2))) requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2)))
removeRunes(player, true) removeRunes(player, true)
visualizeSpell(player, CURE_GROUP_ANIM, CURE_GROUP_GFX, 2882) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, Sounds.LUNAR_CURE_GROUP_2882)
curePoison(player) curePoison(player)
for(acct in RegionManager.getLocalPlayers(player, 1)) { for(acct in RegionManager.getLocalPlayers(player, 1)) {
if(!acct.isActive || acct.locks.isInteractionLocked) { if(!acct.isActive || acct.locks.isInteractionLocked) {
@@ -504,8 +605,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
curePoison(acct) curePoison(acct)
sendMessage(acct, "You have been cured of poison.") sendMessage(acct, "You have been cured of poison.")
playGlobalAudio(acct.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) visualizeSpell(acct, -1, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889)
visualize(acct, -1, CURE_GROUP_GFX)
} }
addXP(player, 74.0) addXP(player, 74.0)
} }
@@ -530,9 +630,8 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10))) requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10)))
player.face(p) player.face(p)
visualizeSpell(player, CURE_OTHER_ANIM, CURE_OTHER_GFX, 2886) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, Sounds.LUNAR_CURE_OTHER_2886)
visualize(p, -1, CURE_OTHER_GFX) visualizeSpell(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889)
playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889)
removeRunes(player, true) removeRunes(player, true)
curePoison(p) curePoison(p)
sendMessage(p, "You have been cured of poison.") sendMessage(p, "You have been cured of poison.")
@@ -559,8 +658,8 @@ class LunarListeners : SpellListener("lunar"), Commands {
} }
requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1))) requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1)))
player.face(p) player.face(p)
visualizeSpell(player, ENERGY_TRANSFER_ANIM, ENERGY_TRANSFER_GFX, 2885) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 90, Sounds.LUNAR_ENERGY_TRANSFER_2885)
visualize(p, -1, CURE_OTHER_GFX) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738)
val hp = floor(player.skills.lifepoints * 0.10) val hp = floor(player.skills.lifepoints * 0.10)
var r = hp var r = hp
if(r > (100 - p.settings.runEnergy)) { if(r > (100 - p.settings.runEnergy)) {
@@ -590,11 +689,42 @@ class LunarListeners : SpellListener("lunar"), Commands {
requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 2))) requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 2)))
removeRunes(player, true) removeRunes(player, true)
if(addItem(player, Items.HUNTER_KIT_11159)) { if(addItem(player, Items.HUNTER_KIT_11159)) {
visualizeSpell(player, HUNTER_KIT_ANIM, HUNTER_KIT_GFX, 3615) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, soundID = Sounds.LUNAR_HUNTER_KIT_3615)
addXP(player, 70.0) addXP(player, 70.0)
setDelay(player, 2) setDelay(player, 2)
} }
} }
private fun humidify(player: Player) {
val playerEmpties = ArrayDeque<Item>()
for(item in player.inventory.toArray()) {
if(item == null) continue
if(!HumidifyItems.emptyContains(item.id)) continue
playerEmpties.add(item)
}
if(playerEmpties.isEmpty()) {
sendMessage(player, "You have nothing in your inventory that this spell can humidify.")
return
}
removeRunes(player)
delayEntity(player, Animation(Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294).duration)
visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, 20, Sounds.LUNAR_HUMIDIFY_3614)
for(item in playerEmpties) {
val filled = HumidifyItems.forId(item.id)
removeItem(player, item.id) && addItem(player, filled)
}
addXP(player, 65.0)
/**
queueScript(player) {
return@queueScript stopExecuting(player)
}
*/
}
} }
@@ -34,11 +34,11 @@ object Lunar {
const val HEAL_GROUP = 30 const val HEAL_GROUP = 30
const val OURANIA_TELEPORT = 31 const val OURANIA_TELEPORT = 31
const val CURE_PLANT = 32 const val CURE_PLANT = 32
const val MOONCLAN_GR_TELEPORT = 33 const val MOONCLAN_GROUP_TELEPORT = 33
const val WATERBIRTH_GR_TELEPORT = 34 const val WATERBIRTH_GROUP_TELEPORT = 34
const val BARBARIAN_GR_TELEPORT = 35 const val BARBARIAN_GROUP_TELEPORT = 35
const val KHAZARD_GR_TELEPORT = 36 const val KHAZARD_GROUP_TELEPORT = 36
const val FISHING_GUILD_GR_TELEPORT = 37 const val FISHING_GUILD_GROUP_TELEPORT = 37
const val CATHERBY_GR_TELEPORT = 38 const val CATHERBY_GROUP_TELEPORT = 38
const val ICE_PLATEAU_GR_TELEPORT = 39 const val ICE_PLATEAU_GROUP_TELEPORT = 39
} }