Jump to content
Close
Sign in to follow this  
underewarr

Função Function Tfs1.0

Recommended Posts

Algumas funções para tfs 1.0 que eu usei , espero que ajude.

Caso alguma dessas funçoes gere erros, podemos discutir aqui mesmo como solucionalos, obrigado.

Spoiler

--Source functions
getPlayerFood(cid)
getCreatureHealth(cid)
getCreatureMaxHealth(cid)
getPlayerMana(cid)
getPlayerMaxMana(cid)
getPlayerLevel(cid)
getPlayerMagLevel(cid)
getPlayerName(cid)
getPlayerAccess(cid)
getPlayerPosition(cid)
getPlayerSkill(cid, skillid)
getPlayerMasterPos(cid)
getPlayerTown(cid)
getPlayerVocation(cid)
getPlayerItemCount(cid, itemid[, subtype])
getPlayerSoul(cid)
getPlayerFreeCap(cid)
getPlayerLight(cid)
getPlayerSlotItem(cid, slot)
getPlayerItemById(cid, deepSearch, itemId, <optional> subType)
getPlayerDepotItems(cid, depotid)
getPlayerGuildId(cid)
getPlayerGuildLevel(cid)
getPlayerGuildName(cid)
getPlayerGuildRank(cid)
getPlayerGuildNick(cid)
getPlayerSex(cid)
getPlayerLookDir(cid)
doCreatureSetLookDir(cid, direction)
doSetCreatureDirection(cid, direction)
getPlayerGUID(cid)
getPlayerFlagValue(cid, flag)
getPlayerLossPercent(cid)
getPlayerSkullType(cid)
getPlayerGroupId(cid)
setPlayerGroupId(cid, newGroupId)
getPlayerIp(cid)
playerLearnInstantSpell(cid, name)
canPlayerLearnInstantSpell(cid, name)
getPlayerLearnedInstantSpell(cid, name)
getPlayerInstantSpellCount(cid)
getPlayerInstantSpellInfo(cid, index)
getInstantSpellInfoByName(cid, name)
getInstantSpellWords(name)
getPlayerStorageValue(uid, valueid)
setPlayerStorageValue(uid, valueid, newvalue)
getGlobalStorageValue(valueid)
setGlobalStorageValue(valueid, newvalue)
getOnlinePlayers()
getTilePzInfo(pos) --1 is pz. 0 no pz.
getTileInfo(pos)
getTileHouseInfo(pos) --0 no house. != 0 house id
getItemRWInfo(uid)
getThingfromPos(pos)
getThing(uid)
queryTileAddThing(uid, pos, <optional> flags)
getThingPos(uid)
getTileItemById(pos, itemId, <optional> subType)
getTileItemByType(pos, type)
getTileThingByPos(pos)
getTileThingByTopOrder(pos, topOrder)
getTopCreature(pos)
doRemoveItem(uid, <optional> n)
doPlayerFeed(cid, food)
doPlayerSendCancel(cid, text)
doPlayerSendDefaultCancel(cid, ReturnValue)
doTeleportThing(cid, newpos, <optional> pushmove)
doTransformItem(uid, toitemid, <optional> count/subtype)
doPlayerChangeName(cid, newName)
doCreatureSay(uid, text, type[, ghost = false[, cid = 0[, pos]]])
doSendMagicEffect(pos, type[, player])
doSendDistanceShoot(frompos, topos, type)
doChangeTypeItem(uid, newtype)
doSetItemActionId(uid, actionid)
doSetItemText(uid, text)
doSetItemSpecialDescription(uid, desc)
doSendAnimatedText(pos, text, color)
doPlayerAddSkillTry(cid, skillid, n)
doCreatureAddHealth(cid, health)
doPlayerAddMana(cid, mana[, animationOnLoss])
doPlayerAddManaSpent(cid, mana)
doPlayerAddSoul(cid, soul)
doPlayerAddItem(cid, itemid, <optional: default: 1> count/subtype, <optional: default: 1> canDropOnMap, <optional: default: 1>subtype)
doPlayerAddItemEx(cid, uid, <optional: default: 0> canDropOnMap)
doPlayerSendTextMessage(cid, MessageClasses, message[, position, value, color])
doPlayerRemoveMoney(cid, money)
doPlayerAddMoney(cid, money)
doShowTextDialog(cid, itemid, text)
doSendTutorial(cid, tutorialid)
doAddMapMark(cid, pos, type, <optional> description)
doDecayItem(uid)
doCreateItem(itemid, type/count, pos)
Returns uid of the created item, only works on tiles.
doCreateItemEx(itemid, <optional> count/subtype)
doTileAddItemEx(pos, uid)
doAddContainerItemEx(uid, virtuid)
doRelocate(pos, posTo)
Moves all moveable objects from pos to posTo
doCreateTeleport(itemid, topos, createpos)
doCreateNpc(name, pos)
doSummonCreature(name, pos)
doConvinceCreature(cid, target)
getMonsterTargetList(cid)
getMonsterFriendList(cid)
doSetMonsterTarget(cid, target)
doMonsterChangeTarget(cid)
doAddCondition(cid, condition)
doRemoveCondition(cid, type[, subId])
doRemoveCreature(cid)
doMoveCreature(cid, direction)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
doPlayerRemoveItem(cid, itemid, count, <optional> subtype, <optional> ignoreEquipped)
doPlayerAddExp(cid, exp, <optional> usemultiplier, <optional> sendtext)
doPlayerSetGuildLevel(cid, level)
doPlayerSetGuildNick(cid, nick)
doPlayerAddOutfit(cid,looktype,addons)
doPlayerRemOutfit(cid,looktype,addons)
canPlayerWearOutfit(cid, looktype, addons)
doPlayerAddMount(cid, mountid)
doPlayerRemoveMount(cid, mountid)
getPlayerMount(cid, mountid)
doSetCreatureLight(cid, lightLevel, lightColor, time)
doSetCreatureDropLoot(cid, doDrop)
getPlayerParty(cid)
doPlayerJoinParty(cid, leaderId)
getPartyMembers(leaderId)
getCreatureMaster(cid)
getCreatureSummons(cid)
getSpectators(centerPos, rangex, rangey, multifloor, onlyPlayers)
getCreatureCondition(cid, condition[, subId])
isPlayer(cid)
isValidUID(uid)
isItem(uid)
isPlayerGhost(cid)
isPlayerPzLocked(cid)
isCreature(cid)
isMonster(cid)
isNpc(cid)
isContainer(uid)
isDepot(uid)
isCorpse(uid)
isMovable(uid)
isMoveable(uid)
getPlayerByName(name)
getPlayerGUIDByName(name)
registerCreatureEvent(uid, eventName)
getContainerSize(uid)
getContainerCap(uid)
getContainerCapById(itemid)
getContainerItem(uid, slot)
doAddContainerItem(uid, itemid, <optional> count/subtype)
getDepotId(uid)
getHouseOwner(houseid)
getHouseName(houseid)
getHouseEntry(houseid)
getHouseRent(houseid)
getHouseTown(houseid)
getHouseAccessList(houseid, listid)
getHouseByPlayerGUID(playerGUID)
getHouseTilesSize(houseid)
setHouseAccessList(houseid, listid, listtext)
setHouseOwner(houseid, ownerGUID)
getWorldType()
getWorldTime()
getWorldLight()
getWorldCreatures(type) --0 players, 1 monsters, 2 npcs, 3 all
getWorldUpTime()
broadcastMessage(message, type)
getGuildId(guild_name)
getPlayerSex(cid)
doPlayerSetSex(cid, newSex)
createCombatArea( {area}, <optional> {extArea} )
createConditionObject(type)
setCombatArea(combat, area)
setCombatCondition(combat, condition)
setCombatParam(combat, key, value)
setConditionParam(condition, key, value)
addDamageCondition(condition, rounds, time, value)
addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet)
setCombatCallBack(combat, key, function_name)
setCombatFormula(combat, type, mina, minb, maxa, maxb)
setConditionFormula(combat, mina, minb, maxa, maxb)
doCombat(cid, combat, param)
createCombatObject()
doAreaCombatHealth(cid, type, pos, area, min, max, effect)
doTargetCombatHealth(cid, target, type, min, max, effect)
doAreaCombatMana(cid, pos, area, min, max, effect)
doTargetCombatMana(cid, target, min, max, effect)
doAreaCombatCondition(cid, pos, area, condition, effect)
doTargetCombatCondition(cid, target, condition, effect)
doAreaCombatDispel(cid, pos, area, type, effect)
doTargetCombatDispel(cid, target, type, effect)
doChallengeCreature(cid, target)
numberToVariant(number)
stringToVariant(string)
positionToVariant(pos)
targetPositionToVariant(pos)
variantToNumber(var)
variantToString(var)
variantToPosition(var)
doChangeSpeed(cid, delta)
doCreatureChangeOutfit(cid, outfit)
doSetMonsterOutfit(cid, name, time)
doSetItemOutfit(cid, item, time)
doSetCreatureOutfit(cid, outfit, time)
getCreatureOutfit(cid)
getCreaturePos(cid)
getCreaturePosition(cid)
getCreatureName(cid)
getCreatureSpeed(cid)
getCreatureBaseSpeed(cid)
getCreatureTarget(cid)
isItemStackable(itemid)
isItemRune(itemid)
isItemDoor(itemid)
isItemContainer(itemid)
isItemFluidContainer(itemid)
isItemMovable(itemid)
getItemDescriptions(itemid)
getItemName(itemid)
getItemWeight(itemid, count, <optional: default: 1> precise)
getItemWeightByUID(uid)
hasProperty(uid, prop)
getItemIdByName(name)
getTownId(townName)
getTownName(townId)
getTownTemplePosition(townId)
isSightClear(fromPos, toPos, floorCheck)
getFluidSourceType(type)
isInArray(array, value)
addEvent(callback, delay, ...)
stopEvent(eventid)
doPlayerPopupFYI(cid, message)
mayNotMove(cid, value)
doPlayerAddPremiumDays(cid, days)
doPlayerRemovePremiumDays(cid, days)
getPlayerPremiumDays(cid)
getPromotedVocation(vocation)
getPlayerBlessing(cid, blessing)
doPlayerAddBlessing(cid, blessing)
getPlayerAccountBalance(cid)
getPlayerBalance(cid)
getPlayerAccountType(cid)
doPlayerSetBalance(cid, balance)
getPlayerMoney(cid)
getPlayerLastLoginSaved(cid)
saveServer()
saveData()
refreshMap()
cleanMap()
getPlayersByAccountNumber(accountNumber)
getAccountNumberByPlayerName(name)
getIPByPlayerName(name)
getIpByName(name)
getPlayersByIPAddress(ip[, mask = 0xFFFFFFFF])
debugPrint(text)
isInWar(cid, target)
doPlayerSetOfflineTrainingSkill(cid, skill)
getWaypointPosition(name)
doWaypointAddTemporial(name, pos)
sendChannelMessage(channelId, type, message)
sendGuildChannelMessage(guildId, type, message)
 
 
--Lua-made functions
doPlayerGiveItem(cid, itemid, count, charges)
doCreatureSayWithRadius(cid, text, type, radiusx, radiusy, position)
doPlayerTakeItem(cid, itemid, count)
doPlayerBuyItem(cid, itemid, count, cost, charges)
doPlayerSellItem(cid, itemid, count, cost)
getBlessingsCost(level)
getPvpBlessingCost(level)
isInRange(pos, fromPos, toPos)
isPremium(cid)
getMonthDayEnding(day)
getMonthString(m)
getArticle(str)
isNumber(str)
getDistanceBetween(firstPosition, secondPosition)
isSorcerer(cid)
isDruid(cid)
isPaladin(cid)
isKnight(cid)
getConfigInfo(info)
doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges)
getDirectionTo(pos1, pos2)
getPlayerLookPos(cid)
getPosByDir(fromPosition, direction, size)
getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
addContainerWithItems(cid, container, item, item_count, count)
tableToPos(t)
getCount(string)
playerExists(name)
transferGold(player, amount)
doCopyItem(item, attributes)
getTibianTime()
hasAddon(cid, looktype, addon)
addAddon(cid, looktype, addon)
table.find = function(table, value)
isMonsterInRange(monsterName, fromPos, toPos)

 

Lista criada em janeiro de 2015

 

@vou atualizar aqui quando estiver pronto algumas coisas como gamefunction,tile,modal etc só não faço agora porque estou sem o famoso tempo.

 

Agora podemos usar METATABLES como chamada de função

 

Legenda para entender a chamada.

Spoiler

 


Metatable.function (parameter, second parameter [, optional parameters = default value if not specified])

Como usar:


Position (toPos): sendMagicEffect (CONST_ME_POFF) 
Position (getThingPos (cid)): sendDistanceEffect (getT hingPos (itemEx.uid), CONST_ANI_SUDDENDEATH)

tambem podendo usar assim:


local position = Position (toPos) 
position: sendMagicEffect (CONST_ME_POFF)

 

 

 

 

Outras Metatables
 

Game Function:

Spoiler

aGame.getSpectators (position [, multifloor = false [, onlyPlayer = false [, minRangeX = 0 [, maxRangeX = 0 [, minRangeY = 0 [, maxRangeY = 0]]]]]]) 
Game.getPlayers () 
Game.loadMap (path) ler o mapa principal do diretório do config 
Game.getExperienceStage (level) - Retorna as Variaveis da exp por estages indicadas no xml
Game.getMonsterCount () 
Game.getPlayerCount () 
Game.getNpcCount () 
Game .getGameState () 
Game.setGameState (state) 
Game.setWorldType () 
Game.setWorldType (type) - Indica qual tipo de mundo World_type(_eg pvp) 
Game.getReturnMessage (value) 
Game.createItem (itemId, count [, position])
Game.createMonster (monsterName, position [, extended = false [, force = false]]) 
Game.createNpc (npcName, position [, extended = false [, force = false]]) 
Game.startRaid (raidName)

Position Function:

Spoiler

position: getTile () 
position: getDistance (positionEx) - Retornar o valor de tile do atributo pai
position: isSightClear (positionEx [, sameFloor = true]) - Indica se o pode ou nao colocar um item nesse local, ou pegar ele etc.
position: sendMagicEffect (effect) - same as to SendMagicEffect (pos, effect) 
position: sendDistanceEffect (positionEx, effect) - Indica Arrow Effetc na posição indicada

 


Edited by underewarr
Novo Conteudo (see edit history)



Share this post


Link to post
Share on other sites

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 



Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord: Werner#2974




Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia começando do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer fazer um plano publicitário para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução!

×
×
  • Create New...