Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Feature intial luajit implementation #626

Merged
merged 21 commits into from
Dec 28, 2024
Merged

Conversation

MUN1Z
Copy link
Collaborator

@MUN1Z MUN1Z commented Dec 24, 2024

Functions Implementations using native bindings to LuaJit

Implemented Scripts (12)

Actions (3)

  • ladder_up.lua
  • rope.lua
  • shovel.lua

Talk Actions (9)

  • reload.lua /reload scripts
  • up.lua /up
  • down.lua /down
  • create_monster.lua /m scarab
  • create_summon.lua /m rat
  • create_npc.lua /n Eryn
  • create_item.lua /i Rope
  • teleport_to_creature.lua /goto
  • position.lua !position

Libs with some lua functions

  • creature.lua
  • item.lua
  • load.lua
  • player.lua
  • position.lua
  • revscriptsys.lua
  • tile.lua

Tables (16) and Functions (70)

Action (4)

  • Action()
  • action:onUse(callback)
  • action:register()
  • action:id(ids)

ConfigManager (4)

  • configManager:getString(type)
  • configManager:getNumber(type)
  • configManager:getBoolean(type)
  • configManager:getFloat(type)

Creature (5)

  • Creature(id or name or userdata)
  • creature:getId()
  • creature:getName()
  • creature:getPosition()
  • creature:getDirection()

Game (5)

  • Game.getReturnMessage(value)
  • Game.createItem(itemId or name[, count[, position]])
  • Game.createMonster(monsterName, position, extended = false, force = false, master = nil)
  • Game.createNpc(monsterName, position, extended = false, force = false])
  • Game.reload(reloadType)

Global (1)

  • rawgetmetatable(metatableName)

Item (9)

  • Item(uid)
  • item:getId()
  • item:getActionId()
  • item:getUniqueId()
  • item:getSubType()
  • item:hasProperty()
  • item:moveTo(position or cylinder, flags)
  • item:transform(itemId[, count/subType = -1])
  • item:decay(decayId)

Container (1)

  • Item(uid)

Teleport (1)

  • Teleport(uid)

ItemType (8)

  • ItemType(id or name)
  • itemType:getType()
  • itemType:getId()
  • item:getName()
  • item:isMovable()
  • item:isStackable()
  • item:isFluidContainer()
  • item:isKey()

Logger (4)

  • logger.info(text)
  • logger.info(text)
  • logger.info(text)
  • logger.info(text)

Monster (1)

  • Monster(id or userdata)

Npc (1)

  • Npc(id or userdata)

Player (5)

  • Player(id or guid or name or userdata)
  • player:teleportTo(position[, pushMovement = false])
  • player:sendTextMessage(type, text)
  • player:isPzLocked()
  • player:addItem(itemId, count = 1, canDropOnMap = true, subType = 1, slot = CONST_SLOT_BACKPACK)

Position (5)

  • Position([x = 0[, y = 0[, z = 0[, stackpos = 0]]]]) or Position([position])
  • positionValue = position + positionEx
  • positionValue = position - positionEx
  • position:sendMagicEffect(magicEffect[, player = nullptr])
  • position:toString()

TalkAction (5)

  • TalkAction(words) or TalkAction(word1, word2, word3)
  • talkAction:onSay(callback)
  • talkAction:register()
  • talkAction:separator(sep)
  • talkAction:getName()

Tile (11)

  • Tile(x, y, z) or Tile(position)
  • tile:getThing(index)
  • tile:getThingCount()
  • tile:getTopVisibleThing(creature)
  • tile:getPosition()
  • tile:getGround()
  • tile:getItems()
  • tile:getItemCount()
  • tile:hasProperty(property[, item])
  • tile:hasFlag(flag)
  • tile:queryAdd(thing[, flags])

Enums (6) / Constants (100++)

DirectionsType

  • DIRECTION_NORTH,
  • DIRECTION_EAST,
  • DIRECTION_SOUTH,
  • DIRECTION_WEST,
  • DIRECTION_SOUTHWEST,
  • DIRECTION_SOUTHEAST,
  • DIRECTION_NORTHWEST,
  • DIRECTION_NORTHEAST,
  • DIRECTION_NONE,

MagicEffectClassesType

  • CONST_ME_NONE,
  • CONST_ME_DRAWBLOOD = 1,
  • CONST_ME_LOSEENERGY = 2,
  • CONST_ME_POFF = 3,
  • CONST_ME_BLOCKHIT = 4,
  • CONST_ME_EXPLOSIONAREA = 5,
  • CONST_ME_EXPLOSIONHIT = 6,
  • CONST_ME_FIREAREA = 7,
  • CONST_ME_YELLOW_RINGS = 8,
  • CONST_ME_GREEN_RINGS = 9,
  • CONST_ME_HITAREA = 10,
  • CONST_ME_TELEPORT = 11,
  • CONST_ME_ENERGYHIT = 12,
  • CONST_ME_MAGIC_BLUE = 13,
  • CONST_ME_MAGIC_RED = 14,
  • CONST_ME_MAGIC_GREEN = 15,
  • CONST_ME_HITBYFIRE = 16,
  • CONST_ME_HITBYPOISON = 17,
  • CONST_ME_MORTAREA = 18,
  • CONST_ME_SOUND_GREEN = 19,
  • CONST_ME_SOUND_RED = 20,
  • CONST_ME_POISONAREA = 21,
  • CONST_ME_SOUND_YELLOW = 22,
  • CONST_ME_SOUND_PURPLE = 23,
  • CONST_ME_SOUND_BLUE = 24,
  • CONST_ME_SOUND_WHITE = 25,
  • CONST_ME_BUBBLES = 26,
  • CONST_ME_CRAPS = 27,
  • CONST_ME_GIFT_WRAPS = 28,
  • CONST_ME_FIREWORK_YELLOW = 29,
  • CONST_ME_FIREWORK_RED = 30,
  • CONST_ME_FIREWORK_BLUE = 31,
  • CONST_ME_STUN = 32,
  • CONST_ME_SLEEP = 33,
  • CONST_ME_WATERCREATURE = 34,
  • CONST_ME_GROUNDSHAKER = 35,
  • CONST_ME_HEARTS = 36,
  • CONST_ME_FIREATTACK = 37,
  • CONST_ME_ENERGYAREA = 38,
  • CONST_ME_SMALLCLOUDS = 39,
  • CONST_ME_HOLYDAMAGE = 40,
  • CONST_ME_BIGCLOUDS = 41,
  • CONST_ME_ICEAREA = 42,
  • CONST_ME_ICETORNADO = 43,
  • CONST_ME_ICEATTACK = 44,
  • CONST_ME_STONES = 45,
  • CONST_ME_SMALLPLANTS = 46,
  • CONST_ME_CARNIPHILA = 47,
  • CONST_ME_PURPLEENERGY = 48,
  • CONST_ME_YELLOWENERGY = 49,
  • CONST_ME_HOLYAREA = 50,
  • CONST_ME_BIGPLANTS = 51,
  • CONST_ME_CAKE = 52,
  • CONST_ME_GIANTICE = 53,
  • CONST_ME_WATERSPLASH = 54,
  • CONST_ME_PLANTATTACK = 55,
  • CONST_ME_TUTORIALARROW = 56,
  • CONST_ME_TUTORIALSQUARE = 57,
  • CONST_ME_MIRRORHORIZONTAL = 58,
  • CONST_ME_MIRRORVERTICAL = 59,
  • CONST_ME_SKULLHORIZONTAL = 60,
  • CONST_ME_SKULLVERTICAL = 61,
  • CONST_ME_ASSASSIN = 62,
  • CONST_ME_STEPSHORIZONTAL = 63,
  • CONST_ME_BLOODYSTEPS = 64,
  • CONST_ME_STEPSVERTICAL = 65,
  • CONST_ME_YALAHARIGHOST = 66,
  • CONST_ME_BATS = 67,
  • CONST_ME_SMOKE = 68,
  • CONST_ME_INSECTS = 69,
  • CONST_ME_DRAGONHEAD = 70

MessageClassesType

  • MESSAGE_STATUS_CONSOLE_RED = 18, /Red message in the console/
  • MESSAGE_EVENT_ORANGE = 19, /Orange message in the console/
  • MESSAGE_STATUS_CONSOLE_ORANGE = 20, /Orange message in the console/
  • MESSAGE_STATUS_WARNING = 21, /Red message in game window and in the console/
  • MESSAGE_EVENT_ADVANCE = 22, /White message in game window and in the console/
  • MESSAGE_EVENT_DEFAULT = 23, /White message at the bottom of the game window and in the console/
  • MESSAGE_STATUS_DEFAULT = 24, /White message at the bottom of the game window and in the console/
  • MESSAGE_INFO_DESCR = 25, /Green message in game window and in the console/
  • MESSAGE_STATUS_SMALL = 26, /White message at the bottom of the game window"/
  • MESSAGE_STATUS_CONSOLE_BLUE = 27, /FIXME Blue message in the console/

ReloadType

  • RELOAD_TYPE_NONE,
  • RELOAD_TYPE_ALL,
  • RELOAD_TYPE_CHAT,
  • RELOAD_TYPE_CONFIG,
  • RELOAD_TYPE_EVENTS,
  • RELOAD_TYPE_CORE,
  • RELOAD_TYPE_IMBUEMENTS,
  • RELOAD_TYPE_ITEMS,
  • RELOAD_TYPE_MODULES,
  • RELOAD_TYPE_MONSTERS,
  • RELOAD_TYPE_MOUNTS,
  • RELOAD_TYPE_NPCS,
  • RELOAD_TYPE_RAIDS,
  • RELOAD_TYPE_SCRIPTS,
  • RELOAD_TYPE_GROUPS,
  • RELOAD_TYPE_LAST

ReturnValueType

  • RETURNVALUE_NOERROR,
  • RETURNVALUE_NOTPOSSIBLE,
  • RETURNVALUE_NOTENOUGHROOM,
  • RETURNVALUE_PLAYERISPZLOCKED,
  • RETURNVALUE_PLAYERISNOTINVITED,
  • RETURNVALUE_CANNOTTHROW,
  • RETURNVALUE_THEREISNOWAY,
  • RETURNVALUE_DESTINATIONOUTOFREACH,
  • RETURNVALUE_CREATUREBLOCK,
  • RETURNVALUE_NOTMOVEABLE,
  • RETURNVALUE_DROPTWOHANDEDITEM,
  • RETURNVALUE_BOTHHANDSNEEDTOBEFREE,
  • RETURNVALUE_CANONLYUSEONEWEAPON,
  • RETURNVALUE_NEEDEXCHANGE,
  • RETURNVALUE_CANNOTBEDRESSED,
  • RETURNVALUE_PUTTHISOBJECTINYOURHAND,
  • RETURNVALUE_PUTTHISOBJECTINBOTHHANDS,
  • RETURNVALUE_TOOFARAWAY,
  • RETURNVALUE_FIRSTGODOWNSTAIRS,
  • RETURNVALUE_FIRSTGOUPSTAIRS,
  • RETURNVALUE_CONTAINERNOTENOUGHROOM,
  • RETURNVALUE_NOTENOUGHCAPACITY,
  • RETURNVALUE_CANNOTPICKUP,
  • RETURNVALUE_THISISIMPOSSIBLE,
  • RETURNVALUE_DEPOTISFULL,
  • RETURNVALUE_CREATUREDOESNOTEXIST,
  • RETURNVALUE_CANNOTUSETHISOBJECT,
  • RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE,
  • RETURNVALUE_NOTREQUIREDLEVELTOUSERUNE,
  • RETURNVALUE_YOUAREALREADYTRADING,
  • RETURNVALUE_THISPLAYERISALREADYTRADING,
  • RETURNVALUE_YOUMAYNOTLOGOUTDURINGAFIGHT,
  • RETURNVALUE_DIRECTPLAYERSHOOT,
  • RETURNVALUE_NOTENOUGHLEVEL,
  • RETURNVALUE_NOTENOUGHMAGICLEVEL,
  • RETURNVALUE_NOTENOUGHMANA,
  • RETURNVALUE_NOTENOUGHSOUL,
  • RETURNVALUE_YOUAREEXHAUSTED,
  • RETURNVALUE_YOUCANNOTUSEOBJECTSTHATFAST,
  • RETURNVALUE_PLAYERISNOTREACHABLE,
  • RETURNVALUE_CANONLYUSETHISRUNEONCREATURES,
  • RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE,
  • RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER,
  • RETURNVALUE_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE,
  • RETURNVALUE_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE,
  • RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE,
  • RETURNVALUE_YOUCANONLYUSEITONCREATURES,
  • RETURNVALUE_CREATUREISNOTREACHABLE,
  • RETURNVALUE_TURNSECUREMODETOATTACKUNMARKEDPLAYERS,
  • RETURNVALUE_YOUNEEDPREMIUMACCOUNT,
  • RETURNVALUE_YOUNEEDTOLEARNTHISSPELL,
  • RETURNVALUE_YOURVOCATIONCANNOTUSETHISSPELL,
  • RETURNVALUE_YOUNEEDAWEAPONTOUSETHISSPELL,
  • RETURNVALUE_PLAYERISPZLOCKEDLEAVEPVPZONE,
  • RETURNVALUE_PLAYERISPZLOCKEDENTERPVPZONE,
  • RETURNVALUE_ACTIONNOTPERMITTEDINANOPVPZONE,
  • RETURNVALUE_YOUCANNOTLOGOUTHERE,
  • RETURNVALUE_YOUNEEDAMAGICITEMTOCASTSPELL,
  • RETURNVALUE_CANNOTCONJUREITEMHERE,
  • RETURNVALUE_YOUNEEDTOSPLITYOURSPEARS,
  • RETURNVALUE_NAMEISTOOAMBIGUOUS,
  • RETURNVALUE_CANONLYUSEONESHIELD,
  • RETURNVALUE_NOPARTYMEMBERSINRANGE,
  • RETURNVALUE_YOUARENOTTHEOWNER,
  • RETURNVALUE_NOSUCHRAIDEXISTS,
  • RETURNVALUE_ANOTHERRAIDISALREADYEXECUTING,
  • RETURNVALUE_TRADEPLAYERFARAWAY,
  • RETURNVALUE_YOUDONTOWNTHISHOUSE,
  • RETURNVALUE_TRADEPLAYERALREADYOWNSAHOUSE,
  • RETURNVALUE_TRADEPLAYERHIGHESTBIDDER,
  • RETURNVALUE_YOUCANNOTTRADETHISHOUSE,
  • RETURNVALUE_YOUDONTHAVEREQUIREDPROFESSION,
  • RETURNVALUE_ITEMCANNOTBEMOVEDTHERE,
  • RETURNVALUE_YOUCANNOTUSETHISBED,

TileFlagsType

  • TILESTATE_NONE = 0,
  • TILESTATE_FLOORCHANGE_DOWN = 1 << 0,
  • TILESTATE_FLOORCHANGE_NORTH = 1 << 1,
  • TILESTATE_FLOORCHANGE_SOUTH = 1 << 2,
  • TILESTATE_FLOORCHANGE_EAST = 1 << 3,
  • TILESTATE_FLOORCHANGE_WEST = 1 << 4,
  • TILESTATE_FLOORCHANGE_SOUTH_ALT = 1 << 5,
  • TILESTATE_FLOORCHANGE_EAST_ALT = 1 << 6,
  • TILESTATE_PROTECTIONZONE = 1 << 7,
  • TILESTATE_NOPVPZONE = 1 << 8,
  • TILESTATE_NOLOGOUT = 1 << 9,
  • TILESTATE_PVPZONE = 1 << 10,
  • TILESTATE_TELEPORT = 1 << 11,
  • TILESTATE_MAGICFIELD = 1 << 12,
  • TILESTATE_MAILBOX = 1 << 13,
  • TILESTATE_TRASHHOLDER = 1 << 14,
  • TILESTATE_BED = 1 << 15,
  • TILESTATE_DEPOT = 1 << 16,
  • TILESTATE_BLOCKSOLID = 1 << 17,
  • TILESTATE_BLOCKPATH = 1 << 18,
  • TILESTATE_IMMOVABLEBLOCKSOLID = 1 << 19,
  • TILESTATE_IMMOVABLEBLOCKPATH = 1 << 20,
  • TILESTATE_IMMOVABLENOFIELDBLOCKPATH = 1 << 21,
  • TILESTATE_NOFIELDBLOCKPATH = 1 << 22,
  • TILESTATE_SUPPORTS_HANGABLE = 1 << 23,
  • TILESTATE_FLOORCHANGE = TILESTATE_FLOORCHANGE_DOWN | TILESTATE_FLOORCHANGE_NORTH | TILESTATE_FLOORCHANGE_SOUTH | TILESTATE_FLOORCHANGE_EAST | TILESTATE_FLOORCHANGE_WEST | TILESTATE_FLOORCHANGE_SOUTH_ALT | TILESTATE_FLOORCHANGE_EAST_ALT,

@MUN1Z MUN1Z added the enhancement New feature or request label Dec 24, 2024
@MUN1Z MUN1Z self-assigned this Dec 24, 2024
…ions methods implementations, some implementstions on NeoServer to provide methods and properties to LuaJit and moved EffectService from NeoServer.Extensions project to NeoServer.Server project.
@caioavidal caioavidal self-requested a review December 24, 2024 17:49
@MUN1Z MUN1Z changed the title WIP: Feature intial luajit implementation feat: Feature intial luajit implementation Dec 27, 2024
@caioavidal caioavidal merged commit 9a2cb87 into develop Dec 28, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants