• 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!

Updated Lua Functions List

Syntax

Developer
Joined
Oct 10, 2007
Messages
2,890
Reaction score
458
Location
Texas
Got a few mins to post this so here ya go. :p

Source:
Lua Functions

Article:
Code:
addDamageCondition(condition, rounds, time, value)
addEvent(callback, delay, ...)
addOutfitCondition(condition, outfit)
canPlayerWearOutfit(cid, looktype[, addon = 0])
canPlayerWearOutfitId(cid, outfitId[, addon = 0])
createCombatArea({area}[, {extArea}])
createCombatObject()
createConditionObject(type[, ticks[, buff[, subId]]])
doAddAccountBanishment(...)
doAddCondition(cid, condition)
doAddContainerItem(uid, itemid[, count/subType])
doAddContainerItemEx(uid, virtuid)
doAddIpBanishment(...)
doAddNotation(...)
doAddPlayerBanishment(...)
doAddStatement(...)
doChallengeCreature(cid, target)
doChangeSpeed(cid, delta)
doCleanHouse(houseId)
doCleanMap()
doCleanTile(pos[, forceMapLoaded = false])
doCombat(cid, combat, param)
doCombatAreaCondition(cid, pos, area, condition, effect)
doCombatAreaDispel(cid, pos, area, type, effect)
doCombatAreaHealth(cid, type, pos, area, min, max, effect)
doCombatAreaMana(cid, pos, area, min, max, effect)
doConvinceCreature(cid, target)
doCreateItem(itemid[, type/count], pos)
doCreateItemEx(itemid[, count/subType = -1])
doCreateMonster(name, pos[, displayError = true])
doCreateNpc(name, pos[, displayError = true])
doCreateTeleport(itemid, topos, createpos)
doCreatureAddHealth(cid, health[, hitEffect[, hitColor[, force]]])
doCreatureAddMana(cid, mana)
doCreatureChangeOutfit(cid, outfit)
doCreatureExecuteTalkAction(cid, text[, ignoreAccess[, channelId]])
doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
doCreatureSetDropLoot(cid, doDrop)
doCreatureSetGuildEmblem(cid, emblem)
doCreatureSetHideHealth(cid, hide)
doCreatureSetLookDirection(cid, dir)
doCreatureSetNoMove(cid, block)
doCreatureSetPartyShield(cid, shield)
doCreatureSetSkullType(cid, skull)
doCreatureSetSpeakType(cid, type)
doCreatureSetStorage(uid, key, value)
doDecayItem(uid)
dodirectory(dir)
doExecuteRaid(name)
doGuildAddEnemy(guild, enemy, war, mode)
doGuildRemoveEnemy(guild, enemy)
doItemEraseAttribute(uid, key)
doItemRaidUnref(uid)
doItemSetAttribute(uid, key, value)
domodlib(lib)
doMonsterChangeTarget(cid)
doMonsterSetTarget(cid, target)
doMoveCreature(cid, direction)
doPlayerAddBlessing(cid, blessing)
doPlayerAddExperience(cid, amount)
doPlayerAddItem(cid, itemid[, count[, canDropOnMap[, subtype]]])
doPlayerAddItemEx(cid, uid[, canDropOnMap = FALSE])
doPlayerAddMapMark(cid, pos, type[, description])
doPlayerAddMoney(cid, money)
doPlayerAddOutfit(cid, looktype, addon)
doPlayerAddOutfitId(cid, outfitId, addon)
doPlayerAddPremiumDays(cid, days)
doPlayerAddSkillTry(cid, skillid, n[, useMultiplier])
doPlayerAddSoul(cid, soul)
doPlayerAddSpentMana(cid, amount[, useMultiplier])
doPlayerAddStamina(cid, minutes)
doPlayerFeed(cid, food)
doPlayerJoinParty(cid, lid)
doPlayerLearnInstantSpell(cid, name)
doPlayerPopupFYI(cid, message)
doPlayerRemoveItem(cid, itemid[, count[, subType]])
doPlayerRemoveMoney(cid, money)
doPlayerRemoveOutfit(cid, looktype[, addon = 0])
doPlayerRemoveOutfitId(cid, outfitId[, addon = 0])
doPlayerSave(cid[, shallow = false])
doPlayerSendCancel(cid, text)
doPlayerSendChannelMessage(cid, author, message, SpeakClasses, channel)
doPlayerSendDefaultCancel(cid, ReturnValue)
doPlayerSendMailByName(name, item[, town[, actor]])
doPlayerSendOutfitWindow(cid)
doPlayerSendTextMessage(cid, MessageClasses, message)
doPlayerSendToChannel(cid, targetId, SpeakClasses, message, channel[, time])
doPlayerSendTutorial(cid, id)
doPlayerSetBalance(cid, balance)
doPlayerSetGroupId(cid, newGroupId)
doPlayerSetGuildId(cid, id)
doPlayerSetGuildLevel(cid, level[, rank])
doPlayerSetGuildNick(cid, nick)
doPlayerSetIdleTime(cid, amount)
doPlayerSetLossPercent(cid, lossType, newPercent)
doPlayerSetLossSkill(cid, doLose)
doPlayerSetMaxCapacity(cid, cap)
doPlayerSetNameDescription(cid, desc)
doPlayerSetPartner(cid, guid)
doPlayerSetPromotionLevel(cid, level)
doPlayerSetPzLocked(cid, locked)
doPlayerSetRate(cid, type, value)
doPlayerSetSex(cid, newSex)
doPlayerSetSkullEnd(cid, time, type)
doPlayerSetSpecialDescription(cid, desc)
doPlayerSetStamina(cid, minutes)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
doPlayerSwitchSaving(cid)
doPlayerTransferMoneyTo(cid, target, money)
doPlayerUnlearnInstantSpell(cid, name)
doRefreshMap()
doReloadInfo(id[, cid])
doRelocate(pos, posTo[, creatures = true]) Moves all moveable objects from pos to posTo
doRemoveAccountBanishment(accountId[, playerId])
doRemoveCondition(cid, type[, subId])
doRemoveConditions(cid[, onlyPersistent])
doRemoveCreature(cid[, forceLogout = true])
doRemoveIpBanishment(ip[, mask])
doRemoveItem(uid[, count])
doRemoveNotations(accountId[, playerId])
doRemovePlayerBanishment(name/guid, type)
doRemoveStatements(name/guid[, channelId])
doSaveServer([shallow = false])
doSendAnimatedText(pos, text, color[, player])
doSendCreatureSquare(cid, color[, player])
doSendDistanceShoot(fromPos, toPos, type[, player])
doSendMagicEffect(pos, type[, player])
doSetCreatureLight(cid, lightLevel, lightColor, time)
doSetCreatureOutfit(cid, outfit, time)
doSetGameState(id)
doSetItemOutfit(cid, item, time)
doSetMonsterOutfit(cid, name, time)
doSetStorage(key, value)
doShowTextDialog(cid, itemid, text)
doSummonMonster(cid, name)
doTargetCombatCondition(cid, target, condition, effect)
doTargetCombatDispel(cid, target, type, effect)
doTargetCombatHealth(cid, target, type, min, max, effect)
doTargetCombatMana(cid, target, min, max, effect)
doTeleportThing(cid, newpos[, pushmove])
doTileAddItemEx(pos, uid)
doTileQueryAdd(uid, pos[, flags[, displayError = true]])
doTransformItem(uid, newId[, count/subType])
doUpdateHouseAuctions()
doWaypointAddTemporial(name, pos)
getAccountByAccountId(accId)
getAccountByName(name)
getAccountIdByAccount(accName)
getAccountIdByName(name)
getBanAction(id)
getBanData(value[, type[, param]])
getBanList(type[, value[, param]])
getBanReason(id)
getChannelUsers(channelId)
getClosestFreeTile(cid, targetpos[, extended = false[, ignoreHouse = true]])
getConfigFile()
getConfigValue(key)
getContainerCap(uid)
getContainerItem(uid, slot)
getContainerSize(uid)
getCreatureBaseSpeed(cid)
getCreatureByName(name)
getCreatureCondition(cid, condition[, subId])
getCreatureGuildEmblem(cid[, target])
 getCreatureHealth(cid)
getCreatureHideHealth(cid)
getCreatureLastPosition(cid)
getCreatureLookDirection(cid)
getCreatureMana(cid)
getCreatureMaster(cid)
 getCreatureMaxHealth(cid)
getCreatureMaxMana(cid)
getCreatureName(cid)
getCreatureNoMove(cid)
getCreatureOutfit(cid)
getCreaturePartyShield(cid[, target])
getCreatureSkullType(cid[, target])
getCreatureSpeakType(cid)
getCreatureSpeed(cid)
getCreatureStorage(uid, key)
getCreatureSummons(cid)
getCreatureTarget(cid)
getDataDir()
getExperienceStage(level)
getExperienceStageList()
getGameState()
getGroupInfo(id)
getGuildId(guildName)
getGuildMotd(guildId)
getHighscoreString(skillId)
getHouseAccessList(houseid, listId)
getHouseByPlayerGUID(playerGUID)
getHouseFromPos(pos)
getHouseInfo(houseId)
getInstantSpellInfo(cid, name)
getIpByName(name)
getItemAttribute(uid, key)
getItemIdByName(name[, displayError = true])
getItemInfo(itemid)
getItemWeight(uid[, precise = true])
getLogsDir()
getModList()
getMonsterFriendList(cid)
getMonsterInfo(name)
getMonsterTargetList(cid)
getNotationsCount(accountId[, playerId])
getPartyMembers(lid)
getPlayerAccess(cid)
getPlayerAccount(cid)
getPlayerAccountId(cid)
getPlayerAccountManager(cid)
getPlayerBalance(cid)
getPlayerBlessing(cid, blessing)
getPlayerByGUID(guid)
getPlayerByNameWildcard(name~[, ret = false])
getPlayerCustomFlagValue(cid, flag)
getPlayerDepotItems(cid, depotid)
getPlayerExperience(cid)
getPlayerFlagValue(cid, flag)
getPlayerFood(cid)
getPlayerFreeCap(cid)
getPlayerGhostAccess(cid)
getPlayerGroupId(cid)
getPlayerGUID(cid)
getPlayerGUIDByName(name[, multiworld = false])
getPlayerGuildId(cid)
getPlayerGuildLevel(cid)
getPlayerGuildName(cid)
getPlayerGuildNick(cid)
getPlayerGuildRank(cid)
getPlayerGuildRankId(cid)
getPlayerIdleTime(cid)
getPlayerInstantSpellCount(cid)
getPlayerInstantSpellInfo(cid, index)
getPlayerIp(cid)
getPlayerItemById(cid, deepSearch, itemId[, subType = -1])
getPlayerItemCount(cid, itemid[, subType = -1])
getPlayerLastLoad(cid)
getPlayerLastLogin(cid)
getPlayerLearnedInstantSpell(cid, name)
getPlayerLevel(cid)
getPlayerLight(cid)
getPlayerLossPercent(cid, lossType)
getPlayerLossSkill(cid)
getPlayerMagLevel(cid[, ignoreBuffs = false])
getPlayerMoney(cid)
getPlayerNameByGUID(guid[, multiworld = false[, displayError = true]])
getPlayerNameDescription(cid)
getPlayerPartner(cid)
getPlayerParty(cid)
getPlayerPremiumDays(cid)
getPlayerPromotionLevel(cid)
getPlayerRates(cid)
getPlayerRequiredMana(cid, magicLevel)
getPlayerRequiredSkillTries(cid, skillId, skillLevel)
getPlayersByAccountId(accId)
getPlayersByIp(ip[, mask = 0xFFFFFFFF])
getPlayerSex(cid[, full = false])
getPlayerSkillLevel(cid, skillid)
getPlayerSkillTries(cid, skillid)
getPlayerSkullEnd(cid)
getPlayerSlotItem(cid, slot)
 getPlayersOnline()
getPlayerSoul(cid)
getPlayerSpecialDescription(cid)
getPlayerSpentMana(cid)
getPlayerStamina(cid)
getPlayerTown(cid)
getPlayerVocation(cid)
getPlayerWeapon(cid[, ignoreAmmo = false])
getSearchString(fromPosition, toPosition[, fromIsCreature = false[, toIsCreature = false]])
getSpectators(centerPos, rangex, rangey[, multifloor = false])
getStatementsCount(name/guid[, channelId])
getStorage(key)
getTalkActionList()
getThing(uid)
getThingFromPos(pos[, displayError = true])
getThingPosition(uid)
getTileInfo(pos)
getTileItemById(pos, itemId[, subType = -1])
getTileItemByType(pos, type)
getTileThingByPos(pos)
getTopCreature(pos)
getTownHouses(townId)
getTownId(townName)
getTownName(townId)
getTownTemplePosition(townId[, displayError])
getVocationInfo(id)
getWaypointList()
getWaypointPosition(name)
getWorldCreatures(type) 0 players, 1 monsters, 2 npcs, 3 all
getWorldLight()
getWorldTime()
getWorldType()
getWorldUpTime()
hasItemProperty(uid)
hasPlayerClient(cid)
isAccountBanished(accountId[, playerId])
isContainer(uid)
isCreature(cid)
isInArray(array, value[, caseSensitive = false])
isIpBanished(ip[, mask])
isMovable(uid)
isPlayerBanished(name/guid, type)
isPlayerPzLocked(cid)
isPlayerSaving(cid)
isSightClear(fromPos, toPos, floorCheck)
loadmodlib(lib)
numberToVariant(number)
positionToVariant(pos)
registerCreatureEvent(uid, eventName)
setCombatArea(combat, area)
setCombatCallBack(combat, key, function_name)
setCombatCondition(combat, condition)
setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])
setCombatParam(combat, key, value)
setConditionFormula(combat, mina, minb, maxa, maxb)
setConditionParam(condition, key, value)
 setCreatureMaxHealth(cid, health)
setCreatureMaxMana(cid, mana)
setHouseAccessList(houseid, listid, listtext)
setHouseOwner(houseId, owner[, clean])
setWorldType(type)
stopEvent(eventid)
stringToVariant(string)
targetPositionToVariant(pos)
variantToNumber(var)
variantToPosition(var)
variantToString(var)
 
If you post all keys to this function I will be grateful :)

Mmm.. the keys that i know are:

Lua:
getItemAttribute(uid, key)
-attribute key "aid" = return the action id
-attribute key "uid" = return the unique id
-attribute key "name" = return the item name
-attribute key "pluralname" = return the item plural name (gold conin -> gold coins)
-attribute key "description" = return the item description
-attribute key "article" = return the item article
-attribute key "text" = return the item text
-attribute key "writer" = return the item writer
-attribute key "date" = return the item data where was writed
-attribute key "depotid" = return the item depot id
-attribute key "weight" = return the item weight
-attribute key "attack" = return the item attack
-attribute key "defense" = return the item defense
-attribute key "extraattack" = return the item extra attack
-attribute key "extradefense" = return the item extra defense
-attribute key "armor" = return the item armor
-attribute key "attackspeed" = return the item attackspeed
-attribute key "hitchance" = return the item hitchance
-attribute key "shootrange" = return the item shoot range
-attribute key "charges" = return the item charges

--------not confirmed

-attribute key "weapontype" = return the item weapontype
-attribute key "slottype" = return the item slot type
 
Lua:
-attribute key "aid" = return the action id
-attribute key "armor" = return the item armor
-attribute key "article" = return the item article
-attribute key "attack" = return the item attack
-attribute key "attackspeed" = return the item attackspeed
-attribute key "charges" = return the item charges
-attribute key "date" = return the item data when was written
-attribute key "decaying" = return if the item is decaying
-attribute key "defense" = return the item defense
-attribute key "depotid" = return the item depot id
-attribute key "description" = return the item description
-attribute key "duration" = return the duration of decaying 
-attribute key "extraattack" = return the item extra attack
-attribute key "extradefense" = return the item extra defense
-attribute key "fluidtype" = return the item fluid type
-attribute key "hitchance" = return the item hitchance
-attribute key "name" = return the item name
-attribute key "pluralname" = return the item plural name (gold conin -> gold coins)
-attribute key "scriptprotected" = not sure what this means exactly
-attribute key "shootrange" = return the item shoot range
-attribute key "text" = return the item text
-attribute key "uid" = return the unique id
-attribute key "weight" = return the item weight
-attribute key "writer" = return the item writer
ATTR_CONTAINER_ITEMS
ATTR_HOUSEDOORID
ATTR_SLEEPERGUID
ATTR_SLEEPSTART
ATTR_TELE_DEST

Not sure the XML names of the last ones... ill be looking for more.
 
Last edited:
Is this for Crying Damson or mystic spirit?
 
Sorry didn't specify, its for Crying Damson. Mystic Spirit would never have this many functions
 
So these are all the functions that Crying Damson has? :p
Sorry, I'm tired :<
 
Yes minus, the lua-made and the already lua integrated functions. The lua-made functions can be found on that website
 
Where you get these functions?

Lua:
doCreatureSetGuildEmblem(cid, emblem)
doCreatureSetPartyShield(cid, shield)
doGuildAddEnemy(cid, enemy, war, mode)
doGuildRemoveEnemy(cid, enemy)
dodirectory(dir)
 
Where you get these functions?

Lua:
doCreatureSetGuildEmblem(cid, emblem)
doCreatureSetPartyShield(cid, shield)
doGuildAddEnemy(cid, enemy, war, mode)
doGuildRemoveEnemy(cid, enemy)
dodirectory(dir)

From luascript.cpp? ...
 
doGuildAddEnemy(cid, enemy, war, mode)
doGuildRemoveEnemy(cid, enemy)

those two you have to compile server with guild war system, but those are all in the newest TFS...
 
From luascript.cpp? ...

I've looking functions about war system and i didn't found!!

The one thing that i've found about war system is that
protocolgame.cpp(0.3.6pl1)
Lua:
	if(!known)
		msg->AddByte(0x00); // war emblem
 
you have to compile it with the guildwar parameter because its still being developed.
 
Exist function that show duration of condition (I need this information for CONDITION_INFIGHT duration)?

PS: I add rep. to Darkhaos and Syntax for info about "getItemAttribute(uid, key)" :)
 
Last edited:
doCreatureSetGuildEmblem(cid, emblem)
That one add war icons to players?
If so what id is it on Green, Red and Blue war icon?
 
doAddAccountBanishment(...)

It has ... for what info is needed, I was just wondering how exactly this is suppose to look since I have it working but it does not show a reason the player was banned.
 
Hey syntax, what's this one do?

Code:
getStatementsCount(name/guid[, channelId])


Sincerely,
yours pablol
 
Back
Top