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

[TFS 1.3][Tools]Lua Functions

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
418
Best answers
3
Reaction score
51
Location
Caracas, Venezuela
Looking for the functions in the forum, I find out that there is no post, so I make life easier for you.
I will try to publish all the functions here.

Players.
Code:
    // 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: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:getBaseMaxHealth()
    // player:getBaseMaxMana()
    // player:getSkillLevel(skillType)
    // player:getEffectiveSkillLevel(skillType)
    // player:getSkillPercent(skillType)
    // player:getSkillTries(skillType)
    // player:addSkillTries(skillType, tries)
    // player:getItemCount(itemId[, subType = -1])
    // player:getItemById(itemId, deepSearch[, subType = -1])
    // player:getVocation()
    // player:setVocation(id or name or userdata)
    // player:getSex()
    // player:getTown()
    // player:setSex(newSex)
    // 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:addMoney(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:hasOutfit(lookType[, addon = 0])
    // player:getPremiumDays()
    // player:addPremiumDays(days)
    // player:removePremiumDays(days)
    // 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()
Monsters and Monstertype
Code:
// monster:isMonster()
// monster:getType()
    // 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])
 
 
    // MonsterType
    // get: monsterType:isAttackable() set: monsterType:isAttackable(bool)
    // get: monsterType:isConvinceable() set: monsterType:isConvinceable(bool)
    // get: monsterType:isSummonable() set: monsterType:isSummonable(bool)
    // get: monsterType:isIllusionable() set: monsterType:isIllusionable(bool)
    // get: monsterType:isHostile() set: monsterType:isHostile
    // get: monsterType:isPushable() set: monsterType:isPushable(bool)
    // get: monsterType:isHealthHidden() set: monsterType:isHealthHidden(bool)
    // get: monsterType:canPushItems() set: monsterType:canPushItems(bool)
    // get: monsterType:canPushCreatures() set: monsterType:canPushCreatures(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: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
    // 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)



Npc, guild, vocation, ItemType, house, group, combat, condition
Code:
// npc:isNpc()
    // npc:setMasterPos(pos[, radius])
    
    // 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(id)
    // group:getId()
    // group:getName()
    // group:getFlags()
    // group:getAccess()
    // group:getMaxDepotItems()
    // group:getMaxVipEntries()
    // group:hasFlag(flag)
    
    // 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()
    
    // Town(id or name)
    // town:getId()
    // town:getName()
    // town:getTemplePosition()
    
    
    // House(id)
    // house:getId()
    // house:getName()
    // house:getTown()
    // house:getExitPosition()
    // house:getRent()
    // 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)
    
    // 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:isGroundTile()
    // itemType:isUseable()
    // itemType:isPickupable()
    // itemType:getType()
    // 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:getHitChance()
    // itemType:getShootRange()
    // itemType:getAttack()
    // itemType:getDefense()
    // itemType:getExtraDefense()
    // itemType:getArmor()
    // itemType:getWeaponType()
    // itemType:getAmmoType()
    // itemType:getCorpseType()
    // itemType:getElementType()
    // itemType:getElementDamage()
    // itemType:getTransformEquipId()
    // itemType:getTransformDeEquipId()
    // itemType:getDestroyId()
    // itemType:getDecayId()
    // itemType:getRequiredLevel()
    // itemType:hasSubType()
    
    // Combat()
    // combat:setParameter(key, value
    // 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(conditionType[, conditionId = CONDITIONID_
    // condition:delete()
    // condition:getId()
    // condition:getSubId()
    // condition:getType()
    // condition:getIcons()
    // condition:getEndTime()
    // condition:clone()
    // condition:getTicks()
    // condition:setTicks(ticks)
    // condition:setParameter(key, value)
    // condition:setFormula(mina, minb, maxa, maxb)
    // condition:setOutfit(outfit)
    // condition:setOutfit(lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet[, lookAddons])
    // condition:addDamage(rounds, time, value)
Code:
 
Last edited:

rlx

Active Member
Joined
Feb 25, 2019
Messages
84
Best answers
1
Reaction score
29
If it isn't enough, there are threads with lua functions for TFS 1.x/1.2:
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,747
Best answers
221
Reaction score
1,446
Location
Norway, Oslo
There is also the Script Interface wiki pages.

And revscriptsys:
 
OP
Eduardo170

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
418
Best answers
3
Reaction score
51
Location
Caracas, Venezuela
If it isn't enough, there are threads with lua functions for TFS 1.x/1.2:
There is also the Script Interface wiki pages.

And revscriptsys:
luascript.cpp
 
Top