Muito interesante meu amigo so eu sei como você demorou a fazer ![]()
- Fórum
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- Teleport Stone V1
6
1.8k
info
Grupo: Infante
Registrado: 06/03/13
Posts: 1.6k
Reputação: +319
Gênero: Masculino
Char no Tibia: Lord Sorte

07 de outubro de 2013 às 15:15
08 de outubro de 2013 às 11:49
Legal ![]()
08 de outubro de 2013 às 11:52
Muito interessante. Rep+
info
Grupo: Campones
Registrado: 22/03/08
Posts: 46
Reputação: +9
Char no Tibia: Nagumo Utsunomiya

08 de outubro de 2013 às 12:10
Muito bom cara, otimo sistema e sem bugs curti demais Rep+ pra ti, abraço.
2 meses depois...
info
Grupo: Campones
Registrado: 07/12/13
Posts: 8
Reputação: 0

08 de dezembro de 2013 às 17:09
Pergunta: Onde fica o local q tem a Itemtype ou id da stone que eu possa colocar ou trokar, serve em poketibia?




info
Grupo: Campones
Registrado: 24/05/10
Posts: 31
Reputação: +11
Char no Tibia: Omega Snap
O que ela faz?
ao clicar na pedra é salvo a sua posição atual assim quando for usada novamente o jogador será teleportado para a posição salva. ao falar com um npc pode-se resetar a pedra ou então salvar a posição para a cidade atual do npc.
Action
config = { shows_messages = true, level_necessary = 10, exhaustion_time = 50, -- in seconds exaustion_storage = 1234, time_casting = 10, magical_effect = 10, } function checkfight(cid , interval , pos , towname) setPlayerStorageValue(cid, 12345, 1) if config.shows_messages then doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: Teleporting in " ..config.time_casting-interval.. " seconds") end doSendMagicEffect(getCreaturePosition(cid) , config.magical_effect) if getCreatureCondition(cid, CONDITION_INFIGHT) == false then doCreatureSetNoMove(cid, true) if config.time_casting-interval == 0 then doTeleportThing(cid, pos) doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 12345, 0) if config.shows_messages then doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: Finally in "..towname) end end exhaustion.set(cid, config.exaustion_storage, config.exhaustion_time) end if getCreatureCondition(cid, CONDITION_INFIGHT) and interval == config.time_casting then if config.shows_messages then doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: I'm in battle") end doCreatureSetNoMove(cid, false) setPlayerStorageValue(cid, 12345, 0) exhaustion.set(cid, config.exaustion_storage, 0) end end function onUse(cid, item, frompos, item2, topos) if not getItemAttribute(item.uid, "description") then setPlayerStorageValue(cid, 301420, getThingPos(cid).x) setPlayerStorageValue(cid, 301421, getThingPos(cid).y) setPlayerStorageValue(cid, 301422, getThingPos(cid).z) doItemSetAttribute(item.uid, "description", 'Recorded in Custom.') doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: Recorded in Custom") return false end local townname = getItemAttribute(item.uid, "description"):match("Recorded in (.*).") local pos = getTownTemplePosition(getTownId(townname)) if townname == "Custom" then pos = {x= getPlayerStorageValue(cid, 301420), y= getPlayerStorageValue(cid, 301421), z= getPlayerStorageValue(cid, 301422)} end if config.level_necessary <= getPlayerLevel(cid) then if not exhaustion.check(cid, config.exaustion_storage) then for i = 1, config.time_casting do addEvent(checkfight ,1000*i ,cid , i , pos , townname) end else if config.shows_messages then doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: I can only use again in "..exhaustion.get(cid, 1234).." seconds") end end else if config.shows_messages then doPlayerSendTextMessage(cid, 1, getCreatureName(cid).." ["..getPlayerLevel(cid).."]: I can only use it when you are level "..config.level_necessary) end end endNpc
Xml
<?xml version="1.0" encoding="UTF-8"?> <npc name="Jack Stone" script="data/npc/scripts/Town 1.lua" walkinterval="5000" floorchange="0"> <health now="100" max="100"/> <look type="130" head="0" body="114" legs="107" feet="76" addons="3"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|! can record your teleport stone for this city {record} or else there-reset{reset}." /> <parameter key="module_keywords" value="1" /> </parameters> </npc>Lua
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local town = 1 local nametown = getTownName(town) local stoneid = 8300 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(string.lower(msg), 'Record') or msgcontains(string.lower(msg), 'record') then if doPlayerRemoveItem(cid, stoneid, 1) then selfSay("now his teleport stone is engraved in "..nametown..".", cid) local teleport_stone = doPlayerAddItem(cid, stoneid, 1) doItemSetAttribute(teleport_stone, "description", 'Recorded in '..nametown..'.') --doSetItemSpecialDescription(teleport_stone, 'Recorded in '..nametown..'.') else selfSay("you do not have a teleport stone so I can not write to it.", cid) end return true end if msgcontains(string.lower(msg), 'Reset') or msgcontains(string.lower(msg), 'reset') then if doPlayerRemoveItem(cid, stoneid, 1) then doPlayerAddItem(cid, stoneid, 1) selfSay("the stone was reset.", cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())se tiver algum bug ou se tiver alguma ideia, sugestão não deixa de comentar
Editado Outubro 7 por R1B31R0