Postado Agosto 30, 2014 11 anos TFS:0.4 Gostaria de implementar um script em meu server que vai ser o seguinte: Ele verifica se o player tem certos itens equipados e dá uma mensagem ao player. 5 items = 100%. Exemplo: Player equipa um item VIP. Mensagem: Você está 20%% com itens VIP. Exemplo: Player equipa dois items VIP. Mensagem: Você está 40% com itens VIP. Exemplo: Player equipa cinco itens VIP. Mensagem: Você está 100% com itens VIP. Mensagem Broadcast: O player X contribuiu para o server. TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Agosto 30, 2014 11 anos Vamos lá, você terá que criar 1 script para cada parte Motivo: Eu sou burro... estou aprendendo scripting ainda... movements\scripts\ helmetvip.lua --> Set System By: Dknight --- CONFIGURAÇOES --- local config = { -- INICIO DAS CONFIGURAÇOES sto = 8000, -- NÃO MEXA slot1 = 1, -- ID DO SLOT item1 = 2160, -- ID EQUIPE eff1 = 10, -- EFEITO AO EQUIPAR O ITEM eff2 = 8 -- EFEITO AO DESEQUIPAR O ITEM } -- FIM DAS CONFIGURAÇOES ------ SCRIPT ---- if getPlayerSlotItem(cid, 1).itemid == xxxx and getPlayerSlotItem(cid, 4).itemid == xxxx and getPlayerSlotItem(cid, 7).itemid == xxxx and getPlayerSlotItem(cid, 8).itemid == xxxx then return doPlayerSendCancel(cid, "Voce esta 100% com itens VIP") end function onEquip(cid, item, slot) if getPlayerSlotItem(cid, config.slot1).itemid == config.item1 then setPlayerStorageValue(cid, sto, getPlayerStorageValue(cid, sto)+20) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce equipou um item VIP voce esta com ..getPlayerStorageValue(cid, sto)..% do seu Set VIP") end return true end function onDeEquip(cid, item, slot) setPlayerStorageValue(cid, sto, getPlayerStorageValue(cid, sto)-20) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce desequipou um item VIP voce esta com ..getPlayerStorageValue(cid, sto)..% do seu Set VIP") return true end movements.xml <movevent type="Equip" itemid="11234" slot="feet" event="script" value="helmetvip.lua"/> <movevent type="DeEquip" itemid="11234" slot="feet" event="script" value="helmetvip.lua"/> Observação !!! if getPlayerSlotItem(cid, 1).itemid == xxxx and getPlayerSlotItem(cid, 4).itemid == xxxx and getPlayerSlotItem(cid, 7).itemid == xxxx and getPlayerSlotItem(cid, 8).itemid == xxxx then return doPlayerSendCancel(cid, "Voce esta 100% com itens VIP") end Aonde está xxxx mude para o id do item, slot 1 = helmet, slot 4 = armor, slot 7 =legs slot 8 = boots --------------------------------------------------- Creditos: WhiteWolf, por me ensinar a usar getPlayerSlotItem e .itemid === (não sabia usar) Eu, pelo resto. Editado Agosto 30, 2014 11 anos por DKnight (veja o histórico de edições)
Postado Agosto 30, 2014 11 anos Autor Vamos lá, você terá que criar 1 script para cada parte Motivo: Eu sou burro... estou aprendendo scripting ainda... movements\scripts\ helmetvip.lua --> Set System By: Dknight --- CONFIGURAÇOES --- local config = { -- INICIO DAS CONFIGURAÇOES sto = 8000, -- NÃO MEXA slot1 = 1, -- ID DO SLOT item1 = 2160, -- ID EQUIPE eff1 = 10, -- EFEITO AO EQUIPAR O ITEM eff2 = 8 -- EFEITO AO DESEQUIPAR O ITEM } -- FIM DAS CONFIGURAÇOES ------ SCRIPT ---- if getPlayerSlotItem(cid, 1).itemid == xxxx and getPlayerSlotItem(cid, 4).itemid == xxxx and getPlayerSlotItem(cid, 7).itemid == xxxx and getPlayerSlotItem(cid, 8).itemid == xxxx then return doPlayerSendCancel(cid, "Voce esta 100% com itens VIP") end function onEquip(cid, item, slot) if getPlayerSlotItem(cid, config.slot1).itemid == config.item1 then setPlayerStorageValue(cid, sto, getPlayerStorageValue(cid, sto)+20) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce equipou um item VIP voce esta com ..getPlayerStorageValue(cid, sto)..% do seu Set VIP") end return true end function onDeEquip(cid, item, slot) setPlayerStorageValue(cid, sto, getPlayerStorageValue(cid, sto)-20) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce desequipou um item VIP voce esta com ..getPlayerStorageValue(cid, sto)..% do seu Set VIP") return true end movements.xml <movevent type="Equip" itemid="11234" slot="feet" event="script" value="helmetvip.lua"/> <movevent type="DeEquip" itemid="11234" slot="feet" event="script" value="helmetvip.lua"/> Observação !!! if getPlayerSlotItem(cid, 1).itemid == xxxx and getPlayerSlotItem(cid, 4).itemid == xxxx and getPlayerSlotItem(cid, 7).itemid == xxxx and getPlayerSlotItem(cid, 8).itemid == xxxx then return doPlayerSendCancel(cid, "Voce esta 100% com itens VIP") end Aonde está xxxx mude para o id do item, slot 1 = helmet, slot 4 = armor, slot 7 =legs slot 8 = boots --------------------------------------------------- Creditos: WhiteWolf, por me ensinar a usar getPlayerSlotItem e .itemid === (não sabia usar) Eu, pelo resto. Cara por aquilo que estou vendo, o script vai ter o mesmo problema que o script de set do whiteWolf, mais eu vou testar. Mesmo que o script não esteja bom, aqui tem seu rep por tentar ajudar. Continue o bom trabalho. TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Agosto 30, 2014 11 anos Autor Poderia me informar qual erro do sistema do WhiteWolf ? O script do whitewolf está neste outro topico meu, ele crasha o distro.:http://www.tibiaking.com/forum/topic/41372-urgente-bug-quando-retira-itens/ TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
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.