Ir para conteúdo

Wise

Membro
  • Registro em

  • Última visita

Tudo que Wise postou

  1. Ajustei a checagem e simplifiquei o script, tente agora.
  2. Se não me engano, a função doPlayerSetSpecialDescription é inexistente no TFS 1.0. Me corrijam se eu estiver errado. Enfim, por via das dúvidas..não custa nada tentar: lookvf.lua (data/creaturescripts/scripts): function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then if hasVip(thing.uid) then doPlayerSetSpecialDescription(thing.uid,'.\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is Vip.') else doPlayerSetSpecialDescription(thing.uid,'.\n'..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is Free.') end end return true end Tag - creaturescripts.xml (data/creaturescripts): <event type="look" name="VipOrFree" event="script" value="lookvf.lua"/> Registre o creature event em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "VipOrFree") Se realmente não der, eu posso te passar os códigos da função e daí você compila na source do seu servidor.
  3. playerinfo.lua (data/creaturescripts/scripts): function onLook(cid, thing, position, lookDistance) if thing.uid ~= cid and isPlayer(thing.uid) then string = 'You see '..getCreatureName(thing.uid)..'. '..(getPlayerSex(thing.uid) == 0 and 'She' or 'He')..' is a '..getPlayerVocationName(thing.uid)..'.\nInformação do jogador ('..getCreatureName(thing.uid)..')\nHealth: ['..getCreatureHealth(thing.uid)..'/'..getCreatureMaxHealth(thing.uid)..']\nMana: ['..getCreatureMana(thing.uid)..'/'..getCreatureMaxMana(thing.uid)..']' doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string) elseif thing.uid == cid then string = 'You see yourself. You are '..getPlayerVocationName(cid)..'.\nInformação sua ('..getCreatureName(cid)..')\nHealth: ['..getCreatureHealth(cid)..'/'..getCreatureMaxHealth(cid)..']\nMana: ['..getCreatureMana(cid)..'/'..getCreatureMaxMana(cid)..']' doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string) end return true end Tag - creaturescripts.xml (data/creaturescripts): <event type="look" name="PlayerInfo" event="script" value="playerinfo.lua"/> Registro do creature event em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "PlayerInfo")
  4. Quanto perfeccionismo..pega a query do membro como base e edite os valores como preferir.
  5. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Tá bom, mestre da arte do CTRL+C/CTRL+V. Enfim, não vou discutir com criança. @avalax Apropriei o script: local tab = { effect = {55, 1000}, -- {magicEffectNumber, delay em milissegundos} stor = 54321 -- storage } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 30) function effectOnEquip(cid) if not isCreature(cid) then return false end if getPlayerStorageValue(cid, tab.stor) < 1 then return false end doSendMagicEffect(getThingPos(cid), tab.effect[1]) return addEvent(effectOnEquip, tab.effect[2] * 1000, cid) end function onEquip(cid, item) if getPlayerStorageValue(cid, tab.stor) < 1 then setPlayerStorageValue(cid, tab.stor, 1) doChangeSpeed(cid, getCreatureSpeed(cid) + 30) doAddCondition(cid, condition) return addEvent(effectOnEquip, tab.effect[2] * 1000, cid) end return true end function onDeEquip(cid, item) setPlayerStorageValue(cid, tab.stor, -1) doChangeSpeed(cid, getCreatureSpeed(cid) - 30) doRemoveCondition(cid, CONDITION_ATTRIBUTES) return true end Só pra garantir que o player fique com a storage negativa ao morrer/fazer logout: itembuff.lua (data/creaturescripts/scripts): local item, stor = 1234, 54321 -- itemID, storage function onPrepareDeath(cid) if getPlayerStorageValue(cid, stor) > 0 then setPlayerStorageValue(cid, stor, -1) if isContainer(getPlayerSlotItem(cid, 3).uid) then doRemovePlayerItem(cid, item, 1) doAddContainerItem(getPlayerSlotItem(cid, 3).uid, item, 1) end end return true end function onLogout(cid) if getPlayerStorageValue(cid, stor) > 0 then setPlayerStorageValue(cid, stor, -1) if isContainer(getPlayerSlotItem(cid, 3).uid) then doRemovePlayerItem(cid, item, 1) doAddContainerItem(getPlayerSlotItem(cid, 3).uid, item, 1) end end return true end PS: a storage usado no creature script tem de ser a mesma do movement script. Tag - creaturescripts.xml (data/creaturescripts): <event type="preparedeath" name="ItemBuffPD" event="script" value="itembuff.lua"/> <event type="logout" name="ItemBuffLO" event="script" value="itembuff.lua"/> Adicione o registro do creature event (preparedeath) em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "ItemBuffPD")
  6. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Não que esteja ruim, não. Não foi por isso que eu citei, mas você copiar algo e nem sequer citar sobre o desenvolvedor é plágio. Tá certo, haja como quiser.
  7. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Além de ter copiado os códigos de um outro script meu e nem sequer ter editado os valores dos atributos da condição dada ao uid, ainda faz um creature script sem noção e com callback de login registrando creature event (?!). Pô, cara..
  8. Desatenção minha, estou um tanto quanto ocupado: local tab = { [1] = {outfit = 123}, -- [vocID] = {outfit = lookTypeNumber} [300] = {outfit = 456} } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 50) function onEquip(cid, item, slot) doSetCreatureOutfit(cid, {lookType = tab[getPlayerVocation(cid)].outfit}, -1) doChangeSpeed(cid, getCreatureSpeed(cid) + 50) doAddCondition(cid, condition) return true end function onDeEquip(cid, item, slot) doChangeSpeed(cid, getCreatureSpeed(cid) - 50) doRemoveCondition(cid, CONDITION_ATTRIBUTES) doRemoveCondition(cid, CONDITION_OUTFIT) return true end
  9. Ops, erro meu. Deixe apenas as duas tags dos scripts do arquivo itemoutfit.lua. Substitua o movement script por este: local tab = { [1] = {outfit = 123}, -- [vocID] = {outfit = lookTypeNumber} [300] = {outfit = 456} } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 50) function onEquip(cid, item, slot) doSetCreatureOutfit(cid, {lookType = tab[getPlayerVocation(cid)].outfit}, -1) doChangeSpeed(cid, getCreatureSpeed(cid) + 50) doAddCondition(cid, condition) return true end function onDeEquip(cid, item, slot) doChangeSpeed(cid, getCreatureSpeed(cid) - 50) doRemoveCondition(cid, CONDITION_ATTRIBUTES) doRemoveCondition(cid, CONDITION_OUTFIT) return true end O script da sua talkaction: local saga = { [641] = {[1] = 651, [2] = 652, [3] = 653, [4] = 654, [5] = 655, [6] = 656, [7] = 8, effect = 244}, [822] = {[1] = 464, [2] = 465, [3] = 466, [4] = 467, [5] = 468, [6] = 469, [7] = 470, [8] = 624, effect = 74}, [1] = {[1] = 66, [2] = 91, [3] = 18, [4] = 163, [5] = 683, [6] = 684, [7] = 692, [8] = 305, [9] = 49, [10] = 693, [11] = 604, [12] = 179, [13] = 605, [14] = 682, [15] = 25, [16] = 30, effect = 10}, [400] = {[1] = 476, [2] = 477, [3] = 478, [4] = 479, [5] = 481, [6] = 482, [7] = 483, [8] = 484, [9] = 486, [10] = 487, [11] = 681, [12] = 620, [13] = 621, effect = 10}, [805] = {[1] = 712, [2] = 713, [3] = 714, [4] = 715, [5] = 716, [6] = 717, [7] = 718, [8] = 719, [9] = 720, [10] = 721, [11] = 722, effect = 10}, [209] = {[1] = 452, [2] = 453, [3] = 454, [4] = 456, [5] = 457, [6] = 290, [7] = 649, [8] = 458, [9] = 555, effect = 202}, [300] = {[1] = 437, [2] = 438, [3] = 439, [4] = 440, [5] = 441, effect = 10}, [520] = {[1] = 490, [2] = 491, [3] = 493, [4] = 494, [5] = 495, effect = 10}, [25] = {[1] = 660, [2] = 661, [3] = 662, [4] = 663, [5] = 664, [6] = 330, [7] = 565, effect = 184} } local item = {2479, 4}-- {itemID, slotNumber} local level = 25 -- Limite para liberar uma saga nova function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o número da saga que você deseja.") return true end if getPlayerSlotItem(cid, item[2]).itemid == item[1] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga enquanto estiver com uma "..getItemNameById(item[1]).." equipada.") return true end if getPlayerStorageValue(cid, 89745) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode trocar de saga enquanto for da akatsuki.") return true end if not saga[getPlayerVocation(cid)] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.") return true end local t = string.explode(param, ",") if(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.") return true end if not (tonumber(t[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o número da saga que você deseja.") return true end if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga não existe.") return true end if getPlayerLevel(cid) >= (tonumber(t[1])*level) then doSetCreatureOutfit(cid, {lookType = saga[getPlayerVocation(cid)][tonumber(t[1])]}, -1) doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)].effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, você precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end
  10. É, está certo. Só o slot que deveria ser body (já que isso é um manto), não? <item id="2479" article="a" name="Hokage Tunic"> <attribute key="weight" value="4600" /> <attribute key="armor" value="6" /> <attribute key="speed" value="50" /> <attribute key="magiclevelpoints" value="50" /> <attribute key="showattributes" value="1" /> <attribute key="slotType" value="body" /> </item> Substitua o script do itemoutfit.lua, por este: local tab = { [1] = {outfit = 123}, -- [vocID] = {outfit = lookTypeNumber} [300] = {outfit = 456} } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 50) function onEquip(cid, item, slot) doSetCreatureOutfit(cid, {lookType = tab[getPlayerVocation(cid)].outfit}, -1) doChangeSpeed(cid, getCreatureSpeed(cid) + 50) doAddCondition(cid, condition) return true end function onDeEquip(cid, item, slot) doChangeSpeed(cid, getCreatureSpeed(cid) - 50) doRemoveCondition(cid, CONDITION_ATTRIBUTES) return true end Poste o script dessa talkaction.
  11. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Se ainda não der, avisa no tópico que eu faço um script pra você.
  12. Você adicionou os atributos ao item em items.xml? Se sim, poste aqui os códigos desse item e eu verifico se você configurou corretamente.
  13. Faltou encerrar o for e o callback. E creio que poderá bugar a mensagem já que está dentro do for. Talvez assim dê como você quer (retirei a mensagem pra evitar bugs), eu não testei: local level = { {level = {50, 99}, item = {5432, 1}, stor = 54321}, -- {level = {levelMin, levelMax}, item = {itemID, count}, stor = storage} {level = {100, 149}, item = {5432, 1}, stor = 54321}, {level = {150, 199}, item = {5432, 1}, stor = 54321}, {level = {200}, item = {5432, 100}, stor = 54321} -- {level = {lastLevel}, item = {itemID, count}, stor = storage} } function onAdvance(cid, skill, oldLevel, newLevel) for i = 1, #level do if skill == 8 and getPlayerStorageValue(cid, level[i].stor) < 1 and getPlayerStorageValue(cid, level[#level].stor) < 1 then if newLevel >= level[i].level[1] and newLevel <= level[i].level[2] then setPlayerStorageValue(cid, level[i].stor, 1) doPlayerAddItem(cid, level[i].item[1], level[i].item[2]) elseif newLevel >= level[#level].level[1] then setPlayerStorageValue(cid, level[#level].stor, 1) doPlayerAddItem(cid, level[#level].item[1], level[#level].item[2]) end end end return true end
  14. Depois de ter adicionado o script e tag aos locais corretos e ter configurado o actionID na tag, adicione esse mesmo actionID (número de identificação da action) ao baú (pelo remere's map editor). Use este script: local tab = { [1] = {spell = "hell granade"}, -- [vocId] = {spell = "Instant Name da Spell"} verifique a string usada na spell em seu spells.xml [2] = {spell = "hell granade"}, [3] = {spell = "hell granade"}, [4] = {spell = "hell granade"} } function onUse(cid, item, fromPos, item2, toPos) local v = tab[getPlayerVocation(cid)] if not v then doPlayerSendCancel(cid, "Your vocation can't do this quest.") end if getPlayerLearnedInstantSpell(cid, v.spell) then doPlayerSendCancel(cid, "You already have done this quest.") end doPlayerLearnInstantSpell(cid, v.spell) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned a new spell!!") return true end
  15. É, sei disso.
  16. Você quer dizer aprender uma spell, certo? Bom, não sei se as funções/tag desse script vão coincidir com as da versão do seu servidor..mas tente. spellquest.lua (data/actions/scripts): local spell = "hell granade" -- "Instant Name da Spell" verifique a string usada na spell em seu spells.xml function onUse(cid, item, fromPos, item2, toPos) if getPlayerLearnedInstantSpell(cid, spell) then doPlayerSendCancel(cid, "You already have done this quest.") end doPlayerLearnInstantSpell(cid, spell) doSendMagicEffect(toPos, CONST_ME_MAGIC_RED) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned a new spell!!") return true end Tag - actions.xml (data/actions): <action actionid="ACTIONID" script="spellquest.lua"/>
  17. O aumento de velocidade e magic level, você pode editar em items.xml, aplicando as seguintes linhas no código referente ao item: <attribute key="speed" value="50" /> <attribute key="magiclevelpoints" value="50" /> <attribute key="showattributes" value="1" /> Enquanto aos scripts do item: itemoutfit.lua (data/movements/scripts): local tab = { [1] = {outfit = 123}, -- [vocID] = {outfit = lookTypeNumber} [300] = {outfit = 456} } function onEquip(cid, item, slot) doSetCreatureOutfit(cid, {lookType = tab[getPlayerVocation(cid)].outfit}, -1) return true end function onDeEquip(cid, item, slot) doRemoveCondition(cid, CONDITION_OUTFIT) return true end Tag - movements.xml (data/movements): <movevent type="Equip" itemid="ITEMID" slot="VALUE" event="script" value="itemoutfit.lua"/> <movevent type="DeEquip" itemid="ITEMID" slot="VALUE" event="script" value="itemoutfit.lua"/> Configure a tag com o ID do item e o VALUE do slot, que varia de acordo com o item (onde ele pode ser equipado). Caso você não saiba como configurar, os valores que você pode utilizar são: Values: head necklace backpack armor right-hand, left-hand two-handed, hand/shield legs feet ring ammo itemlogout.lua (data/creaturescripts/scripts): local item = {1234, 5} -- {itemID, slotNumber} function onLogout(cid) if getPlayerSlotItem(cid, item[2]).itemid == item[1] then doPlayerSendCancel(cid, "You need to remove your "..getItemNameById(item[1]).." from the slot to logout.") return false end return true end Pra configurar o slotNumber da tabela item no script, basta adicionar o número do slot de acordo com o que seu item é equipado. Aqui estão eles: --slotVariableName(slotNumber) = slotValue: CONST_SLOT_HEAD (1) = head (helmet) CONST_SLOT_NECKLACE (2) = necklace (amulet) CONST_SLOT_BACKPACK (3) = backpack CONST_SLOT_ARMOR (4) = armor CONST_SLOT_LEFT (5) = left hand CONST_SLOT_RIGHT (6) = right hand CONST_SLOT_LEGS (7) = legs CONST_SLOT_FEET (8) = boots CONST_SLOT_RING (9) = ring CONST_SLOT_AMMO (10) = ammo Lembrando que o callback usado no script não registra creature event. Tag - creaturescripts.xml (data/creaturescripts): <event type="logout" name="ItemLogout" event="script" value="itemlogout.lua"/>
  18. Pode ser que com essa checagem do tile com protection zone, funcione no seu servidor.
  19. Já testei os scripts que fiz e está tudo certo. O problema não está neles, desculpe amigo.
  20. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Só pelo fato de ser a mesma coisa, já significa que utilizando-a vai simplificar. Keep it simple, stupid.
  21. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Crie um arquivo com extensão .lua (Lua) e adicione ele à pasta scripts em data/actions. Depois, adicione a tag em actions.xml (data/actions) com o nome referente ao que você nomeou o arquivo desse script. Ex: vipdoor.lua <action actionid="25052" event="script" value="vipdoor.lua"/> Daí basta adicionar pelo remere's map editor, o actionID (que você configurou na tag) na porta de passagem "vip".
  22. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    function onUse(cid, item, fromPos, item2, toPos) if not hasVip(cid) then doTeleportThing(cid, fromPos) doSendMagicEffect(fromPos, CONST_ME_POFF) doPlayerSendCancel(cid, "You need vip account to pass.") end doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) return true end
  23. Wise postou uma resposta no tópico em Suporte Tibia OTServer
    Se a "vip" do seu servidor for por premium days, use esse action script: vipdoor.lua (data/actions/scripts): function onUse(cid, item, fromPos, item2, toPos) if not isPremium(cid) then doTeleportThing(cid, fromPos) doSendMagicEffect(fromPos, CONST_ME_POFF) doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT) end doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) return true end Se for por storage temporária, use este: local stor = 12345 -- storage function onUse(cid, item, fromPos, item2, toPos) if getPlayerStorageValue(cid, stor) - os.time() < 1 then doTeleportThing(cid, fromPos) doSendMagicEffect(fromPos, CONST_ME_POFF) doPlayerSendCancel(cid, "You need a vip account to pass.") end doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) return true end Tag - actions.xml (data/actions): <action actionid="ACTIONID" event="script" value="vipdoor.lua"/>

Informação Importante

Confirmação de Termo