Postado Dezembro 24, 2014 10 anos Solução Descarte os unique IDs. Vamos usar então, action IDs. Nesse caso, determinei como sendo os action IDs dos baús:54001 = Sorcerer / Druid / Master Sorcerer / Elder Druid.54002 = Paladin / Royal Paladin.54003 = Knight / Elite Knight - Sword54004 = Knight / Elite Knight - Club54005 = Knight / Elite Knight - Axe Altere como preferir.Eu não testeichests.lua (data/actions/scripts): local t = { -- [actionID] = {vocs = {vocationIDs}, items = {itemIDs}} [54001] = {vocs = {1, 2, 5, 6}, items = {7424}}, -- mages [54002] = {vocs = {3, 7}, items = {8858, 2352}}, -- paladins [54003] = {vocs = {4, 8}, items = {7417}}, -- knights/sword [54004] = {vocs = {4, 8}, items = {7450}}, -- knights/club [54005] = {vocs = {4, 8}, items = {8926}} -- knights/axe } function onUse(cid, item, fromPos, toPos) local storage = 54321 local u = t[item.actionid] if not u then return false end if isInArray(u.vocs, getPlayerVocation(cid)) then if getPlayerStorageValue(cid, storage) < 1 then setPlayerStorageValue(cid, storage, 1) for i = 1, #u.items do doPlayerAddItem(cid, u.items[i], 1) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You got your reward for completing the quest.') else doPlayerSendCancel(cid, 'You already have done this quest.') end else doPlayerSendCancel(cid, 'Your vocation is not allowed to do this quest.') end return true end Tag - actions.xml (data/actions): <action actionid="54001-54005" event="script" value="chests.lua"/> Editado Dezembro 31, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 27, 2014 10 anos Autor No caso, Os Knights pegaram as 3 tipo de armas (Sword,axe e club) no mesmo bau ?
Postado Dezembro 27, 2014 10 anos Em 27/12/2014 em 12:34, Unico BR disse: No caso, Os Knights pegaram as 3 tipo de armas (Sword,axe e club) no mesmo bau ? Sim. Não notei que você queria assim, desculpe. Editei o post anterior. Basta alterar a tabela: local t = { -- [actionID] = {vocs = {vocationIDs}, items = {itemIDs}} [54001] = {vocs = {1, 2, 5, 6}, items = {7424}}, -- mages [54002] = {vocs = {3, 7}, items = {8858, 2352}}, -- paladins [54003] = {vocs = {4, 8}, items = {7417}}, -- knights/sword [54004] = {vocs = {3, 7}, items = {7450}}, -- knights/club [54005] = {vocs = {3, 7}, items = {8926}} -- knights/axe } E a tag: <action actionid="54001-54005" event="script" value="chests.lua"/> Editado Dezembro 27, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
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.