Ola pessoal, to aqui de volta no xtibia ajudando vocês novamente
O assunto de hoje é:
Criando Magias Exclusivas!
Bom, todo mundo ja se perguntou como seria uma verdadeira magia berserk(exori)?
Na maioria dos jogos de rpg, a magia berserk acontece somente quando o guerreiro fica furioso, então ele aumenta o seu ataque temporariamente, como se tivesse "Sede de vingança".
Então vamos ao primeiro passo:
Crie um arquivo chamado skillsup.xml dentro da pasta /data/spells/scripts (do seu ot).
Então adicione o seguinte código:
function onCastSpell(cid, var) fist = getPlayerSkill(cid,1) club = getPlayerSkill(cid,2) sword = getPlayerSkill(cid,3) axe = getPlayerSkill(cid,4) if sword > fist and sword > club and sword > axe then if sword <= 30 then doPlayerAddSkillTry(cid,3,sword) elseif sword >= 31 and sword <= 60 then doPlayerAddSkillTry(cid,3,sword-25) elseif sword >= 61 and sword <= 90 then doPlayerAddSkillTry(cid,3,sword-50) elseif sword >= 91 then doPlayerAddSkillTry(cid,3,sword-75) end elseif fist > club and fist > sword and fist > axe then if fist <= 30 then doPlayerAddSkillTry(cid,1,fist) elseif fist >= 31 and fist <= 60 then doPlayerAddSkillTry(cid,1,fist-25) elseif fist >= 61 and fist <= 90 then doPlayerAddSkillTry(cid,1,fist-50) elseif fist >= 91 then doPlayerAddSkillTry(cid,1,fist-75) end elseif club > fist and club > sword and club > axe then if club <= 30 then doPlayerAddSkillTry(cid,2,club) elseif club >= 31 and club <= 60 then doPlayerAddSkillTry(cid,2,club-25) elseif club >= 61 and club <= 90 then doPlayerAddSkillTry(cid,2,club-50) elseif club >= 91 then doPlayerAddSkillTry(cid,2,club-75) end elseif axe > fist and axe > sword and axe > club then if axe <= 30 then doPlayerAddSkillTry(cid,4,axe) elseif axe >= 31 and axe <= 60 then doPlayerAddSkillTry(cid,4,axe-25) elseif axe >= 61 and axe <= 90 then doPlayerAddSkillTry(cid,4,axe-50) elseif axe >= 91 then doPlayerAddSkillTry(cid,4,axe-75) end end end
Agora salve seu arquivo e entre no arquivo /data/spells/spells.xml
Copie o code abaixo:
<instant name="skillsup" words="force" lvl="15" maglv="4" manapercent="100" soul="5" exhaustion="1" prem="1" enabled="1" script="skillsup.lua"><vocation name="Knight"/><vocation name="Elite Knight"/></instant>
Agora procure pela magia berserk e logo abaixo cole o code acima...
Salve o arquivo e agora é só testar xD
Entre no seu ot e fale "force" com um kina lvl 15 pelo menos, ele vai aumentar um pouco seus skills, o berserk de verdade é temporario, mais como eu n consegui fazer, coloquei só issu, mas essa magia é como se vc fosse dar umas 30 pancada, issu aumenta os skills bastantinhu xD
Existem outras magias também que da pra tenta fazer, mas eu n pensei em nenhuma, eu consegui fazer uma espécie de "Scroll of town portal" pra quem ja jogou diablo sabe como que é xD
Em breve vou adicionar mais ações pra vocês.
Flws até a próxima...
Grato
Guilherme OTmaster