º°kReXt°º 0 #1 Postado 11 Julho, 2008 (editado) Nome: Alternatyve Pet System Versão: 8.x Tipo do script: Actions, Monsters Servidor Testado: Aries 4.5, Aries 4.0, Thyrania, TFS Autor: KreXt ------------------------------------------------------- Primero: Créditos:30%-romulol (pela idéia) 70% KreXt - eu. (pelos scripts) IAi blz??? eu tava sem nada pra faze ai pensei em faze um simples pet system! funciona assim, os coloured eggs qndo dão use neles, nascem os pets. Os IDs dos eggs e os pets que eles fazem sao esses: 6541 = Spider 6542 = Crab 6543 = Penguin 6544 = Wasp 6545 = Seagull Os pets nao são pra ajuda a upa, pra isso servem os summons, eles apenas seguem os donos ! o problema eh que eles nao sobem as eskadas com os donos, entao botei eles com 2000 d life, qndo eles morrem nao tem corpo eh o coloured egg q faiz ele, entao qndo vc quizeh vc pode guarda ele (matando ele). vamos la? abra a pasta data/monsters abra crab.xml apague tudo que tem dentro e cóle isso: <?xml version="1.0" encoding="UTF-8"?> <monster name="Crab" nameDescription="a crab" race="blood" experience="30" speed="360" manacost="305"> <health now="5000" max="5000"/> <look type="112" head="0" body="0" legs="0" feet="0" corpse="6542"/> <targetchange interval="10000000000000000000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-1" max="-25"/> </attacks> <defenses armor="3" defense="5"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Sou Seu PET Man!" yell="1"/> <voice sentence="Os pet eh fodaa!!" yell="1"/> </voices> </monster> faça o mesm com todos os monsters que eu falar Penguin: <?xml version="1.0" encoding="UTF-8"?><monster name="Penguin" nameDescription="a penguin" race="blood" experience="1" speed="360" manacost="290"> <health now="5000" max="5000"/> <look type="250" head="20" body="30" legs="40" feet="50" corpse="6543"/> <targetchange interval="10000000000000000000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-1" max="-3"/> </attacks> <defenses armor="1" defense="4"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Sou Seu PET Man!" yell="1"/> <voice sentence="Os pet eh fodaa!!" yell="1"/> </voices> </monster> Seagull: <?xml version="1.0" encoding="UTF-8"?> <monster name="Seagull" nameDescription="a seagull" race="blood" experience="0" speed="360" manacost="0"> <health now="5000" max="5000"/> <look type="223" head="20" body="30" legs="40" feet="50" corpse="6545"/> <targetchange interval="10000000000000000000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks/> <defenses armor="5" defense="5"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Sou Seu PET Man!" yell="1"/> <voice sentence="Os pet eh fodaa!!" yell="1"/> </voices> </monster> Spider <?xml version="1.0" encoding="UTF-8"?> <monster name="Spider" nameDescription="a spider" race="venom" experience="12" speed="360" manacost="210"> <health now="5000" max="5000"/> <look type="30" head="20" body="30" legs="40" feet="50" corpse="6541"/> <targetchange interval="10000000000000000000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-1" max="-9"/> </attacks> <defenses armor="1" defense="2"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Sou Seu PET Man!" yell="1"/> <voice sentence="Os pet eh fodaa!!" yell="1"/> </voices> </monster> Wasp: <?xml version="1.0" encoding="UTF-8"?> <monster name="Wasp" nameDescription="a wasp" race="venom" experience="24" speed="360" manacost="280"> <health now="5000" max="5000"/> <look type="44" head="20" body="30" legs="40" feet="50" corpse="6544"/> <targetchange interval="10000000000000000000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="0"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="1"/> <flag canpushitems="0"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" min="-1" max="-18"/> </attacks> <defenses armor="0" defense="2"/> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="0"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Sou Seu PET Man!" yell="1"/> <voice sentence="Os pet eh fodaa!!" yell="1"/> </voices> </monster> Agora va em data/actions/scripts crie 5 arkivos: pet1.lua pet2.lua pet3.lua pet4.lua pet5.lua agora coloque isso no pet1.lua -- Pet System Alternative (By Krext) -- function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if getTilePzInfo(topos) == 0 then if getTilePzInfo(pos) == 0 then if item.itemid == 6541 then doSummonCreature("Spider", pos) doSendMagicEffect(topos,12) doPlayerSay(cid,"Pofft....",1) doRemoveItem(item.uid,item.type) else doPlayerSendCancel(cid,"Voce nao pode fazer isso.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone..") end return 1 end agora pet2.lua -- Pet System Alternative (By Krext) -- function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if getTilePzInfo(topos) == 0 then if getTilePzInfo(pos) == 0 then if item.itemid == 6542 then doSummonCreature("Crab", pos) doSendMagicEffect(topos,12) doPlayerSay(cid,"Hmm..Crab",1) doRemoveItem(item.uid,item.type) else doPlayerSendCancel(cid,"Voce nao pode fazer isso.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone..") end return 1 end agora pet3.lua -- Pet System Alternative (By Krext) -- function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if getTilePzInfo(topos) == 0 then if getTilePzInfo(pos) == 0 then if item.itemid == 6543 then doSummonCreature("Penguin", pos) doSendMagicEffect(topos,12) doPlayerSay(cid,"Penguin!",1) doRemoveItem(item.uid,item.type) else doPlayerSendCancel(cid,"Voce nao pode fazer isso.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone..") end return 1 end pet4.lua -- Pet System Alternative (By Krext) -- function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if getTilePzInfo(topos) == 0 then if getTilePzInfo(pos) == 0 then if item.itemid == 6544 then doSummonCreature("Wasp", pos) doSendMagicEffect(topos,12) doPlayerSay(cid,"Pufff...",1) doRemoveItem(item.uid,item.type) else doPlayerSendCancel(cid,"Voce nao pode fazer isso.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone..") end return 1 end pet5.lua -- Pet System Alternative (By Krext) -- function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if getTilePzInfo(topos) == 0 then if getTilePzInfo(pos) == 0 then if item.itemid == 6545 then doSummonCreature("Seagull", pos) doSendMagicEffect(topos,12) doPlayerSay(cid,"Pufff...",1) doRemoveItem(item.uid,item.type) else doPlayerSendCancel(cid,"Voce nao pode fazer isso.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone.") end else doPlayerSendCancel(cid,"Voce nao pode fazer seu Pet aqui, protection zone..") end return 1 end Agora em data/actions abra actions.xml e add essas tags: <action itemid="6541" script="pet1.lua" /><action itemid="6542" script="pet2.lua" /> <action itemid="6543" script="pet3.lua" /> <action itemid="6544" script="pet4.lua" /> <action itemid="6545" script="pet5.lua" /> E............. Agora vamos fazer o npc que vende os ovos!! eh 5k cada egg mas vc pode muda! Abra data/npc e cria um arquivo "Pet Shop.xml" e dentro poe assim: <?xml version="1.0"?><npc name="Pet Shop" script="data/npc/scripts/pet.lua" autowalk="25" floorchange="0" access="1" lookdir="2"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="146" head="2" body="2" legs="3" feet="0" addons="3" corpse="6572"/> </npc> Agor dentro da pasta npc abre a pasta script cria um arkivo "pet.lua" e dentro poe: local focus = 0local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Tchau, e volte SEMPRE!.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then selfSay('Iai ' .. creatureGetName(cid) .. '! Eu vendo ovos de spider, crab, seagull, penguin e wasp!.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Ja falo com vc.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'spider') then buy(cid,6541,1,5000) elseif msgcontains(msg, 'crab') then buy(cid,6542,1,5000) elseif msgcontains(msg, 'penguin') then buy(cid,6543,1,5000) elseif msgcontains(msg, 'wasp') then buy(cid,6544,1,5000) elseif msgcontains(msg, 'seagull') then buy(cid,6545,1,5000) elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Tchau, ' .. creatureGetName(cid) .. ', Ateh a proxima!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Proximo PLZ!....') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Tchau ateh logo!!.') focus = 0 end end end Os n°s em VERMELHO ali sao o preço dos eggs em GPS! vc pode mudar! Agora.... Olha umas SS agora: VlwW pela atençao Editado 17 Julho, 2008 por º°kReXt°º Compartilhar este post Link para o post
Dark 3 #2 Postado 15 Julho, 2008 Poderia ter sido feito melhor, colocando tudo em um unico script, usando tabelas, etc. Mas como não tem nada parecido vou aprovar (Se bem que não é necessáriamente um pet system, e sim um modo diferente de criar criaturas convencidas ) Aprovado Compartilhar este post Link para o post
º°kReXt°º 0 #3 Postado 15 Julho, 2008 tenho q estuda mais tabelas, so mto ruim com elas :cry: !!! mas vlw ! Compartilhar este post Link para o post
HeberPcL 3 #4 Postado 16 Julho, 2008 Muito bom parabens code criativo. =p Compartilhar este post Link para o post
romulol 0 #5 Postado 16 Julho, 2008 EIII ESSA IDEA ERA MINHA... É VACILO CARA.. Eu ia fazer até te pedi e vc faz isso? Não gostei...zuação isso :@ Compartilhar este post Link para o post
Mililo 0 #6 Postado 17 Julho, 2008 Manero, se a idéia for tua msm e não do kra que disse ali em cima eh bem criativo. Só que podia junta as action todas em 1 soh ficaria bem + prático. E isso ainda me deu algumas idéias de script aki =) Mas se a idéia foi do kra vc roubo eh lamentável pra um scripter... Vlws Compartilhar este post Link para o post
º°kReXt°º 0 #7 Postado 17 Julho, 2008 @romulol sim kara a idéia era sua, eu ia te passa mas va nao entra nem a pau no msn o.O faz um ano q nao te vejo la vo faze oq???? ai eu postei ai mesmo! Compartilhar este post Link para o post
Mock 32 #8 Postado 17 Julho, 2008 interessante esse pet system e um dos menores que ja vi xD Compartilhar este post Link para o post
morvy 0 #9 Postado 20 Janeiro, 2009 (editado) tipo e se quiser faser com otro bixo tipo demon etc tem que troca o convince. Editado 20 Janeiro, 2009 por morvy Compartilhar este post Link para o post
\o\ Wolf /o/ 0 #10 Postado 20 Janeiro, 2009 realmente estou imprecionaldo, não foi muito grande pelo fato de ser um summon.. Mas pra fazer ele ficar em forma de ovo tem que mata-lo ? Seja mais criativo, utilize mas recursos que "os scripts te dão " como foi dito, tables por exemplo seria uma boa (mesmo eu n mexendo direito nelas U.u) Obrigado por disponibilizar para nós vlw Compartilhar este post Link para o post
123123 1 #11 Postado 20 Janeiro, 2009 Até que é bom para ot XML, mas tem muito menos coisa que os outros né cara, mas vlw parceiro Compartilhar este post Link para o post