eduardo190696 47 Postado Agosto 9, 2011 Share Postado Agosto 9, 2011 Sistema por talkactions Descrição !back - remove o pet Level minimo e maximo -- para sumonar o pet Maximo Summons -- Só pode sumonar 1 pet tilepz -- em protec zone não pode summonar Talkactions/scripts function onSay(cid, words, param, itemEx, params) if isCreature(cid) then if words == "!back" then doRemoveCreature(x) return True end end local summons = getCreatureSummons(cid) local monster = { ["dragon lord hatchling"] = { Level = 10, Levelmax = 30, Voc = 1, Vocp = 5 }, ["dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 2, Vocp = 6 }, ["frost dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 3, Vocp = 7 }, ["dark dragon hatchling"] = { Level = 10, Levelmax = 30, Voc = 4, Vocp = 8 } } for k,v in pairs(monster) do if getPlayerVocation(cid) == v.Voc or getPlayerVocation(cid) == v.Vocp then if getPlayerLevel(cid) >= v.Level and getPlayerLevel(cid) <= v.Levelmax then if (table.maxn(summons) < 1)then if getTilePzInfo(getCreaturePosition(cid)) == false then x = doSummonCreature(k, getCreaturePosition(cid)) doConvinceCreature(cid, x) doCreatureSay(cid, "Go to me ,".. k,1) else doPlayerSendCancel(cid, "Sorry, You cannot create Element Pet in pz.") end else doPlayerSendCancel(cid, "Sorry, You can not create more than one Element Pet.") end else doPlayerSendCancel(cid, "Sorry, You no have Level for creat your Element Pet.") end end end return true end Talkactions.xml <talkaction words="!criar" script="vocationsummon.lua"/> <talkaction words="!back" script="vocationsummon.lua"/> Editando ["Nome do Monster"] = { Level = Level Minimo, Levelmax = Level Maximo, Voc = Vocação, Vocp = Promotion }, não esqueça de editar a flag <flag convinceable="1"/> no monster e no ultimo monster da tabela não deve ter virgula no final Tirando Lvl Max Procure por if getPlayerLevel(cid) >= v.Level and getPlayerLevel(cid) <= v.Levelmax then e Deixa assim if getPlayerLevel(cid) >= v.Level then Gosto ? Da ++rep não cai o dedo Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/ Compartilhar em outros sites More sharing options...
felipefioravanti 0 Postado Agosto 10, 2011 Share Postado Agosto 10, 2011 Cara, não funcionou aqui, fiz tudo que você pediu, mas quando eu boto <flag convinceable="1"/> e entro no server, aparece isso: [10/08/2011 16:04:06] [Error - CreatureScript Interface] [10/08/2011 16:04:06] data/creaturescripts/scripts/firstitems.lua:onLogin [10/08/2011 16:04:06] Description: [10/08/2011 16:04:06] data/creaturescripts/scripts/firstitems.lua:55: bad argument #1 to 'maxn' (table expected, got nil) [10/08/2011 16:04:06] stack traceback: [10/08/2011 16:04:06] [C]: in function 'maxn' [10/08/2011 16:04:06] data/creaturescripts/scripts/firstitems.lua:55: in function <data/creaturescripts/scripts/firstitems.lua:53> Infelizmente, eu tentei colocar o flag convinceable no 0 mais não funcionou, quando eu escrevia !criar apenas falava que eu não tinha level, mesmo eu sendo level 70k >.> Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1082946 Compartilhar em outros sites More sharing options...
eduardo190696 47 Postado Agosto 11, 2011 Autor Share Postado Agosto 11, 2011 mano, o script tem lvl máximo, ou seja dps do lvl 30 não pode mais criar, no tópico tem como tirar essa parte e o erro do seu executável n tem nada a ver com o meu systema Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1083450 Compartilhar em outros sites More sharing options...
felipefioravanti 0 Postado Agosto 13, 2011 Share Postado Agosto 13, 2011 (editado) mano, o script tem lvl máximo, ou seja dps do lvl 30 não pode mais criar, no tópico tem como tirar essa parte e o erro do seu executável n tem nada a ver com o meu systema Ah tá, entendi Já o erro, se alguém souber o que é, por favor me fale EDIT - Cara, consegui botar os pets aqui no ot merece rep+ valeeeeeeeu /o\ Editado Agosto 13, 2011 por LipeFioravanti Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1084214 Compartilhar em outros sites More sharing options...
eduardo190696 47 Postado Agosto 13, 2011 Autor Share Postado Agosto 13, 2011 (editado) LipeFioravanti , esse seu erro esta nos itens iniciais de quando o player faz o char, eles ficam na pasta data/creaturescripts/scripts/firstitems.lua, mais especificamente na linha 55 tem um mau argumento, me manda pm com o seu script que eu arrumo. e cade meu rep ? e.e Editado Agosto 13, 2011 por eduardobean Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1084250 Compartilhar em outros sites More sharing options...
felipefioravanti 0 Postado Agosto 13, 2011 Share Postado Agosto 13, 2011 (editado) LipeFioravanti , esse seu erro esta nos itens iniciais de quando o player faz o char, eles ficam na pasta data/creaturescripts/scripts/firstitems.lua, mais especificamente na linha 55 tem um mau argumento, me manda pm com o seu script que eu arrumo. e cade meu rep ? e.e Desculpe, ontem de madrugada tive que sair, mais seu rep está aqui \o Reputação dada LipeFioravanti EDIT - firstitems.lua local firstItems = {} firstItems[0] = { 2173, 2525, 2428, 2124, 2460, 2478, 2643 } firstItems[1] = { 2173, 2525, 2190, 2124, 2460, 2478, 2643 } firstItems[2] = { 2173, 2525, 2182, 2124, 2460, 2478, 2643 } firstItems[3] = { 2173, 2525, 2389, 2124, 2460, 2478, 2643 } firstItems[4] = { 2173, 2525, 2428, 2124, 2460, 2478, 2643 } function onLogin(cid) if getPlayerStorageValue(cid, 30001) == -1 then for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1) end if getPlayerSex(cid) == 0 then doPlayerAddItem(cid, 2465, 1) else doPlayerAddItem(cid, 2465, 1) end local bag = doPlayerAddItem(cid, 9774, 1) doAddContainerItem(bag, 2160, 1) doAddContainerItem(bag, 2554, 1) doAddContainerItem(bag, 2120, 1) doAddContainerItem(bag, 7618, 1) doAddContainerItem(bag, 2383, 1) setPlayerStorageValue(cid, 30001, 1) end return TRUE end EDIT 2- cara, tem como vc me explicar como eu faço pra sumonar o bixo no pz ? valeu Editado Agosto 13, 2011 por LipeFioravanti Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1084524 Compartilhar em outros sites More sharing options...
eduardo190696 47 Postado Agosto 14, 2011 Autor Share Postado Agosto 14, 2011 só tira as linhas if getTilePzInfo(getCreaturePosition(cid)) == false then else doPlayerSendCancel(cid, "Sorry, You cannot create Element Pet in pz.") end ai vai poder summonar em pz Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1085174 Compartilhar em outros sites More sharing options...
felipefioravanti 0 Postado Agosto 14, 2011 Share Postado Agosto 14, 2011 só tira as linhas if getTilePzInfo(getCreaturePosition(cid)) == false then else doPlayerSendCancel(cid, "Sorry, You cannot create Element Pet in pz.") end ai vai poder summonar em pz fiz isso amigo, mais quando vou fazer na prática, escrevo !criar e aparece 18:49 [sTAFF] Lipe: Go to me, dragon hatchling , só que o bixo não nasce o_o bom, de qualquer forma muito obrigado por ajudar Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1085345 Compartilhar em outros sites More sharing options...
eduardo190696 47 Postado Agosto 16, 2011 Autor Share Postado Agosto 16, 2011 então é pq o otserver n deixa summonar em pz, só editando as soucer mesmo Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1086460 Compartilhar em outros sites More sharing options...
felipefioravanti 0 Postado Agosto 16, 2011 Share Postado Agosto 16, 2011 então é pq o otserver n deixa summonar em pz, só editando as soucer mesmo ah tá, valeu Link para o comentário https://xtibia.com/forum/topic/164484-vocation-pet-system/#findComment-1086534 Compartilhar em outros sites More sharing options...
Posts Recomendados