Postado Agosto 12, 2017 7 anos Alguém ajuda com a conversão dessa talk abaixo para action? Quando eu usar x equipamento no slot de ring, vai fazer essa função da talk
Postado Agosto 12, 2017 7 anos Tenta ai no items.xml eu vou usar como exemplo o signet ring: items.xml Spoiler <item id="7697" article="a" name="rainbow outfit ring"> <attribute key="weight" value="500" /> <attribute key="description" value="Este anel lhe da 2x mais experiencia (ativo)." /> <attribute key="slotType" value="ring" /> <attribute key="duration" value="4320" /> <attribute key="decayTo" value="0" /> <attribute key="showduration" value="1" /> <attribute key="transformDeEquipTo" value="7708" /> </item> <item id="7708" article="a" name="ring rainbow outfit"> <attribute key="weight" value="500" /> <attribute key="slotType" value="ring" /> <attribute key="stopduration" value="1" /> <attribute key="showduration" value="1" /> <attribute key="transformEquipTo" value="7697" /> </item> movements.xml Spoiler <movevent type="Equip" itemid="7697" slot="ring" event="script" value="ro_ring.lua"/> <movevent type="DeEquip" itemid="7697" slot="ring" event="script" value="ro_ring.lua"/> <movevent type="Equip" itemid="7708" slot="ring" event="script" value="ro_ring.lua"/> <movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="ro_ring.lua"/> movements/scripts/ro_ring.lua Spoiler local colors = {94, 81, 79, 88, 18, 11, 92, 128} local storage = 65535 local time = 10 --in miliseconds function onEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) < 1 then local event = addEvent(changeOutfit, time, cid) setPlayerStorageValue(cid, storage, 1) return true end return true end function onDeEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) return true end return true end function changeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(repeatChangeOutfit, time, cid) return true else stopEvent(event) return true end end function repeatChangeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(changeOutfit, time, cid) return trye else stopEvent(event) return true end end GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Agosto 12, 2017 7 anos Autor 2 horas atrás, Sekk disse: Aparentemente so da bug quando relogo, Editado Agosto 12, 2017 7 anos por JcA (veja o histórico de edições)
Postado Agosto 14, 2017 7 anos Solução @JcA Spoiler local colors = {94, 81, 79, 88, 18, 11, 92, 128} local storage = 65000 local time = 10 --in miliseconds function onEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) < 1 then local event = addEvent(changeOutfit, time, cid) setPlayerStorageValue(cid, storage, 1) return true end return true end function onDeEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) return true end return true end function changeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(repeatChangeOutfit, time, cid) return true else stopEvent(event) return true end end function repeatChangeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(changeOutfit, time, cid) return trye else stopEvent(event) return true end end GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Agosto 16, 2017 7 anos Autor Em 14/08/2017 em 04:21, Sekk disse: @JcA Ocultar conteúdo local colors = {94, 81, 79, 88, 18, 11, 92, 128} local storage = 65000 local time = 10 --in miliseconds function onEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) < 1 then local event = addEvent(changeOutfit, time, cid) setPlayerStorageValue(cid, storage, 1) return true end return true end function onDeEquip(cid, item, slot) if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) return true end return true end function changeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(repeatChangeOutfit, time, cid) return true else stopEvent(event) return true end end function repeatChangeOutfit(cid) local randomHead = colors[math.random(#colors)] local randomLegs = colors[math.random(#colors)] local randomBody = colors[math.random(#colors)] local randomFeet = colors[math.random(#colors)] local tmp = {} if getPlayerStorageValue(cid, storage) > 0 then local outfit = getCreatureOutfit(cid) tmp = outfit tmp.lookType = outfit.lookType tmp.lookHead = randomHead tmp.lookLegs = randomLegs tmp.lookBody = randomBody tmp.lookFeet = randomFeet tmp.lookAddons = outfit.lookAddons doCreatureChangeOutfit(cid, tmp) local event = addEvent(changeOutfit, time, cid) return trye else stopEvent(event) return true end end Não precisa por um creaturescript que limpa a storage quando desloga? (posso estar falando besteira, não entendo, mas deu o erro a seguir anexado)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.