Kuro o Shiniga 87 Postado Março 19, 2011 Share Postado Março 19, 2011 (editado) Opa Galera Venho Apresentar Um Script Espero Que Gostem Então Vamos La Servidor Testado: Snowz Thyranic 3.1 (8.6) Data/Actions/Scripts Crie Um Arquivo Lua Com O Nome De Blacksmith E Adicione local professions = { ["blacksmith"] = {storage = 1030, maxSkill = 10000}, } local recipes = { [2412] = {tool = 2422, skill = 0, loot = {{2383, 1}}, profession = "blacksmith"}, [2383] = {tool = 2422, skill = 50, loot = {{7385, 1}}, profession = "blacksmith"}, [7385] = {tool = 2422, skill = 80, loot = {{2392, 1}}, profession = "blacksmith"}, [2392] = {tool = 2422, skill = 100, loot = {{7384, 1}}, profession = "blacksmith"}, [7384] = {tool = 2422, skill = 120, loot = {{7390, 1}}, profession = "blacksmith"}, [7390] = {tool = 2422, skill = 160, loot = {{2400, 1}}, profession = "blacksmith"}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if recipes[itemEx.itemid] then if itemEx.actionid > 0 then doPlayerRemoveItem(cid, 2412, 1) doPlayerRemoveItem(cid, 2383, 1) doPlayerRemoveItem(cid, 7385, 1) doPlayerRemoveItem(cid, 2392, 1) doPlayerRemoveItem(cid, 7384, 1) doPlayerRemoveItem(cid, 7390, 1) doCreatureSay(cid, "You can not Do It.", TALKTYPE_ORANGE_1) local player = getPlayerPosition(cid) doSendMagicEffect(player, 31) return TRUE end lootTable = {} lootName = "You made the item " professionSkill = getPlayerStorageValue(cid, professions[recipes[itemEx.itemid].profession].storage) itemPos = getThingPos(itemEx.uid) if professionSkill < 1 then professionSkill = 0 end if item.itemid == recipes[itemEx.itemid].tool then if professionSkill >= recipes[itemEx.itemid].skill then if item.actionid ~= 5001 then if math.random(1, 5) < 2 then doRemoveItem(itemEx.uid, 1) if recipes[itemEx.itemid].profession ~= "blacksmith" then addEvent(doCreateItem, 12000, itemEx.itemid, 1, itemPos) local player = getPlayerPosition(cid) doSendMagicEffect(player, 34) end if math.random(1, 4) < 2 then if professionSkill < professions[recipes[itemEx.itemid].profession].maxSkill then setPlayerStorageValue(cid, professions[recipes[itemEx.itemid].profession].storage, professionSkill + 1) doCreatureSay(cid, "You advanced in "..recipes[itemEx.itemid].profession.." ("..professionSkill..").", TALKTYPE_ORANGE_1) local player = getPlayerPosition(cid) doSendMagicEffect(player, 31) end end repeat if #recipes[itemEx.itemid].loot == 0 then break end for i = 1, #recipes[itemEx.itemid].loot do if math.random(1, 2) < 2 then table.insert(lootTable, (recipes[itemEx.itemid].loot)) end end until lootTable ~= {} for i = 1, #lootTable do lootCount = math.random(1, lootTable[2]) doPlayerAddItem(cid, lootTable[1], lootCount) if i == #lootTable then lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[1]) .."." else lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[1]) ..", " end end if lootName == "You made the item " then lootName = "You missed!." end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, lootName) else local player = getPlayerPosition(cid) doSendMagicEffect(player, 3) end else local player = getPlayerPosition(cid) doSendMagicEffect(player, 31) doPlayerSendTextMessage(cid, 22, "You do not have the required skill!") end else local player = getPlayerPosition(cid) doSendMagicEffect(player, 55) local player = getPlayerPosition(cid) doSendMagicEffect(player, 56) doPlayerSendTextMessage(cid, 22, "You do not have the required skill!") end else local player = getPlayerPosition(cid) doSendMagicEffect(player, 2) end end return true end Depois Em Actions.xml Adicione <action itemid="2422" event="script" value="other/blacksmith.lua"/> Esse Script Foi O Qe Me Deu Mais Trabalho Pq Tive Qe Ver Varios Outros Scripts Para Poder Conseguir Desenvolver Ele Agora Vou Explicar Como Editar [2412]2412 E O Item Qe Você Ira Transformar Em Outro skill = 0 Em Skill Você Coloca O Skill Qe O Player Deve Ter Para Conseguir Fazer O Item loot = {{2383, 1}} E O Item Qe O Player Ira Ganhar Eu Coloquei So Sword Vocês Configura Do Jeito Qe Acharem Melhor Vlw Galera Abrass :smile_positivo: Se Gostou Rep+ Editado Março 26, 2011 por Pinpao Link para o comentário Compartilhar em outros sites More sharing options...
Hudsin 47 Postado Março 19, 2011 Share Postado Março 19, 2011 Script ótimo para aumentar o rpg do game,vlw Link para o comentário Compartilhar em outros sites More sharing options...
Henrique Moura 193 Postado Março 19, 2011 Share Postado Março 19, 2011 Belo script. Parabéns pela postagem e não se esqueça de continuar colaborando. Só não tive tempo de testar para checar se realmente é funcional. Abraços. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados