• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

1.5 Lua Functions

highsanta

Advanced OT User
Joined
Dec 20, 2023
Messages
399
Solutions
3
Reaction score
175
I had plenty of people ask me about the luascript functions so here they are i extracted the comments from luascript.cpp
C++:
//doPlayerAddItem(uid, itemid, <optional: default: 1> count/subtype)
//doPlayerAddItem(cid, itemid, <optional: default: 1> count, <optional: default: 1> canDropOnMap, <optional: default: 1>subtype)
//Returns uid of the created item
//isValidUID(uid)
//isDepot(uid)
//isMovable(uid)
//doAddContainerItem(uid, itemid, <optional> count/subtype)
//getDepotId(uid)
//getWorldTime()
//getWorldLight()
//setWorldLight(level, color)
//getWorldUpTime()
// getSubTypeName(subType)
//createCombatArea( {area}, <optional> {extArea} )
//doAreaCombat(cid, type, pos, area, min, max, effect[, origin = ORIGIN_SPELL[, blockArmor = false[, blockShield = false[, ignoreResistances = false]]]])
//doTargetCombat(cid, target, type, min, max, effect[, origin = ORIGIN_SPELL[, blockArmor = false[, blockShield = false[, ignoreResistances = false]]]])
//doChallengeCreature(cid, target[, force = false])
//addEvent(callback, delay, ...)
//stopEvent(eventid)
//saveServer()
//cleanMap()
//debugPrint(text)
//isInWar(cid, target)
//getWaypointPosition(name)
//sendChannelMessage(channelId, type, message)
//sendGuildChannelMessage(guildId, type, message)
//isScriptsInterface()
//bit operations for Lua, based on bitlib project release 24
//bit.bnot, bit.band, bit.bor, bit.bxor, bit.lshift, bit.rshift
//configManager table
//db table
//result table
/* New functions */
//registerClass(className, baseClass, newFunction)
//registerTable(tableName)
//registerMethod(className, functionName, function)
//registerMetaMethod(className, functionName, function)
//registerGlobalMethod(functionName, function)
//registerVariable(tableName, name, value)
//registerGlobalVariable(name, value)
//registerEnum(value)
//registerEnumIn(tableName, value)
//debugPrint(text)
//getWorldTime()
//getWorldLight()
//setWorldLight(level, color)
//getWorldUpTime()
// getSubTypeName(subType)
//createCombatArea( {area}, <optional> {extArea} )
//doAreaCombat(cid, type, pos, area, min, max, effect[, origin = ORIGIN_SPELL[, blockArmor = false[, blockShield = false[, ignoreResistances = false]]]])
//doTargetCombat(cid, target, type, min, max, effect[, origin = ORIGIN_SPELL[, blockArmor = false[, blockShield = false[, ignoreResistances = false]]]])
//doChallengeCreature(cid, target[, force = false])
//isValidUID(uid)
//isDepot(uid)
//isMoveable(uid)
//isMovable(uid)
//doAddContainerItem(uid, itemid, <optional> count/subtype)
//stackable item stacked with existing object, newItem will be released
//getDepotId(uid)
//addEvent(callback, delay, ...)
//stopEvent(eventid)
//isInWar(cid, target)
//getWaypointPositionByName(name)
//sendChannelMessage(channelId, type, message)
//sendGuildChannelMessage(guildId, type, message)
//isScriptsInterface()
// Game.getSpectators(position[, multifloor = false[, onlyPlayer = false[, minRangeX = 0[, maxRangeX = 0[, minRangeY = 0[, maxRangeY = 0]]]]]])
// Game.getPlayers()
// Game.loadMap(path)
// FIXME: Should only catch some exceptions
// Game.getExperienceStage(level)
// Game.getExperienceForLevel(level)
// Game.getMonsterCount()
// Game.getPlayerCount()
// Game.getNpcCount()
// Game.getMonsterTypes()
// Game.getCurrencyItems()
// Game.getTowns()
// Game.getHouses()
// Game.getGameState()
// Game.setGameState(state)
// Game.getWorldType()
// Game.setWorldType(type)
// Game.getReturnMessage(value)
// Game.getItemAttributeByName(name)
// Game.createItem(itemId[, count[, position]])
// Game.createContainer(itemId, size[, position])
// Game.createMonster(monsterName, position[, extended = false[, force = false]])
// Game.createNpc(npcName, position[, extended = false[, force = false]])
// Game.createTile(x, y, z[, isDynamic = false])
// Game.createTile(position[, isDynamic = false])
// Game.createMonsterType(name)
// Game.startRaid(raidName)
// Game.getClientVersion()
// Game.reload(reloadType)
// Game.getAccountStorageValue(accountId, key)
// Game.setAccountStorageValue(accountId, key, value)
// Game.saveAccountStorageValues()
// Variant
// Variant(number or string or position or thing)
// Variant:getNumber()
// Variant:getString()
// Variant:getPosition()
// Position
// Position([x = 0[, y = 0[, z = 0[, stackpos = 0]]]])
// Position([position])
// positionValue = position + positionEx
// positionValue = position - positionEx
// position == positionEx
// position:getDistance(positionEx)
// position:isSightClear(positionEx[, sameFloor = true])
// position:sendMagicEffect(magicEffect[, player = nullptr])
// position:sendDistanceEffect(positionEx, distanceEffect[, player = nullptr])
// Tile
// Tile(x, y, z)
// Tile(position)
// tile:remove()
// tile:getPosition()
// tile:getGround()
// tile:getThing(index)
// tile:getThingCount()
// tile:getTopVisibleThing(creature)
// tile:getTopTopItem()
// tile:getTopDownItem()
// tile:getFieldItem()
// tile:getItemById(itemId[, subType = -1])
// tile:getItemByType(itemType)
// tile:getItemByTopOrder(topOrder)
// tile:getItemCountById(itemId[, subType = -1])
// tile:getBottomCreature()
// tile:getTopCreature()
// tile:getBottomVisibleCreature(creature)
// tile:getTopVisibleCreature(creature)
// tile:getItems()
// tile:getItemCount()
// tile:getDownItemCount()
// tile:getTopItemCount()
// tile:getCreatures()
// tile:getCreatureCount()
// tile:hasProperty(property[, item])
// tile:getThingIndex(thing)
// tile:hasFlag(flag)
// tile:queryAdd(thing[, flags])
// tile:addItem(itemId[, count/subType = 1[, flags = 0]])
// tile:addItemEx(item[, flags = 0])
// tile:getHouse()
// NetworkMessage
// NetworkMessage()
// networkMessage:getByte()
// networkMessage:getU16()
// networkMessage:getU32()
// networkMessage:getU64()
// networkMessage:getString()
// networkMessage:getPosition()
// networkMessage:addByte(number)
// networkMessage:addU16(number)
// networkMessage:addU32(number)
// networkMessage:addU64(number)
// networkMessage:addString(string)
// networkMessage:addPosition(position)
// networkMessage:addDouble(number)
// networkMessage:addItem(item)
// networkMessage:addItemId(itemId)
// networkMessage:reset()
// networkMessage:seek(position)
// networkMessage:tell()
// networkMessage:len()
// networkMessage:skipBytes(number)
// networkMessage:sendToPlayer(player)
// ModalWindow
// ModalWindow(id, title, message)
// modalWindow:getId()
// modalWindow:getTitle()
// modalWindow:getMessage()
// modalWindow:setTitle(text)
// modalWindow:setMessage(text)
// modalWindow:getButtonCount()
// modalWindow:getChoiceCount()
// modalWindow:addButton(id, text)
// modalWindow:addChoice(id, text)
// modalWindow:getDefaultEnterButton()
// modalWindow:setDefaultEnterButton(buttonId)
// modalWindow:getDefaultEscapeButton()
// modalWindow:setDefaultEscapeButton(buttonId)
// modalWindow:hasPriority()
// modalWindow:setPriority(priority)
// modalWindow:sendToPlayer(player)
// Item
// Item(uid)
// item:isItem()
// item:getParent()
// item:getTopParent()
// item:getId()
// item:clone()
// item:split([count = 1])
// item:remove([count = -1])
// item:getUniqueId()
// item:getActionId()
// item:setActionId(actionId)
// item:getCount()
// item:getCharges()
// item:getFluidType()
// item:getWeight()
// item:getWorth()
// item:getSubType()
// item:getName()
// item:getPluralName()
// item:getArticle()
// item:getPosition()
// item:getTile()
// item:hasAttribute(key)
// item:getAttribute(key)
// item:setAttribute(key, value)
// item:removeAttribute(key)
// item:getCustomAttribute(key)
// item:setCustomAttribute(key, value)
// item:removeCustomAttribute(key)
// item:moveTo(position or cylinder[, flags])
// item:transform(itemId[, count/subType = -1])
// item:decay(decayId)
// item:getDescription(distance)
// item:getSpecialDescription()
// item:hasProperty(property)
// item:isLoadedFromMap()
// item:setStoreItem(storeItem)
// item:isStoreItem()
// Container
// Container(uid)
// container:getSize()
// container:getCapacity()
// container:getEmptySlots([recursive = false])
// container:getItemHoldingCount()
// container:getItem(index)
// container:hasItem(item)
// container:addItem(itemId[, count/subType = 1[, index = INDEX_WHEREEVER[, flags = 0]]])
// container:addItemEx(item[, index = INDEX_WHEREEVER[, flags = 0]])
// container:getCorpseOwner()
// container:getItemCountById(itemId[, subType = -1])
// container:getContentDescription()
// container:getItems([recursive = false])
// Teleport
// Teleport(uid)
// teleport:getDestination()
// teleport:setDestination(position)
// Creature
// Creature(id or name or userdata)
// creature:getEvents(type)
// creature:registerEvent(name)
// creature:unregisterEvent(name)
// creature:isRemoved()
// creature:isCreature()
// creature:isInGhostMode()
// creature:isHealthHidden()
// creature:isMovementBlocked()
// creature:canSee(position)
// creature:canSeeCreature(creature)
// creature:canSeeGhostMode(creature)
// creature:canSeeInvisibility()
// creature:getParent()
// creature:getId()
// creature:getName()
// creature:getTarget()
// creature:setTarget(target)
// creature:getFollowCreature()
// creature:setFollowCreature(followedCreature)
// creature:getMaster()
// creature:setMaster(master)
//g_game.updateCreatureType(creature);
// creature:getLight()
// creature:setLight(color, level)
// creature:getSpeed()
// creature:getBaseSpeed()
// creature:changeSpeed(delta)
// creature:setDropLoot(doDrop)
// creature:setSkillLoss(skillLoss)
// creature:getPosition()
// creature:getTile()
// creature:getDirection()
// creature:setDirection(direction)
// creature:getHealth()
// creature:setHealth(health)
// creature:addHealth(healthChange)
// creature:getMaxHealth()
// creature:setMaxHealth(maxHealth)
// creature:setHiddenHealth(hide)
// creature:setMovementBlocked(state)
// creature:getSkull()
// creature:setSkull(skull)
// creature:getOutfit()
// creature:setOutfit(outfit)
// creature:getCondition(conditionType[, conditionId = CONDITIONID_COMBAT[, subId = 0]])
// creature:addCondition(condition[, force = false])
// creature:removeCondition(conditionType[, conditionId = CONDITIONID_COMBAT[, subId = 0[, force = false]]])
// creature:removeCondition(condition[, force = false])
// creature:hasCondition(conditionType[, subId = 0])
// creature:isImmune(condition or conditionType)
// creature:remove()
// creature:teleportTo(position[, pushMovement = false])
// creature:say(text[, type = TALKTYPE_MONSTER_SAY[, ghost = false[, target = nullptr[, position]]]])
// creature:getDamageMap()
// creature:getSummons()
// creature:getDescription(distance)
// creature:getPathTo(pos[, minTargetDist = 0[, maxTargetDist = 1[, fullPathSearch = true[, clearSight = true[, maxSearchDist = 0]]]]])
// creature:move(direction)
// creature:move(tile[, flags = 0])
// creature:getZone()
// Player
// Player(id or guid or name or userdata)
// player:isPlayer()
// player:getGuid()
// player:getIp()
// player:getAccountId()
// player:getLastLoginSaved()
// player:getLastLogout()
// player:getAccountType()
// player:setAccountType(accountType)
// player:getCapacity()
// player:setCapacity(capacity)
// player:getFreeCapacity()
// player:getDepotChest(depotId[, autoCreate = false])
// player:getInbox()
// player:getSkullTime()
// player:setSkullTime(skullTime)
// player:getDeathPenalty()
// player:getExperience()
// player:addExperience(experience[, sendText = false])
// player:removeExperience(experience[, sendText = false])
// player:getLevel()
// player:getMagicLevel()
// player:getBaseMagicLevel()
// player:getMana()
// player:addMana(manaChange[, animationOnLoss = false])
// player:getMaxMana()
// player:setMaxMana(maxMana)
// player:getManaSpent()
// player:addManaSpent(amount)
// player:removeManaSpent(amount[, notify = true])
// player:getBaseMaxHealth()
// player:getBaseMaxMana()
// player:getSkillLevel(skillType)
// player:getEffectiveSkillLevel(skillType)
// player:getSkillPercent(skillType)
// player:getSkillTries(skillType)
// player:addSkillTries(skillType, tries)
// player:removeSkillTries(skillType, tries[, notify = true])
// player:getSpecialSkill(specialSkillType)
// player:addSpecialSkill(specialSkillType, value)
// player:addOfflineTrainingTime(time)
// player:getOfflineTrainingTime()
// player:removeOfflineTrainingTime(time)
// player:addOfflineTrainingTries(skillType, tries)
// player:getOfflineTrainingSkill()
// player:setOfflineTrainingSkill(skillId)
// player:getItemCount(itemId[, subType = -1])
// player:getItemById(itemId, deepSearch[, subType = -1])
// player:getVocation()
// player:setVocation(id or name or userdata)
// player:getSex()
// player:setSex(newSex)
// player:getTown()
// player:setTown(town)
// player:getGuild()
// player:setGuild(guild)
// player:getGuildLevel()
// player:setGuildLevel(level)
// player:getGuildNick()
// player:setGuildNick(nick)
// player:getGroup()
// player:setGroup(group)
// player:getStamina()
// player:setStamina(stamina)
// player:getSoul()
// player:addSoul(soulChange)
// player:getMaxSoul()
// player:getBankBalance()
// player:setBankBalance(bankBalance)
// player:getStorageValue(key)
// player:setStorageValue(key, value)
// player:addItem(itemId[, count = 1[, canDropOnMap = true[, subType = 1[, slot = CONST_SLOT_WHEREEVER]]]])
// player:addItemEx(item[, canDropOnMap = false[, index = INDEX_WHEREEVER[, flags = 0]]])
// player:addItemEx(item[, canDropOnMap = true[, slot = CONST_SLOT_WHEREEVER]])
// player:removeItem(itemId, count[, subType = -1[, ignoreEquipped = false]])
// player:getMoney()
// player:addMoney(money)
// player:removeMoney(money)
// player:showTextDialog(id or name or userdata[, text[, canWrite[, length]]])
// player:sendTextMessage(type, text[, position, primaryValue = 0, primaryColor = TEXTCOLOR_NONE[, secondaryValue = 0, secondaryColor = TEXTCOLOR_NONE]])
// player:sendTextMessage(type, text, channelId)
// player:sendChannelMessage(author, text, type, channelId)
// player:sendPrivateMessage(speaker, text[, type])
// player:channelSay(speaker, type, text, channelId)
// player:openChannel(channelId)
// player:getSlotItem(slot)
// player:getParty()
// player:addOutfit(lookType)
// player:addOutfitAddon(lookType, addon)
// player:removeOutfit(lookType)
// player:removeOutfitAddon(lookType, addon)
// player:hasOutfit(lookType[, addon = 0])
// player:canWearOutfit(lookType[, addon = 0])
// player:sendOutfitWindow()
// player:addMount(mountId or mountName)
// player:removeMount(mountId or mountName)
// player:hasMount(mountId or mountName)
// player:hasAura(auraId or auraName)
// player:hasWings(wingsId or wingsName)
// player:hasShader(shaderId or shaderName)
// player:getPremiumEndsAt()
// player:setPremiumEndsAt(timestamp)
// player:hasBlessing(blessing)
// player:addBlessing(blessing)
// player:removeBlessing(blessing)
// player:canLearnSpell(spellName)
// player:learnSpell(spellName)
// player:forgetSpell(spellName)
// player:hasLearnedSpell(spellName)
// player:sendTutorial(tutorialId)
// player:addMapMark(position, type, description)
// player:save()
// player:popupFYI(message)
// player:isPzLocked()
// player:getClient()
// player:getHouse()
// player:sendHouseWindow(house, listId)
// player:setEditHouse(house, listId)
// player:setGhostMode(enabled[, showEffect=true])
// player:getContainerId(container)
// player:getContainerById(id)
// player:getContainerIndex(id)
// player:getInstantSpells()
// player:canCast(spell)
// player:hasChaseMode()
// player:hasSecureMode()
// player:getFightMode()
// player:getStoreInbox()
// player:addWing(wingId or wingName)
// player:addAura(auraId or auraName)
// player:addShader(shaderId or shaderName)
// Monster
// Monster(id or userdata)
// monster:isMonster()
// monster:getType()
// monster:rename(name[, nameDescription])
// monster:getSpawnPosition()
// monster:isInSpawnRange([position])
// monster:isIdle()
// monster:setIdle(idle)
// monster:isTarget(creature)
// monster:isOpponent(creature)
// monster:isFriend(creature)
// monster:addFriend(creature)
// monster:removeFriend(creature)
// monster:getFriendList()
// monster:getFriendCount()
// monster:addTarget(creature[, pushFront = false])
// monster:removeTarget(creature)
// monster:getTargetList()
// monster:getTargetCount()
// monster:selectTarget(creature)
// monster:searchTarget([searchType = TARGETSEARCH_DEFAULT])
// monster:isWalkingToSpawn()
// monster:walkToSpawn()
// Npc
// Npc([id or name or userdata])
// npc:isNpc()
// npc:setMasterPos(pos[, radius])
// npc:getSpeechBubble()
// npc:setSpeechBubble(speechBubble)
// Guild
// Guild(id)
// guild:getId()
// guild:getName()
// guild:getMembersOnline()
// guild:addRank(id, name, level)
// guild:getRankById(id)
// guild:getRankByLevel(level)
// guild:getMotd()
// guild:setMotd(motd)
// Group
// Group(id)
// group:getId()
// group:getName()
// group:getFlags()
// group:getAccess()
// group:getMaxDepotItems()
// group:getMaxVipEntries()
// group:hasFlag(flag)
// Vocation
// Vocation(id or name)
// vocation:getId()
// vocation:getClientId()
// vocation:getName()
// vocation:getDescription()
// vocation:getRequiredSkillTries(skillType, skillLevel)
// vocation:getRequiredManaSpent(magicLevel)
// vocation:getCapacityGain()
// vocation:getHealthGain()
// vocation:getHealthGainTicks()
// vocation:getHealthGainAmount()
// vocation:getManaGain()
// vocation:getManaGainTicks()
// vocation:getManaGainAmount()
// vocation:getMaxSoul()
// vocation:getSoulGainTicks()
// vocation:getAttackSpeed()
// vocation:getBaseSpeed()
// vocation:getDemotion()
// vocation:getPromotion()
// vocation:allowsPvp()
// Town
// Town(id or name)
// town:getId()
// town:getName()
// town:getTemplePosition()
// House
// House(id)
// house:getId()
// house:getName()
// house:getTown()
// house:getExitPosition()
// house:getRent()
// house:setRent(rent)
// house:getPaidUntil()
// house:setPaidUntil(timestamp)
// house:getPayRentWarnings()
// house:setPayRentWarnings(warnings)
// house:getOwnerGuid()
// house:setOwnerGuid(guid[, updateDatabase = true])
// house:startTrade(player, tradePartner)
// house:getBeds()
// house:getBedCount()
// house:getDoors()
// house:getDoorCount()
// house:getDoorIdByPosition(position)
// house:getTiles()
// house:getItems()
// house:getTileCount()
// house:canEditAccessList(listId, player)
// house:getAccessList(listId)
// house:setAccessList(listId, list)
// house:kickPlayer(player, targetPlayer)
// house:save()
// ItemType
// ItemType(id or name)
// itemType:isCorpse()
// itemType:isDoor()
// itemType:isContainer()
// itemType:isFluidContainer()
// itemType:isMovable()
// itemType:isRune()
// itemType:isStackable()
// itemType:isReadable()
// itemType:isWritable()
// itemType:isBlocking()
// itemType:isGroundTile()
// itemType:isMagicField()
// itemType:isUseable()
// itemType:isPickupable()
// itemType:getType()
// itemType:getGroup()
// itemType:getId()
// itemType:getClientId()
// itemType:getName()
// itemType:getPluralName()
// itemType:getArticle()
// itemType:getDescription()
// itemType:getSlotPosition()
// itemType:getCharges()
// itemType:getFluidSource()
// itemType:getCapacity()
// itemType:getWeight([count = 1])
// itemType:getWorth()
// itemType:getHitChance()
// itemType:getShootRange()
// itemType:getAttack()
// itemType:getAttackSpeed()
// itemType:getDefense()
// itemType:getExtraDefense()
// itemType:getArmor()
// itemType:getWeaponType()
// itemType:getAmmoType()
// itemType:getCorpseType()
// itemType:getAbilities()
// Stats
// Stats percent
// Skills
// Special skills
// Field absorb percent
// Absorb percent
// itemType:hasShowAttributes()
// itemType:hasShowCount()
// itemType:hasShowCharges()
// itemType:hasShowDuration()
// itemType:hasAllowDistRead()
// itemType:getWieldInfo()
// itemType:getDuration()
// itemType:getLevelDoor()
// itemType:getRuneSpellName()
// itemType:getVocationString()
// itemType:getMinReqLevel()
// itemType:getMinReqMagicLevel()
// itemType:getElementType()
// itemType:getElementDamage()
// itemType:getTransformEquipId()
// itemType:getTransformDeEquipId()
// itemType:getDestroyId()
// itemType:getDecayId()
// itemType:getRequiredLevel()
// itemType:hasSubType()
// itemType:isStoreItem()

if anything is missing you can feel free to include
Post automatically merged:

C++:
// Combat

// Combat()

// combat:setParameter(key, value)

// combat:getParameter(key)

// combat:setFormula(type, mina, minb, maxa, maxb)

// combat:setArea(area)

// combat:addCondition(condition)

// combat:clearConditions()

// combat:setCallback(key, function)

// combat:setOrigin(origin)

// combat:execute(creature, variant)

// Condition

// Condition(conditionType[, conditionId = CONDITIONID_COMBAT])

// condition:delete()

// condition:getId()

// condition:getSubId()

// condition:getType()

// condition:getIcons()

// condition:getEndTime()

// condition:clone()

// condition:getTicks()

// condition:setTicks(ticks)

// condition:setParameter(key, value)

// condition:getParameter(key)

// condition:setFormula(mina, minb, maxa, maxb)

// condition:setOutfit(outfit)

// condition:setOutfit(lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet[, lookAddons[, lookMount, lookWings, lookAura, lookShader]])

// condition:addDamage(rounds, time, value)

// Outfit

// Outfit(looktype)

// outfit == outfitEx

// MonsterType

// MonsterType(name)

// get: monsterType:isAttackable() set: monsterType:isAttackable(bool)

// get: monsterType:isChallengeable() set: monsterType:isChallengeable(bool)

// get: monsterType:isConvinceable() set: monsterType:isConvinceable(bool)

// get: monsterType:isSummonable() set: monsterType:isSummonable(bool)

// get: monsterType:isIgnoringSpawnBlock() set: monsterType:isIgnoringSpawnBlock(bool)

// get: monsterType:isIllusionable() set: monsterType:isIllusionable(bool)

// get: monsterType:isHostile() set: monsterType:isHostile(bool)

// get: monsterType:isPushable() set: monsterType:isPushable(bool)

// get: monsterType:isHealthHidden() set: monsterType:isHealthHidden(bool)

// get: monsterType:isBoss() set: monsterType:isBoss(bool)

// get: monsterType:canPushItems() set: monsterType:canPushItems(bool)

// get: monsterType:canPushCreatures() set: monsterType:canPushCreatures(bool)

// get: monsterType:canWalkOnEnergy() set: monsterType:canWalkOnEnergy(bool)

// get: monsterType:canWalkOnFire() set: monsterType:canWalkOnFire(bool)

// get: monsterType:canWalkOnPoison() set: monsterType:canWalkOnPoison(bool)

// get: monsterType:name() set: monsterType:name(name)

// get: monsterType:nameDescription() set: monsterType:nameDescription(desc)

// get: monsterType:health() set: monsterType:health(health)

// get: monsterType:maxHealth() set: monsterType:maxHealth(health)

// get: monsterType:runHealth() set: monsterType:runHealth(health)

// get: monsterType:experience() set: monsterType:experience(exp)

// get: monsterType:skull() set: monsterType:skull(str/constant)

// get: monsterType:combatImmunities() set: monsterType:combatImmunities(immunity)

// get: monsterType:conditionImmunities() set: monsterType:conditionImmunities(immunity)

// monsterType:getAttackList()

// monsterType:addAttack(monsterspell)

// monsterType:getDefenseList()

// monsterType:addDefense(monsterspell)

// monsterType:getElementList()

// monsterType:addElement(type, percent)

// monsterType:getVoices()

// monsterType:addVoice(sentence, interval, chance, yell)

// monsterType:getLoot()

// monsterType:addLoot(loot)

// monsterType:getCreatureEvents()

// monsterType:registerEvent(name)

// monsterType:onThink(callback)

// monsterType:onAppear(callback)

// monsterType:onDisappear(callback)

// monsterType:onMove(callback)

// monsterType:onSay(callback)

// monstertype:eventType(event)

// monsterType:getSummonList()

// monsterType:addSummon(name, interval, chance)

// get: monsterType:maxSummons() set: monsterType:maxSummons(ammount)

// get: monsterType:armor() set: monsterType:armor(armor)

// get: monsterType:defense() set: monsterType:defense(defense)

// get: monsterType:outfit() set: monsterType:outfit(outfit)

// get: monsterType:race() set: monsterType:race(race)

// get: monsterType:corpseId() set: monsterType:corpseId(id)

// get: monsterType:manaCost() set: monsterType:manaCost(mana)

// get: monsterType:baseSpeed() set: monsterType:baseSpeed(speed)

// get: monsterType:light() set: monsterType:light(color, level)

// get: monsterType:staticAttackChance() set: monsterType:staticAttackChance(chance)

// get: monsterType:targetDistance() set: monsterType:targetDistance(distance)

// get: monsterType:yellChance() set: monsterType:yellChance(chance)

// get: monsterType:yellSpeedTicks() set: monsterType:yellSpeedTicks(rate)

// get: monsterType:changeTargetChance() set: monsterType:changeTargetChance(chance)

// get: monsterType:changeTargetSpeed() set: monsterType:changeTargetSpeed(speed)
 
ok here is constants:
C++:
enum MagicEffectClasses : uint8_t {
    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,
    CONST_ME_ORCSHAMAN = 71,
    CONST_ME_ORCSHAMAN_FIRE = 72,
    CONST_ME_THUNDER = 73,
    CONST_ME_FERUMBRAS = 74,
    CONST_ME_CONFETTI_HORIZONTAL = 75,
    CONST_ME_CONFETTI_VERTICAL = 76,
    MAGIC_EFFECT_BLACKSMOKE = 76,
    MAGIC_EFFECT_NEW_SUDDENDEATH = 77,
    MAGIC_EFFECT_SKULLRX = 78,
    MAGIC_EFFECT_POGCHAMP = 79,
    MAGIC_EFFECT_KAPPA = 80,
    MAGIC_EFFECT_SADCAT = 81,
    MAGIC_EFFECT_PEPEGA = 82,
    MAGIC_EFFECT_LUL = 83,
    MAGIC_EFFECT_HUNTED = 84,
    MAGIC_EFFECT_HARAMBE = 85,
    MAGIC_EFFECT_ADDDD = 86,
    MAGIC_EFFECT_ADDDD3 = 87,
    MAGIC_EFFECT_ADDDD4 = 88,
    MAGIC_EFFECT_ADDDD5 = 89,

    // 77-157 are empty
    CONST_ME_BLACKSMOKE = 158,
    // 159-166 are empty
    CONST_ME_REDSMOKE = 167,
    CONST_ME_YELLOWSMOKE = 168,
    CONST_ME_GREENSMOKE = 169,
    CONST_ME_PURPLESMOKE = 170,
    CONST_ME_EARLY_THUNDER = 171,
    CONST_ME_RAGIAZ_BONECAPSULE = 172,
    CONST_ME_CRITICAL_DAMAGE = 173,
    // 174 is empty
    CONST_ME_PLUNGING_FISH = 175,
};

enum ShootType_t : uint8_t {
    CONST_ANI_NONE,

    CONST_ANI_SPEAR = 1,
    CONST_ANI_BOLT = 2,
    CONST_ANI_ARROW = 3,
    CONST_ANI_FIRE = 4,
    CONST_ANI_ENERGY = 5,
    CONST_ANI_POISONARROW = 6,
    CONST_ANI_BURSTARROW = 7,
    CONST_ANI_THROWINGSTAR = 8,
    CONST_ANI_THROWINGKNIFE = 9,
    CONST_ANI_SMALLSTONE = 10,
    CONST_ANI_DEATH = 11,
    CONST_ANI_LARGEROCK = 12,
    CONST_ANI_SNOWBALL = 13,
    CONST_ANI_POWERBOLT = 14,
    CONST_ANI_POISON = 15,
    CONST_ANI_INFERNALBOLT = 16,
    CONST_ANI_HUNTINGSPEAR = 17,
    CONST_ANI_ENCHANTEDSPEAR = 18,
    CONST_ANI_REDSTAR = 19,
    CONST_ANI_GREENSTAR = 20,
    CONST_ANI_ROYALSPEAR = 21,
    CONST_ANI_SNIPERARROW = 22,
    CONST_ANI_ONYXARROW = 23,
    CONST_ANI_PIERCINGBOLT = 24,
    CONST_ANI_WHIRLWINDSWORD = 25,
    CONST_ANI_WHIRLWINDAXE = 26,
    CONST_ANI_WHIRLWINDCLUB = 27,
    CONST_ANI_ETHEREALSPEAR = 28,
    CONST_ANI_ICE = 29,
    CONST_ANI_EARTH = 30,
    CONST_ANI_HOLY = 31,
    CONST_ANI_SUDDENDEATH = 32,
    CONST_ANI_FLASHARROW = 33,
    CONST_ANI_FLAMMINGARROW = 34,
    CONST_ANI_SHIVERARROW = 35,
    CONST_ANI_ENERGYBALL = 36,
    CONST_ANI_SMALLICE = 37,
    CONST_ANI_SMALLHOLY = 38,
    CONST_ANI_SMALLEARTH = 39,
    CONST_ANI_EARTHARROW = 40,
    CONST_ANI_EXPLOSION = 41,
    CONST_ANI_CAKE = 42,

    CONST_ANI_TARSALARROW = 44,
    CONST_ANI_VORTEXBOLT = 45,

    CONST_ANI_PRISMATICBOLT = 48,
    CONST_ANI_CRYSTALLINEARROW = 49,
    CONST_ANI_DRILLBOLT = 50,
    CONST_ANI_ENVENOMEDARROW = 51,

    CONST_ANI_GLOOTHSPEAR = 53,
    CONST_ANI_SIMPLEARROW = 54,

    // for internal use, don't send to client
    CONST_ANI_WEAPONTYPE = 0xFE, // 254
};

enum SpeakClasses : uint8_t {
    TALKTYPE_SAY = 1,
    TALKTYPE_WHISPER = 2,
    TALKTYPE_YELL = 3,
    TALKTYPE_PRIVATE = 4,
    TALKTYPE_CHANNEL_Y = 5,
    TALKTYPE_RVR_CHANNEL = 6,
    TALKTYPE_RVR_ANSWER = 7,
    TALKTYPE_RVR_CONTINUE = 8,
    TALKTYPE_BROADCAST = 9,
    TALKTYPE_CHANNEL_R1 = 10, //red - #c text
    TALKTYPE_PRIVATE_RED = 11, //@name@text
    TALKTYPE_CHANNEL_O = 12, //@name@text
    TALKTYPE_CHANNEL_R2 = 14, //#d
    TALKTYPE_MONSTER_SAY = 17,
    TALKTYPE_MONSTER_YELL = 17,
};

enum MessageClasses : uint8_t {
    MESSAGE_STATUS_CONSOLE_YELLOW = 1, /*Yellow message in the console*/
    MESSAGE_STATUS_CONSOLE_LIGHTBLUE = 4, /*Light blue message in the console*/
    MESSAGE_STATUS_CONSOLE_ORANGE = 17, /*Orange message in the console*/
    MESSAGE_STATUS_WARNING = 18, /*Red message in game window and in the console*/

    MESSAGE_EVENT_ADVANCE = 19, /*White message in game window and in the console*/
    MESSAGE_EVENT_DEFAULT = 20, /*White message at the bottom of the game window and in the console*/

    MESSAGE_STATUS_DEFAULT = 21, /*White message at the bottom of the game window and in the console*/

    MESSAGE_INFO_DESCR = 22, /*Green message in game window and in the console*/

    MESSAGE_STATUS_SMALL = 23, /*White message at the bottom of the game window"*/
    MESSAGE_STATUS_CONSOLE_BLUE = 24, /*Blue message in the console*/
    MESSAGE_STATUS_CONSOLE_RED = 25, /*Red message in the console*/
};

enum FluidColors_t : uint8_t {
    FLUID_EMPTY,
    FLUID_BLUE,
    FLUID_RED,
    FLUID_BROWN,
    FLUID_GREEN,
    FLUID_YELLOW,
    FLUID_WHITE,
    FLUID_PURPLE,
};

enum FluidTypes_t : uint8_t {
    FLUID_NONE = FLUID_EMPTY,
    FLUID_WATER = FLUID_BLUE,
    FLUID_BLOOD = FLUID_RED,
    FLUID_BEER = FLUID_BROWN,
    FLUID_SLIME = FLUID_GREEN,
    FLUID_LEMONADE = FLUID_YELLOW,
    FLUID_MILK = FLUID_WHITE,
    FLUID_MANA = FLUID_PURPLE,

    FLUID_LIFE = FLUID_RED + 8,
    FLUID_OIL = FLUID_BROWN + 8,
    FLUID_URINE = FLUID_YELLOW + 8,
    FLUID_COCONUTMILK = FLUID_WHITE + 8,
    FLUID_WINE = FLUID_PURPLE + 8,

    FLUID_MUD = FLUID_BROWN + 16,
    FLUID_FRUITJUICE = FLUID_YELLOW + 16,

    FLUID_LAVA = FLUID_RED + 24,
    FLUID_RUM = FLUID_BROWN + 24,
    FLUID_SWAMP = FLUID_GREEN + 24,

    FLUID_TEA = FLUID_BROWN + 32,

    FLUID_MEAD = FLUID_BROWN + 40,
};

const uint8_t reverseFluidMap[] = {
    FLUID_EMPTY,
    FLUID_WATER,
    FLUID_MANA,
    FLUID_BEER,
    FLUID_EMPTY,
    FLUID_BLOOD,
    FLUID_SLIME,
    FLUID_EMPTY,
    FLUID_LEMONADE,
    FLUID_MILK,
};

const uint8_t clientToServerFluidMap[] = {
    FLUID_EMPTY,
    FLUID_WATER,
    FLUID_MANA,
    FLUID_BEER,
    FLUID_MUD,
    FLUID_BLOOD,
    FLUID_SLIME,
    FLUID_RUM,
    FLUID_LEMONADE,
    FLUID_MILK,
    FLUID_WINE,
    FLUID_LIFE,
    FLUID_URINE,
    FLUID_OIL,
    FLUID_FRUITJUICE,
    FLUID_COCONUTMILK,
    FLUID_TEA,
    FLUID_MEAD,
};

enum ClientFluidTypes_t : uint8_t {
    CLIENTFLUID_EMPTY = 0,
    CLIENTFLUID_BLUE = 1,
    CLIENTFLUID_PURPLE = 2,
    CLIENTFLUID_BROWN_1 = 3,
    CLIENTFLUID_BROWN_2 = 4,
    CLIENTFLUID_RED = 5,
    CLIENTFLUID_GREEN = 6,
    CLIENTFLUID_BROWN = 7,
    CLIENTFLUID_YELLOW = 8,
    CLIENTFLUID_WHITE = 9,
};

const uint8_t fluidMap[] = {
    CLIENTFLUID_EMPTY,
    CLIENTFLUID_BLUE,
    CLIENTFLUID_RED,
    CLIENTFLUID_BROWN_1,
    CLIENTFLUID_GREEN,
    CLIENTFLUID_YELLOW,
    CLIENTFLUID_WHITE,
    CLIENTFLUID_PURPLE,
};

enum SquareColor_t : uint8_t {
    SQ_COLOR_BLACK = 0,
};

enum TextColor_t : uint8_t {
    TEXTCOLOR_BLUE = 5,
    TEXTCOLOR_LIGHTGREEN = 30,
    TEXTCOLOR_LIGHTBLUE = 35,
    TEXTCOLOR_MAYABLUE = 95,
    TEXTCOLOR_DARKRED = 108,
    TEXTCOLOR_LIGHTGREY = 129,
    TEXTCOLOR_SKYBLUE = 143,
    //TEXTCOLOR_PURPLE = 154,
    TEXTCOLOR_PURPLE = 155,
    TEXTCOLOR_ELECTRICPURPLE = 155,
    TEXTCOLOR_RED = 180,
    TEXTCOLOR_PASTELRED = 194,
    TEXTCOLOR_ORANGE = 198,
    TEXTCOLOR_YELLOW = 210,
    TEXTCOLOR_WHITE_EXP = 215,
    TEXTCOLOR_NONE = 255,
};

enum Icons_t {
    ICON_POISON = 1 << 0,
    ICON_BURN = 1 << 1,
    ICON_ENERGY =  1 << 2,
    ICON_DRUNK = 1 << 3,
    ICON_MANASHIELD = 1 << 4,
    ICON_PARALYZE = 1 << 5,
    ICON_HASTE = 1 << 6,
    ICON_SWORDS = 1 << 7,
    ICON_DROWNING = 1 << 8,
    ICON_FREEZING = 1 << 9,
    ICON_DAZZLED = 1 << 10,
    ICON_CURSED = 1 << 11,
    ICON_PARTY_BUFF = 1 << 12,
    ICON_REDSWORDS = 1 << 13,
    ICON_PIGEON = 1 << 14,
    ICON_BLEEDING = 1 << 15,
};

enum WeaponType_t : uint8_t {
    WEAPON_NONE,
    WEAPON_SWORD,
    WEAPON_CLUB,
    WEAPON_AXE,
    WEAPON_SHIELD,
    WEAPON_DISTANCE,
    WEAPON_WAND,
    WEAPON_AMMO,
};

enum Ammo_t : uint8_t {
    AMMO_NONE,
    AMMO_BOLT,
    AMMO_ARROW,
    AMMO_SPEAR,
    AMMO_THROWINGSTAR,
    AMMO_THROWINGKNIFE,
    AMMO_STONE,
    AMMO_SNOWBALL,
};

enum WeaponAction_t : uint8_t {
    WEAPONACTION_NONE,
    WEAPONACTION_REMOVECOUNT,
    WEAPONACTION_REMOVECHARGE,
    WEAPONACTION_MOVE,
};

enum WieldInfo_t {
    WIELDINFO_NONE = 0 << 0,
    WIELDINFO_LEVEL = 1 << 0,
    WIELDINFO_MAGLV = 1 << 1,
    WIELDINFO_VOCREQ = 1 << 2,
    WIELDINFO_PREMIUM = 1 << 3,
};

enum Skulls_t : uint8_t {
    SKULL_NONE = 0,
    SKULL_YELLOW = 1,
    SKULL_GREEN = 2,
    SKULL_WHITE = 3,
    SKULL_RED = 4,
    SKULL_BLACK = 5,
    SKULL_ORANGE = 6,
};

enum PartyShields_t : uint8_t {
    SHIELD_NONE = 0,
    SHIELD_WHITEYELLOW = 1,
    SHIELD_WHITEBLUE = 2,
    SHIELD_BLUE = 3,
    SHIELD_YELLOW = 4,
    SHIELD_BLUE_SHAREDEXP = 5,
    SHIELD_YELLOW_SHAREDEXP = 6,
    SHIELD_BLUE_NOSHAREDEXP_BLINK = 7,
    SHIELD_YELLOW_NOSHAREDEXP_BLINK = 8,
    SHIELD_BLUE_NOSHAREDEXP = 9,
    SHIELD_YELLOW_NOSHAREDEXP = 10,
    SHIELD_GRAY = 11,
};

enum GuildEmblems_t : uint8_t {
    GUILDEMBLEM_NONE = 0,
    GUILDEMBLEM_ALLY = 1,
    GUILDEMBLEM_ENEMY = 2,
    GUILDEMBLEM_NEUTRAL = 3,
    GUILDEMBLEM_MEMBER = 4,
    GUILDEMBLEM_OTHER = 5,
};


enum item_t : uint16_t {
    ITEM_BROWSEFIELD = 460, // for internal use

    ITEM_FIREFIELD_PVP_FULL = 1487,
    ITEM_FIREFIELD_PVP_MEDIUM = 1488,
    ITEM_FIREFIELD_PVP_SMALL = 1489,
    ITEM_FIREFIELD_PERSISTENT_FULL = 1492,
    ITEM_FIREFIELD_PERSISTENT_MEDIUM = 1493,
    ITEM_FIREFIELD_PERSISTENT_SMALL = 1494,
    ITEM_FIREFIELD_NOPVP = 1500,

    ITEM_POISONFIELD_PVP = 1490,
    ITEM_POISONFIELD_PERSISTENT = 1496,
    ITEM_POISONFIELD_NOPVP = 1503,

    ITEM_ENERGYFIELD_PVP = 1491,
    ITEM_ENERGYFIELD_PERSISTENT = 1495,
    ITEM_ENERGYFIELD_NOPVP = 1504,

    ITEM_MAGICWALL = 1497,
    ITEM_MAGICWALL_PERSISTENT = 1498,
    ITEM_MAGICWALL_SAFE = 1497,
    ITEM_MAGICWALL_NOPVP = 1497,

    ITEM_WILDGROWTH = 1499,
    ITEM_WILDGROWTH_PERSISTENT = 2721,
    ITEM_WILDGROWTH_SAFE = 1499,
    ITEM_WILDGROWTH_NOPVP = 1499,

    ITEM_BAG = 1987,
    //ITEM_SHOPPING_BAG = 23782,

    ITEM_GOLD_COIN = 2148,
    ITEM_PLATINUM_COIN = 2152,
    ITEM_CRYSTAL_COIN = 2160,
    ITEM_STORE_COIN = 24774, // in-game store currency

    ITEM_DEPOT = 2594,
    ITEM_LOCKER1 = 2589,
    /*ITEM_INBOX = 14404,
    ITEM_MARKET = 14405,
    ITEM_STORE_INBOX = 26052,
    ITEM_DEPOT_BOX_I = 25453,
    ITEM_DEPOT_BOX_II = 25454,
    ITEM_DEPOT_BOX_III = 25455,
    ITEM_DEPOT_BOX_IV = 25456,
    ITEM_DEPOT_BOX_V = 25457,
    ITEM_DEPOT_BOX_VI = 25458,
    ITEM_DEPOT_BOX_VII = 25459,
    ITEM_DEPOT_BOX_VIII = 25460,
    ITEM_DEPOT_BOX_IX = 25461,
    ITEM_DEPOT_BOX_X = 25462,
    ITEM_DEPOT_BOX_XI = 25463,
    ITEM_DEPOT_BOX_XII = 25464,
    ITEM_DEPOT_BOX_XIII = 25465,
    ITEM_DEPOT_BOX_XIV = 25466,
    ITEM_DEPOT_BOX_XV = 25467,
    ITEM_DEPOT_BOX_XVI = 25468,
    ITEM_DEPOT_BOX_XVII = 25469,*/

    ITEM_MALE_CORPSE = 3058,
    ITEM_FEMALE_CORPSE = 3065,

    ITEM_FULLSPLASH = 2016,
    ITEM_SMALLSPLASH = 2019,

    ITEM_PARCEL = 2595,
    ITEM_LETTER = 2597,
    ITEM_LETTER_STAMPED = 2598,
    ITEM_LABEL = 2599,

    ITEM_AMULETOFLOSS = 2173,

    ITEM_DOCUMENT_RO = 1968, //read-only
};

enum PlayerFlags : uint64_t {
    PlayerFlag_CannotUseCombat = 1 << 0,
    PlayerFlag_CannotAttackPlayer = 1 << 1,
    PlayerFlag_CannotAttackMonster = 1 << 2,
    PlayerFlag_CannotBeAttacked = 1 << 3,
    PlayerFlag_CanConvinceAll = 1 << 4,
    PlayerFlag_CanSummonAll = 1 << 5,
    PlayerFlag_CanIllusionAll = 1 << 6,
    PlayerFlag_CanSenseInvisibility = 1 << 7,
    PlayerFlag_IgnoredByMonsters = 1 << 8,
    PlayerFlag_NotGainInFight = 1 << 9,
    PlayerFlag_HasInfiniteMana = 1 << 10,
    PlayerFlag_HasInfiniteSoul = 1 << 11,
    PlayerFlag_HasNoExhaustion = 1 << 12,
    PlayerFlag_CannotUseSpells = 1 << 13,
    PlayerFlag_CannotPickupItem = 1 << 14,
    PlayerFlag_CanAlwaysLogin = 1 << 15,
    PlayerFlag_CanBroadcast = 1 << 16,
    PlayerFlag_CanEditHouses = 1 << 17,
    PlayerFlag_CannotBeBanned = 1 << 18,
    PlayerFlag_CannotBePushed = 1 << 19,
    PlayerFlag_HasInfiniteCapacity = 1 << 20,
    PlayerFlag_CanPushAllCreatures = 1 << 21,
    PlayerFlag_CanTalkRedPrivate = 1 << 22,
    PlayerFlag_CanTalkRedChannel = 1 << 23,
    PlayerFlag_TalkOrangeHelpChannel = 1 << 24,
    PlayerFlag_NotGainExperience = 1 << 25,
    PlayerFlag_NotGainMana = 1 << 26,
    PlayerFlag_NotGainHealth = 1 << 27,
    PlayerFlag_NotGainSkill = 1 << 28,
    PlayerFlag_SetMaxSpeed = 1 << 29,
    PlayerFlag_SpecialVIP = 1 << 30,
    PlayerFlag_NotGenerateLoot = static_cast<uint64_t>(1) << 31,
    // PlayerFlag with exponent 32 existed but was deprecated (feature dropped from client).
    PlayerFlag_IgnoreProtectionZone = static_cast<uint64_t>(1) << 33,
    PlayerFlag_IgnoreSpellCheck = static_cast<uint64_t>(1) << 34,
    PlayerFlag_IgnoreWeaponCheck = static_cast<uint64_t>(1) << 35,
    PlayerFlag_CannotBeMuted = static_cast<uint64_t>(1) << 36,
    PlayerFlag_IsAlwaysPremium = static_cast<uint64_t>(1) << 37,
    PlayerFlag_IgnoreYellCheck = static_cast<uint64_t>(1) << 38,
    PlayerFlag_IgnoreSendPrivateCheck = static_cast<uint64_t>(1) << 39,
};

enum ReloadTypes_t : uint8_t  {
    RELOAD_TYPE_ALL,
    RELOAD_TYPE_ACTIONS,
    RELOAD_TYPE_AURAS,
    RELOAD_TYPE_SHADERS,
    RELOAD_TYPE_WINGS,
    RELOAD_TYPE_CHAT,
    RELOAD_TYPE_CONFIG,
    RELOAD_TYPE_CREATURESCRIPTS,
    RELOAD_TYPE_EVENTS,
    RELOAD_TYPE_GLOBAL,
    RELOAD_TYPE_GLOBALEVENTS,
    RELOAD_TYPE_ITEMS,
    RELOAD_TYPE_MONSTERS,
    RELOAD_TYPE_MOUNTS,
    RELOAD_TYPE_MOVEMENTS,
    RELOAD_TYPE_NPCS,
    RELOAD_TYPE_QUESTS,
    RELOAD_TYPE_RAIDS,
    RELOAD_TYPE_SCRIPTS,
    RELOAD_TYPE_SPELLS,
    RELOAD_TYPE_TALKACTIONS,
    RELOAD_TYPE_WEAPONS,
};

// OTCv8 features (from src/client/const.h)
enum GameFeature {
    GameProtocolChecksum = 1,
    GameAccountNames = 2,
    GameChallengeOnLogin = 3,
    GamePenalityOnDeath = 4,
    GameNameOnNpcTrade = 5,
    GameDoubleFreeCapacity = 6,
    GameDoubleExperience = 7,
    GameTotalCapacity = 8,
    GameSkillsBase = 9,
    GamePlayerRegenerationTime = 10,
    GameChannelPlayerList = 11,
    GamePlayerMounts = 12,
    GameEnvironmentEffect = 13,
    GameCreatureEmblems = 14,
    GameItemAnimationPhase = 15,
    GameMagicEffectU16 = 16,
    GamePlayerMarket = 17,
    GameSpritesU32 = 18,
    GameTileAddThingWithStackpos = 19,
    GameOfflineTrainingTime = 20,
    GamePurseSlot = 21,
    GameFormatCreatureName = 22,
    GameSpellList = 23,
    GameClientPing = 24,
    GameExtendedClientPing = 25,
    GameDoubleHealth = 28,
    GameDoubleSkills = 29,
    GameChangeMapAwareRange = 30,
    GameMapMovePosition = 31,
    GameAttackSeq = 32,
    GameBlueNpcNameColor = 33,
    GameDiagonalAnimatedText = 34,
    GameLoginPending = 35,
    GameNewSpeedLaw = 36,
    GameForceFirstAutoWalkStep = 37,
    GameMinimapRemove = 38,
    GameDoubleShopSellAmount = 39,
    GameContainerPagination = 40,
    GameThingMarks = 41,
    GameLooktypeU16 = 42,
    GamePlayerStamina = 43,
    GamePlayerAddons = 44,
    GameMessageStatements = 45,
    GameMessageLevel = 46,
    GameNewFluids = 47,
    GamePlayerStateU16 = 48,
    GameNewOutfitProtocol = 49,
    GamePVPMode = 50,
    GameWritableDate = 51,
    GameAdditionalVipInfo = 52,
    GameBaseSkillU16 = 53,
    GameCreatureIcons = 54,
    GameHideNpcNames = 55,
    GameSpritesAlphaChannel = 56,
    GamePremiumExpiration = 57,
    GameBrowseField = 58,
    GameEnhancedAnimations = 59,
    GameOGLInformation = 60,
    GameMessageSizeCheck = 61,
    GamePreviewState = 62,
    GameLoginPacketEncryption = 63,
    GameClientVersion = 64,
    GameContentRevision = 65,
    GameExperienceBonus = 66,
    GameAuthenticator = 67,
    GameUnjustifiedPoints = 68,
    GameSessionKey = 69,
    GameDeathType = 70,
    GameIdleAnimations = 71,
    GameKeepUnawareTiles = 72,
    GameIngameStore = 73,
    GameIngameStoreHighlights = 74,
    GameIngameStoreServiceType = 75,
    GameAdditionalSkills = 76,
    GameDistanceEffectU16 = 77,
    GamePrey = 78,
    GameDoubleMagicLevel = 79,

    GameExtendedOpcode = 80,
    GameMinimapLimitedToSingleFloor = 81,
    GameSendWorldName = 82,

    GameDoubleLevel = 83,
    GameDoubleSoul = 84,
    GameDoublePlayerGoodsMoney = 85,
    GameCreatureWalkthrough = 86,
    GameDoubleTradeMoney = 87,
    GameSequencedPackets = 88,
    GameTibia12Protocol = 89,

    // 90-99 otclientv8 features
    GameNewWalking = 90,
    GameSlowerManualWalking = 91,

    GameItemTooltip = 93,

    GameBot = 95,
    GameBiggerMapCache = 96,
    GameForceLight = 97,
    GameNoDebug = 98,
    GameBotProtection = 99,

    // Custom features for customer
    GameFasterAnimations = 101,
    GameCenteredOutfits = 102,
    GameSendIdentifiers = 103,
    GameWingsAndAura = 104,
    GamePlayerStateU32 = 105,
    GameOutfitShaders = 106
    LastGameFeature = 106
Post automatically merged:


enjoy.

Lua:
create some random function for theforgottenserver 1.5 i want you to display some message to player when he uses an object
ChatGPT
Sure, here's an example of a random function in Lua for TheForgottenServer 1.5 that displays a message to a player when they use an object:

lua
Copy code
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    -- Define a table of messages
    local messages = {
        "You feel a strange energy as you touch the object.",
        "The object vibrates slightly in your hand.",
        "A faint whisper echoes in your mind as you use the object.",
        "You sense a mysterious presence surrounding the object.",
        "Using the object fills you with a sense of curiosity.",
        "A tingling sensation courses through your body as you interact with the object."
    }
    
    -- Choose a random message from the table
    local randomIndex = math.random(1, #messages)
    local message = messages[randomIndex]
    
    -- Display the message to the player
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
    
    -- Perform any other actions related to using the object
    -- For example, you can add code here to trigger effects or events
    
    return true
end
In this example, the onUse function is called whenever a player uses an object. It selects a random message from a table of predefined messages and sends it to the player using the sendTextMessage function. You can customize the messages and add additional functionality as needed.
 
Back
Top