Postado Janeiro 28, 2015 10 anos Autor Du erro... tentei usar duas vezes ate ver q tinha dado erro.. olha ai.
Postado Janeiro 28, 2015 10 anos Este é o próprio script que te mandei? Não alterou nada? #TOPIC Estou quase terminando o sistema de LOOK.
Postado Janeiro 28, 2015 10 anos Autor É ele sim, não mudei nada não... a versão do ot é 9.83 caso seja isso...
Postado Janeiro 28, 2015 10 anos Na verdade encontrei o erro, tente usar este: local mages = {1, 2, 5, 6} local paladins = {3, 7} local knights = {4, 8} local addml = 2 -- quantidade de ML à adicionar aos mages local addskill = 2 -- quantidade de skill adicionar aos guerreiros (pally e knights) function onEquip(cid, item, slot) if isInArray(mages, getPlayerVocation(cid)) then doPlayerAddMagLevel(cid, addml) elseif isInArray(knights, getPlayerVocation(cid)) then for b = 1, 4 do doPlayerAddSkill(cid, b, addskill) end elseif isInArray(paladins, getPlayerVocation(cid)) then doPlayerAddSkill(cid, 5, addskill) end return true end function onDeEquip(cid, item, slot) if isInArray(mages, getPlayerVocation(cid)) then doPlayerAddMagLevel(cid, - addml) elseif isInArray(knights, getPlayerVocation(cid)) then for b = 1, 4 do doPlayerAddSkill(cid, b, - addskill) end elseif isInArray(paladins, getPlayerVocation(cid)) then doPlayerAddSkill(cid, 5, - addskill) end return true end O do look ficou assim: Registre em CreatureScripts.xml esta tag: <event type="look" name="ItemsDescription" event="script" value="items_descr.lua"/> Registre também em login.lua a tag abaixo junto com as do gênero: registerCreatureEvent(cid, "ItemsDescription") Este é o arquivo items_descr.lua na pasta Scripts (Creaturescripts). local mages = {1, 2, 5, 6} local paladins = {3, 7} local knights = {4, 8} local items = { [2456] = {2, 5}, -- [ItemID] = {ml, skills} [2457] = {3, 6} -- ItemID } function onLook(cid, thing, pos, dist) local voc = getPlayerVocation(cid) local check = items[thing.itemid] if isPlayer(thing) then return true end if check then if isInArray(mages, voc) then local string = 'Increase + '..check[1]..' magic level.' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) elseif isInArray(knights, voc) then local string = 'Increase + '..check[2]..' skills for a knight.' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) elseif isInArray(paladins, voc) then local string = 'Increase + '..check[2]..' skills for a paladins.' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) end end return true end Boa sorte.
Postado Janeiro 28, 2015 10 anos Autor Deu mais ou menos, ele add 6 de ml quando coloca o equipe, mas n tira o ml quando retiro o equipe... kkkkkk E ficou dando erro, dai coloquei: <!-- Elfic Helmet --> <movevent type="Equip" itemid="2490" slot="head" event="script" value="elfichelmet.lua"/> <movevent type="DeEquip" itemid="2490" slot="head" event="script" value="elfichelmet.lua"/> Tirei o "on" de "equip" ai pegou... Modifiquie o script, dai ele muda 3 de ml (sendo q coloquei para mudar 1) e não sai quando retiro o equipe... function onEquip(cid, item, slot) if getPlayerVocation(cid) == 1 then doPlayerAddMagLevel(cid, 1) elseif getPlayerVocation(cid) == 2 then doPlayerAddMagLevel(cid, 1) elseif getPlayerVocation(cid) == 3 then doPlayerAddSkill(cid, 5, 1) elseif getPlayerVocation(cid) == 4 then doPlayerAddSkill(cid, 1, 1) elseif getPlayerVocation(cid) == 5 then doPlayerAddMagLevel(cid, 1) elseif getPlayerVocation(cid) == 6 then doPlayerAddMagLevel(cid, 1) elseif getPlayerVocation(cid) == 7 then doPlayerAddSkill(cid, 5, 1) elseif getPlayerVocation(cid) == 8 then doPlayerAddSkill(cid, 1, 1) end return TRUE end function onDeEquip(cid, item, slot) if getPlayerVocation(cid) == 1 then doPlayerAddMagLevel(cid, -1) elseif getPlayerVocation(cid) == 2 then doPlayerAddMagLevel(cid, -1) elseif getPlayerVocation(cid) == 3 then doPlayerAddSkill(cid, 5, -1) elseif getPlayerVocation(cid) == 4 then doPlayerAddSkill(cid, 1, -1) elseif getPlayerVocation(cid) == 5 then doPlayerAddMagLevel(cid, -1) elseif getPlayerVocation(cid) == 6 then doPlayerAddMagLevel(cid, -1) elseif getPlayerVocation(cid) == 7 then doPlayerAddSkill(cid, 5, -1) elseif getPlayerVocation(cid) == 8 then doPlayerAddSkill(cid, 1, -1) end return TRUE end Editado Janeiro 28, 2015 10 anos por Gibion (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.