1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-05-12 14:47:46 +00:00

Add script for limsa inn door

This commit is contained in:
Joshua Goins 2025-05-05 22:28:45 -04:00
parent fec6665d8d
commit 00671ae741
3 changed files with 28 additions and 2 deletions

View file

@ -16,3 +16,4 @@ registerEvent(1245186, "opening/OpeningGridania.lua")
registerEvent(1245187, "opening/OpeningUldah.lua") registerEvent(1245187, "opening/OpeningUldah.lua")
registerEvent(131078, "warp/WarpInnGridania.lua") registerEvent(131078, "warp/WarpInnGridania.lua")
registerEvent(131079, "warp/WarpInnLimsaLominsa.lua") registerEvent(131079, "warp/WarpInnLimsaLominsa.lua")
registerEvent(131082, "tosort/LimsaInnDoor.lua")

View file

@ -0,0 +1,16 @@
--- TODO: find a way to hardcode it this way
EVENT_ID = 131082
-- TODO: it seems that these all might share one common function, and the only difference is the event id
function onTalk(target, player)
--- prompt to exit the inn
player:play_scene(target, EVENT_ID, 00000, 8192, 0)
end
function onReturn(results, player)
if results[1] == 1 then
-- get warp
player:warp(EVENT_ID)
end
end

View file

@ -1,7 +1,7 @@
use mlua::{FromLua, Lua, LuaSerdeExt, UserData, UserDataMethods, Value}; use mlua::{FromLua, Lua, LuaSerdeExt, UserData, UserDataFields, UserDataMethods, Value};
use crate::{ use crate::{
common::{ObjectTypeId, Position, timestamp_secs, workdefinitions::RemakeMode}, common::{ObjectId, ObjectTypeId, Position, timestamp_secs, workdefinitions::RemakeMode},
ipc::zone::{ ipc::zone::{
ActionEffect, DamageElement, DamageKind, DamageType, EffectKind, EventScene, ActionEffect, DamageElement, DamageKind, DamageType, EffectKind, EventScene,
ServerZoneIpcData, ServerZoneIpcSegment, Warp, ServerZoneIpcData, ServerZoneIpcSegment, Warp,
@ -154,6 +154,15 @@ impl UserData for LuaPlayer {
Ok(()) Ok(())
}); });
} }
fn add_fields<F: UserDataFields<Self>>(fields: &mut F) {
fields.add_field_method_get("id", |_, this| {
Ok(ObjectTypeId {
object_id: ObjectId(this.player_data.actor_id),
object_type: 0,
})
});
}
} }
impl UserData for Position {} impl UserData for Position {}