Hello there!
I'm relatively new to programming/scripting.
I'm developing a NPC for a PRE-RE server that grants 6 permanent random skills to the player.
Briefly, how players will win the skills will be based on randomness and not on the traditional skill tree (idea based on a private WoW server).
My problem is:
When selecting random results from arrays, sometimes not all skills are shown in the skilltree, even though the range of IDs is in accordance with db\pre-re\skill_db.txt
I know I may be doing something wrong with the arrays.
I have tried to read a lot of documentation, but due to my lack of experience I can not locate the problem.
prontera,150,150,4 script Nevasca 78,{
//Checking if player has already confirmed the skills
If(SkillsIniciais) {
mes "[ Alita ]";
mes "Voce ja confimou suas skills iniciais!";
end;
}
//Starting conversation
mes "[ Alita ]";
mes "Boas vindas ao Sistema Aleatorio de Skills!";
mes "Eu irei invocar ^FF0000 6 skills aleatorias^000000 para seu personagem.";
mes "Essas skills serao ^0000FFpermanentes em seu personagem.^000000";
next;
menu "Rolar as skills!",Roll,"Mais Informacoes",Info,"Cancelar",Sair;
//Informations about the Random Skills System
Info:
mes "[ Alita ]";
mes "Nesse sistema, voce recebe 6 skills iniciais aleatorias de qualquer classe.";
mes "As skills iniciam no nivel 1 e conforme seu personagem for evoluindo, voce recebe pontos para aprimora-las.";
mes "Em certos niveis, voce recebe mais skills para utilizar.";
close;
end;
//Rollling System
Roll:
/*
Ending up any buffs, reseting skills and removing any skill points before go!
*/
sc_end_class;
ResetSkill;
set SkillPoint,0;
/*
Setting the desired Skill IDs from db/pre-re/skill_db.txt of each pack
*/
setarray .@rdsk1,rand(27,28);
setarray .@rdsk2,rand(36,53);
setarray .@rdsk3,rand(55,81);
setarray .@rdsk4,rand(83,157);
setarray .@rdsk5,rand(210,238);
setarray .@rdsk6,rand(248,313);
/*
Giving to player the six random skills selected above
*/
skill .@rdsk1,1,0;
skill .@rdsk2,1,0;
skill .@rdsk3,1,0;
skill .@rdsk4,1,0;
skill .@rdsk5,1,0;
skill .@rdsk6,1,0;
specialeffect2 104,0;
/*
Asking for confirmation
*/
mes "ATENCAO!";
mes "Se houver ^008080menos de 6 skills^000000 na aba ETC de sua arvore de habilidades, ^FF0000NAO CONFIRME A ROLAGEM!^000000";
next;
mes "^FF0000Apos a confirmacao, elas se tornarao permanentes em seu personagem.^000000";
mes "Deseja confirmar as skills?";
switch( prompt("Rolar Novamente:Confirmar Skills") ){
//Re-roll
Case 1:
goto Roll;
end;
//Confirming the skills
Case 2:
/*
Preventing abuse
*/
if( !SkillsIniciais ){
set SkillsIniciais,1;
specialeffect2 68,0;
next;
mes "Skills confirmadas com sucesso!";
mes "Boa sorte em sua jornada, aventureiro.";
break;
}
//Preventing "Cancel button" abuse
Case 255:
sc_end_class;
ResetSkill;
set SkillPoint,0;
specialeffect2 235,0;
mes "Operacao Cancelada.";
break;
}
close;
//Ending conversation
Sair:
mes "Adeus!";
close;
end;
}
Question
Hyllok
Hello there! I'm relatively new to programming/scripting. I'm developing a NPC for a PRE-RE server that grants 6 permanent random skills to the player. Briefly, how players will win the skills will be based on randomness and not on the traditional skill tree (idea based on a private WoW server). My problem is: When selecting random results from arrays, sometimes not all skills are shown in the skilltree, even though the range of IDs is in accordance with db\pre-re\skill_db.txt I know I may be doing something wrong with the arrays. I have tried to read a lot of documentation, but due to my lack of experience I can not locate the problem.
Mirror: https://pastebin.com/raw/3FY9maCQ
Changed font, updated mirror
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.