Jump to content

Hyllok

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Hyllok

  1. Updating:

    I have solved this issue and developed a system that allow to reroll permanent skills, as they are commited in db only when the player logs off.

    prontera,156,189,4	script	Nevasca	78,{
    
    //Checando se as Skills Iniciais já foram confirmadas pelo jogador, se sim não permite prosseguir
    /*
    If(SkillsIniciais) { 
    mes "[ Alita ]";
    mes "Voce ja confimou suas skills iniciais!";
    end;
    }
    */
    
    //Iniciando o diálogo
    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;
    
    //Informacoes sobre o Sistema Randomico de Skills
    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;
    
    //Sistema Randomico de Skills
    Roll:
    
    /*
    Removendo qualquer buff, skill ou ponto de skill antes de iniciar
    */
    
    sc_end_class;
    ResetSkill;
    set SkillPoint,0;
    
    /*
    Setando o ID das skills com base no arquivo db/pre-re/skill_db.txt de cada uma das 6 rolagens
    */
    
    setarray .@RandomSkill1[0],2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60;
    set .Random1, rand( getarraysize( .@RandomSkill1 ) );
    
    setarray .@RandomSkill2[0],61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99;
    set .Random2, rand( getarraysize( .@RandomSkill2 ) );
    
    setarray .@RandomSkill3[0],300,301,302,303,304,305;
    set .Random3, rand( getarraysize( .@RandomSkill3 ) );
    
    setarray .@RandomSkill4[0],400,401,402,403,404,405;
    set .Random4, rand( getarraysize( .@RandomSkill4 ) );
    
    setarray .@RandomSkill5[0],406,407,408,409,410,411;
    set .Random5, rand( getarraysize( .@RandomSkill5 ) );
    
    setarray .@RandomSkill6[0],412,413,414,415,416,417;
    set .Random6, rand( getarraysize( .@RandomSkill6 ) );
    
    /*
    Concedendo ao jogador as 6 skills aleatórias
    */
    skill .@RandomSkill1[ .Random1 ],1,3;
    skill .@RandomSkill2[ .Random2 ],1,3;
    skill .@RandomSkill3[ .Random3 ],1,3;
    skill .@RandomSkill4[ .Random4 ],1,3;
    skill .@RandomSkill5[ .Random5 ],1,3;
    skill .@RandomSkill6[ .Random6 ],1,3;
    
    specialeffect2 104,0;
    next;
    
    /*
    Solicitando confirmação
    */
    mes "[ Alita ]";
    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 "[ Alita ]";
    mes "^FF0000Apos a confirmacao, elas se tornarao permanentes em seu personagem.^000000";
    mes "Deseja confirmar as skills?";
    switch( prompt("Rolar Novamente:Confirmar Skills") ){
    
    //Rolando novamente, apagando as skills anteriores
    Case 1:
    skill .@RandomSkill1[ .Random1 ],0,0;
    skill .@RandomSkill2[ .Random2 ],0,0;
    skill .@RandomSkill3[ .Random3 ],0,0;
    skill .@RandomSkill4[ .Random4 ],0,0;
    skill .@RandomSkill5[ .Random5 ],0,0;
    skill .@RandomSkill6[ .Random6 ],0,0;
    goto Roll;
    end;
    
    //Confirmando as skills
    Case 2:
    
    /*
    Previnindo abuso de rolagem após confirmação
    */
    if( !SkillsIniciais ){
    set SkillsIniciais,1;
    
    specialeffect2 68,0;
    next;
    mes "Skills confirmadas com sucesso!";
    mes "Voce sera deslogado para finalizacao do processo!";
    mes "Boa sorte em sua jornada, aventureiro.";
    atcommand "@kick " + strcharinfo(0);
    break;
    }
    
    //Previnindo abuso ao clicar no botão "Cancel", que possibilita o jogador não confirmar as skills e ainda possuí-las
    Case 255:
    sc_end_class;
    ResetSkill;
    set SkillPoint,0;
    skill .@RandomSkill1[ .Random1 ],0,0;
    skill .@RandomSkill2[ .Random2 ],0,0;
    skill .@RandomSkill3[ .Random3 ],0,0;
    skill .@RandomSkill4[ .Random4 ],0,0;
    skill .@RandomSkill5[ .Random5 ],0,0;
    skill .@RandomSkill6[ .Random6 ],0,0;
    specialeffect2 235,0;
    mes "[ Alita ]";
    mes "Operacao Cancelada!";
    break;
    }
    close;
    
    //Finalizando o diálogo
    Sair:
    mes "[ Alita ]";
    mes "Adeus!";
    close;
    end;
    }

    https://pastebin.com/raw/eLS60c0j

     

    Thank you all, this thread can be closed!

  2. Thanks @Start_ and @Hijirikawa for your answers!
    On my testings, I have discovered that the issue actually is when the random skill is a passive skill.

    I have inserted a debug that returns the ID of the drawn skill, and everytime that a passive skill is given, the skilltree ETC tab becames blank.

     

    mes "Rolando!";
    skill .@rdsk1,1,0;
    mes "Skill 1: "+.@rdsk1+"";
    next;
    
    mes "Rolando!";
    skill .@rdsk2,1,0;
    mes "Skill 2: "+.@rdsk2+"";
    next;
    
    mes "Rolando!";
    skill .@rdsk3,1,0;
    mes "Skill 3: "+.@rdsk3+"";
    next;
    
    mes "Rolando!";
    skill .@rdsk4,1,0;
    mes "Skill 4: "+.@rdsk4+"";
    next;
    
    mes "Rolando!";
    skill .@rdsk5,1,0;
    mes "Skill 5: "+.@rdsk5+"";
    next;
    
    mes "Rolando!";
    skill .@rdsk6,1,0;
    mes "Skill 6: "+.@rdsk6+"";

    Is it any kind of configuration on server side or it is a source sided modification?

    Oh, and I was wondering if there is a way to prevent repeated numbers for the six arrays on my code, this way it will not give duplicated skills, messing with the code again.

     

    Thanks in advance! ?

  3. 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;
    }

    Mirror: https://pastebin.com/raw/3FY9maCQ

     

    screenHyllokRO001.jpg

×
×
  • Create New...