rift.entities
ActorDirectorEntityNpcProjectileWorldAreaWorldGraphicWorldItemWorldObjectWorldProjectionWorldSound
Functions
Section titled “Functions”grantXp
Section titled “grantXp”fun Entity.grantXp( skill: Skill, amount: Double): Uniton_object_option(Assets.WorldObject.poordoor, "Pick-lock") { player -> val thieving = player.allComponents().filterIsInstance<Skill>().firstOrNull { it.name == "thieving" } if (thieving != null) player.grantXp(thieving, 15.0) player.message("You pick the lock.")}inGroup
Section titled “inGroup”fun Actor.inGroup(name: String): Booleanon_login { player -> if (player.inGroup("admin")) player.message("Admin tools are on.") if (player.inGroup("event_team")) player.teleport(Tile4.global(3222, 3218))}isOnline
Section titled “isOnline”fun Actor.isOnline(): Booleanon_input<DeveloperCommandInput> { player -> if (name != "seen") return@on_input val other = World.findPlayer(argv.lastOrNull() ?: return@on_input) player.message(if (other?.isOnline() == true) "They are online." else "They are not online.")}isPlayer
Section titled “isPlayer”fun Actor.isPlayer(): Booleanon_player_option("Trade") { player -> if (!target.isPlayer()) player.message("That one is a bot: it does not trade.")}isUserControlled
Section titled “isUserControlled”fun Actor.isUserControlled(): Booleanon_player_option("Follow") { player -> if (!target.isUserControlled()) player.message("Nobody is at the controls of that character.")}Properties
Section titled “Properties”val Component.actor: Actor?fun healToFull(hp: Hitpoints) { hp.current = hp.max hp.actor?.message("You feel much better.")}groups
Section titled “groups”val Actor.groups: Set<String>on_login { player -> if (player.groups.isNotEmpty()) player.message("Your groups: ${player.groups.joinToString()}.")}val Component.npc: Npc?fun healToFull(hp: Hitpoints) { hp.current = hp.max hp.npc?.speak("I feel much better!")}projectile
Section titled “projectile”val Component.projectile: Projectile?fun whereItFlies(settings: ProjectileSettings) { val projectile = settings.projectile ?: return Logger.info("a projectile in flight at ${projectile.tile4}")}var Entity.shard: Inton_input<DeveloperCommandInput> { player -> when (name) { "alone" -> player.shard = World.createParallelWorld() "together" -> player.shard = WorldSpatialIndex.GLOBAL }}shardId
Section titled “shardId”val Entity.shardId: Intnode<Npc>()
on_self_spawn { npc -> if (npc.shardId != WorldSpatialIndex.GLOBAL) Logger.info("made in shard ${npc.shardId}")}worldItem
Section titled “worldItem”val Component.worldItem: WorldItem?fun describe(settings: WorldItemSettings): String { val item = settings.worldItem ?: return "not a world item" return "${item.quantity} x ${item.stack.name} at ${item.tile}"}worldObject
Section titled “worldObject”val Component.worldObject: WorldObject?fun closeDoor(settings: WorldObjectSettings) { settings.worldObject?.replaceWith(Assets.WorldObject.poordoor)}worldSound
Section titled “worldSound”val Component.worldSound: WorldSound?fun whereItPlays(settings: WorldSoundSettings) { val sound = settings.worldSound ?: return Logger.info("a sound playing at ${sound.tile4}")}