Postado Maio 18, 2012 13 anos Nome: Mount System Versão: 8.70 Sistema: Action Bem, estava vendo aqui e não encontrei nenhum mount system pareçido com oque tenho aqui intão vou postar para vocês completo e funcionando perfeitamente. Testado em Crystal server V1.0 Em data/action/script crie um arquivo .lua e adicione: local function tameMonster(cid, item, itemEx, tame, run, broken) n = math.random(100) if n <= broken then doCreatureSay(cid, "Lost item", TALKTYPE_ORANGE_1) doRemoveItem(item.uid) elseif n > broken and n <= (tame+broken) then doRemoveItem(item.uid) doCreatureSay(cid, "You tamed the mount", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".") return true elseif n > (tame+broken) and n <= (tame+broken+run) then doCreatureSay(cid, "the monster fled", TALKTYPE_ORANGE_1) doRemoveCreature(itemEx.uid) else doCreatureSay(cid, "Try again", TALKTYPE_ORANGE_1) end return false end local function inArray(table, value) for i,v in pairs(table) do if (v.name == string.lower(value)) then return i end end return 0 end local mounts = { {item = 13307, name = "wailing widow", id = 1, tame=10, run=39, broken=51}, {item = 13298, name = "terror bird", id = 2, tame=10, run=39, broken=51}, {item = 5907, name = "bear", id = 3, tame=7, run=39, broken=54}, {item = 13295, name = "black sheep", id = 4, tame=7, run=35, broken=58}, {item = 13293, name = "midnight panther", id = 5, tame=10, run=39, broken=51}, {item = 13294, name = "draptor", id = 6, tame=10, run=39, broken=51}, {item = 13305, name = "crustacea gigantica", id = 7, tame=10, run=39, broken=51}, {item = 13292, name = "tin lizzard", id = 8, tame=10, run=36, broken=54}, {item = 13247, name = "boar", id = 10, tame=10, run=39, broken=51}, {item = 13291, name = "undead cavebear", id = 12, tame=10, run=39, broken=51} } function onUse(cid, item, fromPosition, itemEx, toPosition) if isCreature(itemEx.uid) then if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then i = inArray(mounts, getCreatureName(itemEx.uid)) if item.itemid == mounts[i].item and not getPlayerMount(cid, mounts[i].id) then if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE) doRemoveCreature(itemEx.uid) doPlayerAddMount(cid, mounts[i].id) else doSendMagicEffect(toPosition, CONST_ME_POFF) end end end end return true end Agora em action.xml adicione: <action itemid="13295" event="script" value="tools/mounts.lua"/> --reins <action itemid="13294" event="script" value="tools/mounts.lua"/> --harness <action itemid="13293" event="script" value="tools/mounts.lua"/> --leather whip <action itemid="13298" event="script" value="tools/mounts.lua"/> --carrot on a stick <action itemid="13247" event="script" value="tools/mounts.lua"/> --hunting horn <action itemid="13305" event="script" value="tools/mounts.lua"/> --Giant Shrimp <action itemid="13291" event="script" value="tools/mounts.lua"/> --Maxilla Maximus <action itemid="5907" event="script" value="tools/mounts.lua"/> --Slingshot <action itemid="13307" event="script" value="tools/mounts.lua"/> --Sweet Smelling Bait <action itemid="13292" event="script" value="tools/mounts.lua"/> --Tin key Agora em items/items.xml adicione na ultima linha, antes do </items> <item id="13291" name="maxilla maximus" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13292" name="tin key" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13293" name="leather whip" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13294" name="harness" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13295" name="reins" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13298" name="carrot on a stick" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13305" name="giant shrimp" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13307" name="sweet smelling bait" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> <item id="13247" name="hunting horn" article="a"> <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." /> <attribute key="weight" value="200" /> </item> E por ultimo em XML/mounts.xml adicione: <?xml version="1.0" encoding="UTF-8"?> <mounts> <mount id="1" clientId="368" name="Widow Queen" speed="10" /> <mount id="2" clientId="369" name="Racing Bird" speed="20" /> <mount id="3" clientId="370" name="War Bear" speed="10" /> <mount id="4" clientId="371" name="Black Sheep" speed="5" /> <mount id="5" clientId="372" name="Midnight Panther" speed="20" /> <mount id="6" clientId="373" name="Draptor" speed="40" /> <mount id="7" clientId="374" name="Titanica" speed="15" /> <mount id="8" clientId="375" name="Tin Lizzard" speed="15" /> <mount id="9" clientId="376" name="Blazebringer" speed="20" /> <mount id="10" clientId="377" name="Rapid Boar" speed="20" /> <mount id="11" clientId="378" name="Stampor" speed="20" /> <mount id="12" clientId="379" name="Undead Cavebear" speed="20" /> </mounts> Caso já tenha os items configurados no items.xml, basta trocar a config do action! tame - possibilidade do monstro fugir em % run - possibilidade de adquirir a montaria em % broken - possibilidade de quebrar o item em % PS: caso modifique preste muita atenção, ao total tem que dar 100 em tame, run e broken juntos ex: Tame = 10 Run = 40 Broken = 50 TOtal = 100 Créditos: ruda 100% Editado Maio 18, 2012 13 anos por Subyth (veja o histórico de edições)
Postado Maio 18, 2012 13 anos Tudo perfeito apenas na hora do use na criatura q da um erro Regras Gerais "Califórnia Brasileira "
Postado Maio 18, 2012 13 anos @up Tente trocar getPlayerMount(cid, mounts[i].id) por canPlayerRideMount(cid, mounts[i].id) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Maio 18, 2012 13 anos Mt bom cara ! "ℱoco, ℱorçα, ℱé, ℱelicidαde & ℱodα-se os ℱilhos dα Putα." Premiações:
Postado Maio 18, 2012 13 anos Autor Ta aqui sociopata: local function tameMonster(cid, item, itemEx, tame, run, broken) n = math.random(100) if n <= broken then doCreatureSay(cid, "Lost item", TALKTYPE_ORANGE_1) doRemoveItem(item.uid) elseif n > broken and n <= (tame+broken) then doRemoveItem(item.uid) doCreatureSay(cid, "You tamed the mount", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed the mount "..getCreatureName(itemEx.uid)..".") return true elseif n > (tame+broken) and n <= (tame+broken+run) then doCreatureSay(cid, "the monster fled", TALKTYPE_ORANGE_1) doRemoveCreature(itemEx.uid) else doCreatureSay(cid, "Try again", TALKTYPE_ORANGE_1) end return false end local function inArray(table, value) for i,v in pairs(table) do if (v.name == string.lower(value)) then return i end end return 0 end local mounts = { {item = 13307, name = "wailing widow", id = 1, tame=10, run=39, broken=51}, {item = 13298, name = "terror bird", id = 2, tame=10, run=39, broken=51}, {item = 5907, name = "bear", id = 3, tame=7, run=39, broken=54}, {item = 13295, name = "black sheep", id = 4, tame=7, run=35, broken=58}, {item = 13293, name = "midnight panther", id = 5, tame=10, run=39, broken=51}, {item = 13294, name = "draptor", id = 6, tame=10, run=39, broken=51}, {item = 13305, name = "crustacea gigantica", id = 7, tame=10, run=39, broken=51}, {item = 13292, name = "tin lizzard", id = 8, tame=10, run=36, broken=54}, {item = 13247, name = "boar", id = 10, tame=10, run=39, broken=51}, {item = 13291, name = "undead cavebear", id = 12, tame=10, run=39, broken=51} } function onUse(cid, item, fromPosition, itemEx, toPosition) if isCreature(itemEx.uid) then if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then i = inArray(mounts, getCreatureName(itemEx.uid)) if item.itemid == mounts[i].item and not canPlayerRideMount(cid, mounts[i].id) then if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE) doRemoveCreature(itemEx.uid) doPlayerAddMount(cid, mounts[i].id) else doSendMagicEffect(toPosition, CONST_ME_POFF) end end end end return true end Agradeço vodkart pela função! REP+ Editado Maio 18, 2012 13 anos por Subyth (veja o histórico de edições)
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.