Kaioru/Edelstein

Missing script functionality

Bia10 opened this issue · 5 comments

Bia10 commented

currently these are missing functions for scipts:
disableUI() - hides UI
lockUI() - prevent players actions
directionmode()
setStandAloneMode()
PortalSE()
IncreaseSlotLimit()

d4af001 - Adds GetInventoryLimit and SetInventoryLimit for example:

inventory = target.get_inventory()

-- 0x1 - Equip, 0x2 - Consume, 0x3 - Install, 0x4 - Etc, 0x5 - Cash
inventory.get_inventory_limit(0x1)
inventory.set_inventory_limit(0x1, 48)

bbfe1e4 - Adds settings of DirectionMode and StandAloneMode like so:

target.direction_mode = true -- or false
target.stand_alone_mode = true -- or false

a570844 - Adds PlayPortalSoundEffect used like so:

target.play_portal_sound_effect()
Bia10 commented

great now we need just

c.getSession().write(UIPacket.IntroDisableUI(false));
c.getSession().write(UIPacket.IntroLock(false));

    public static byte[] IntroLock(boolean enable) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

        mplew.writeShort(SendPacketOpcode.CYGNUS_INTRO_LOCK.getValue());
        mplew.write(enable ? 1 : 0);
        mplew.writeInt(0);

        return mplew.getPacket();
    }

    public static byte[] IntroDisableUI(boolean enable) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

        mplew.writeShort(SendPacketOpcode.CYGNUS_INTRO_DISABLE_UI.getValue());
        mplew.write(enable ? 1 : 0);

        return mplew.getPacket();
    }

v90?

From what I see, LockUI is not available in v95
image
The opcode for LockUI in other versions usually lie between OpenUIWithOption and SetDirectionMode

Bia10 commented

okay but there has to be a way to close UI in video scenes?

target.direction_mode = true removes and disables UI from my tests.
target.direction_mode = false re-enables UI controls.

I'm not sure what StandAloneMode does though. Might actually be IntroDisableUI in your reference