Postado Março 27, 2013 12 anos Mudando Skills Iniciais Olá TKzeros, hoje precisei de uma script básica e notei que aqui no TK não tem, então, em vez de eu sugar de algum fórum, decidi eu mesmo criar e compartilhar com vocês, sendo assim meu primeiro tópico tutorial.Ela é bem simples, quando você loga com um personagem, ela identifica a classe, verifica se a skill atual é menor que a configurada por você e se for menor, ele adiciona a quantidade que você configurou menos a quantidade atual, ou seja, vai ficar com a quantidade que você configurou...Não coloquei Storage pra fazer só na primeira vez que logar, porque se você coloca esse número como skill inicial, é porque você não deseja que o player tenha menos skill que isso, então, caso ele morra e perca a skill (fique menor que a inicial) ela vai voltar pro mesmo valor da inicial.Então vamos ao que interessa.1 - Adicionar a tag em Creaturescripts.xmlAbra o creaturescripts.xml em: Pasta do seu OT\data\creaturescripts\creaturescripts.xml 1.1 - Em uma das linhas entre e adicione a tag: 2 - Registre o CreatureEvent (Não sei se é necessário, se não for, me avisem.)Abra o login.lua em: Pasta do seu OT\data\creaturescripts\scripts\login.lua 2.1 - Procure por alguma linha que comece com "registerCreatureEvent" e logo em baixo dela coloque: registerCreatureEvent(cid, "Start Skills") 3 - Abra o bloco de notas, adicione a seguinte script dentro: function onLogin(cid) local playerVoc = getPlayerVocation(cid) -- Deixe isso como esta. local reqTries = getPlayerRequiredSkillTries -- Deixe isso como esta. local LevelMin = 130 -- Caso não queira utilizar essa função da script, mude o valor de 130 para 0. local Mages = { ML = 60, -- Level inicial/minimo dos mages, sorc e druid. Shield = 20 -- Shield inicial/minimo dos mages, sorc e druid. } local Paladin = { Distance = 80, -- Distancia inicial/minima dos paladinos. Shield = 80, -- Shield inicial/minimo dos paladinos. ML = 20 -- MagicLevel inicial/minimo dos paladinos. } local Kina = { Sword = 80, -- Sword Level inicial/minimo dos knights. Axe = 80, -- Axe Level inicial/minimo dos knights. Club = 80, -- Club Level inicial/minimo dos knights. Shield = 80, -- Shield Level inicial/minimo dos knights. ML = 9 -- MagicLevel inicial/minimo dos knights. } if getPlayerLevel(cid) < LevelMin then doPlayerAddExperience(cid, (getExperienceForLevel(LevelMin) - getPlayerExperience(cid))) end if playerVoc == 1 then if getPlayerMagLevel(cid) < Mages.ML then doPlayerAddMagLevel(cid, Mages.ML - getPlayerMagLevel(cid)) end if getPlayerSkill(cid, SKILL_SHIELD) < Mages.Shield then doPlayerAddSkill(cid, SKILL_SHIELD, Mages.Shield - getPlayerSkill(cid, SKILL_SHIELD)) end elseif playerVoc == 2 then if getPlayerMagLevel(cid) < Mages.ML then doPlayerAddMagLevel(cid, Mages.ML - getPlayerMagLevel(cid)) end if getPlayerSkill(cid, SKILL_SHIELD) < Mages.Shield then doPlayerAddSkill(cid, SKILL_SHIELD, Mages.Shield - getPlayerSkill(cid, SKILL_SHIELD)) end elseif playerVoc == 3 then if getPlayerSkill(cid, SKILL_DISTANCE) < Paladin.Distance then doPlayerAddSkill(cid, SKILL_DISTANCE, Paladin.Distance - getPlayerSkill(cid, SKILL_DISTANCE)) end if getPlayerSkill(cid, SKILL_SHIELD) < Paladin.Shield then doPlayerAddSkill(cid, SKILL_SHIELD, Paladin.Shield - getPlayerSkill(cid, SKILL_SHIELD)) end if getPlayerMagLevel(cid) < Paladin.ML then doPlayerAddMagLevel(cid, Paladin.ML - getPlayerMagLevel(cid)) end elseif playerVoc == 4 then if getPlayerSkill(cid, SKILL_SWORD) < Kina.Sword then doPlayerAddSkill(cid, SKILL_SWORD, Kina.Sword - getPlayerSkill(cid, SKILL_SWORD)) end if getPlayerSkill(cid, SKILL_CLUB) < Kina.Club then doPlayerAddSkill(cid, SKILL_CLUB, Kina.Club - getPlayerSkill(cid, SKILL_CLUB)) end if getPlayerSkill(cid, SKILL_AXE) < Kina.Axe then doPlayerAddSkill(cid, SKILL_AXE, Kina.Axe - getPlayerSkill(cid, SKILL_AXE)) end if getPlayerSkill(cid, SKILL_SHIELD) < Kina.Shield then doPlayerAddSkill(cid, SKILL_SHIELD, Kina.Shield - getPlayerSkill(cid, SKILL_SHIELD)) end if getPlayerMagLevel(cid) < Kina.ML then doPlayerAddMagLevel(cid, Kina.ML - getPlayerMagLevel(cid)) end end return TRUE end 3.1 - Agora salve com o nome startskills.lua na pasta: Pasta do seu OT\data\creaturescripts\scripts 4 - Reinicie ou inicie o seu OT e pronto. Caso utilize Mysql, vá no PhpMyAdmin e tire as skills dos samples. Bem, sei que é possível diminuir essa script mas eu não tenho conhecimento pra isso, caso alguém se interesse por diminui-la fique a vontade, adiciono ela no tópico e coloco os devidos créditos.Primeiro de muitos tutoriais, no nível conforme eu for sabendo. Até logo.Créditos:Spectrus Editado Abril 1, 2013 12 anos por Spectrus (veja o histórico de edições) Meus Trabalhos: Mostrar conteúdo oculto 1º Mudando Skills iniciais - Start Skills (Sqlite e Mysql) 2º %5BDownload%5D %5BWebsite%5D Spectral vBeta1 (Ele é apenas informativo, bom para OTs de Account Manager e derivados) 3º %5BCreatureScript%5D No Drop Loot
Postado Março 30, 2013 12 anos Opa cara, belo tópico, ótimo conteúdo e super organizado. Valeu pela contribuição, reputado!
Postado Abril 1, 2013 12 anos Autor Em 30/03/2013 em 17:43, Matheus disse: Opa cara, belo tópico, ótimo conteúdo e super organizado. Valeu pela contribuição, reputado! Opa, vlw cara @Tópic Bem, hoje fui utilizar essa script e senti a necessidade de também ter um level minimo, então adicionei algumas linhas la na script e aproveitei pra dar uma organizada na script e adicionar algumas informações para um iniciante saber onde mudar os valores. Caso não queira utilizar level minimo é só deixar o valor do LevelMin = 0. Meus Trabalhos: Mostrar conteúdo oculto 1º Mudando Skills iniciais - Start Skills (Sqlite e Mysql) 2º %5BDownload%5D %5BWebsite%5D Spectral vBeta1 (Ele é apenas informativo, bom para OTs de Account Manager e derivados) 3º %5BCreatureScript%5D No Drop Loot
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.