Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/15/24 in all areas

  1. Hello. Your script is looking good, great start. You can test this one, maybe you learn something, I tried doing what you requested. //Converts ratio to return actual number with decimals. //10000=100% 1000=10% 100=1% 10=0,1% 1=0,01% function script F_ConvertRatio { .@n = getarg(0); if (.@n%100 && .@n > 100 && .@n < 1000 && atoi(charat(""+.@n, 1)) == 0 || .@n < 10) .@n2$ = .@n/100 + (.@n%100?",0"+.@n%100:""); else if (.@n%100 && .@n > 9 && .@n < 1000 && atoi(charat(""+.@n, getstrlen(""+.@n)-1)) == 0) .@n2$ = .@n/100 + "," + (.@n%100)/10; else .@n2$ = .@n/100 + (.@n%100?","+.@n%100:""); return .@n2$; } prontera,113,246,5 script Rafa da Rifa 1_F_PUBGIRL,{ cutin "job_dancer_eir01", 0; mes "[" + strnpcinfo(1) + "]"; mes "Você quer participar da minha rifa?"; mes "Ai, que pergunta, né? É claro que quer!"; mes "Pelo generosíssimo valor de ^0000FF" + F_InsertComma($@raffle_cost) + "z^000000, você concorre a"; mes "" + $@raffle_prize_qty + " [<ITEM>" + getitemname($@raffle_prize_id) + "<INFO>" + $@raffle_prize_id + "</INFO></ITEM>]."; next; if (isnpccloaked()) goto S_Restarting; .@i = rand(20,40); mes "[" + strnpcinfo(1) + "]"; mes "Você precisa tirar o número ^FF0000" + .@i + "^000000 pra ganhar ^00FF00" + getitemname($@raffle_prize_id) + "^000000."; mes "Mas primeiro, preciso dos ^0000FF" + F_InsertComma($@raffle_cost) + "z^000000."; mes "O que me diz?"; next; if(select("Tá OK! Lá vamos nós...", "Não, obrigad" + (Sex?"o":"a") + ".") == 2) { mes "[" + strnpcinfo(1) + "]"; mes "Não tá confiante?"; close3; } if (Zeny < $@raffle_cost) { mes "[" + strnpcinfo(1) + "]"; mes "Você não tem o zeny para participar?"; close3; } if (checkweight(1301,1) == 0) { mes "[" + strnpcinfo(1) + "]"; mes "Você tá com uma mochila bem pesada em..."; mes "Como você vai receber o prêmio desse jeito?"; close3; } if (isnpccloaked()) goto S_Restarting; Zeny -= $@raffle_cost; mes "[" + strnpcinfo(1) + "]"; mes "O número do prêmio é ^FF0000" + .@i + "^000000."; if (rand(10000) > $@raffle_chance) { .@l = rand(.@i-19,.@i+19); showdigit .@l; mes "Você tirou o número ^0000FF" + .@l + "^000000."; mes "Não foi dessa vez. Mas e se você tentar de novo?"; mes "Aliás, aqui está o seu prêmio de consolação!"; getitem $@raffle_consol_id, rand($@raffle_consol_min,$@raffle_consol_max); close3; } showdigit .@i; mes "Você tirou o número ^0000FF" + .@i + "^000000."; mes "... Peraí, você ganhou? É isso mesmo, produção?"; mes "Hoje é o seu dia!"; getitem $@raffle_prize_id, $@raffle_prize_qty; announce "" + strnpcinfo(1) + " : Parabéns! " + strcharinfo(0) + " recebeu " + $@raffle_prize_qty + " " + itemlink($@raffle_prize_id) + " na Rifa!", bc_all; specialeffect2 EF_PROVIDENCE; donpcevent strnpcinfo(3)+"::OnStart"; close3; S_Restarting: mes "[" + strnpcinfo(1) + "]"; mes "Nossa, essa rifa acabou bem quando estávamos conversando."; mes "Você vai ter que tentar a sorte na nova rifa."; close3; OnInit: bindatcmd "rifa",strnpcinfo(3)+"::OnGM", 99, 99; setarray .rifas, //Cada linha é uma rifa diferente //<grand prize>,<grand prize amount>,<consolation prize>,<consolation min amount>,<consolation max amount>,<cost>,<win chance 1~10000>, 970 , 30 , 7136 , 1, 20, 40000 , 100, 12264, 5 , 7135 , 1, 20, 100000, 100, 12928, 5 , 678 , 1, 10, 100000, 200, 7938 , 100, 7939 , 1, 50, 100000, 100, 6962 , 1 , 7139 , 1, 20, 150000, 125, 7620 , 10 , 984 , 1, 15, 150000, 125, 7619 , 10 , 985 , 1, 15, 200000, 200, 12412, 1 , 6259 , 1, 40, 300000, 40, 23546, 1 , 1061 , 1, 400, 500000, 200, 6635 , 1 , 23044, 1, 10, 600000, 50; // 1200000 = 20 minutos OnTimer1200000: OnStart: stopnpctimer; cloakonnpc strnpcinfo(0); sleep 10000; .@r = rand(getarraysize(.rifas)/7) *7; $@raffle_prize_id = .rifas[.@r]; $@raffle_prize_qty = .rifas[.@r+1]; $@raffle_consol_id = .rifas[.@r+2]; $@raffle_consol_min = .rifas[.@r+3]; $@raffle_consol_max = .rifas[.@r+4]; $@raffle_cost = .rifas[.@r+5]; $@raffle_chance = .rifas[.@r+6]; announce "A Rafa gostaria de convidar a todos a participarem de sua Rifa, na biblioteca ao oeste de Prontera!", bc_all; cloakoffnpc strnpcinfo(0); initnpctimer; sleep 5000; announce "" + strnpcinfo(1) + " : O grande prêmio é " + ($@raffle_prize_qty>1?$@raffle_prize_qty+"x ":"") + itemlink($@raffle_prize_id) + "! E o prêmio de consolação é " + itemlink($@raffle_consol_id) + " " + $@raffle_consol_min + "~" + $@raffle_consol_max + "x!", bc_all; npctalk "Este aqui é um prêmio especial que aparece só de vez em quando, então se eu fosse você, eu participaria!"; end; OnGM: message strcharinfo(0), "Esses são comandos especiais que apenas você ADMs e GMs podem usar."; switch(select("Cancelar", "^0000FFVer rifa atual^000000", "^0000FFVer rifas^000000", "^0000FFIniciar nova rifa^000000")) { case 1: end; case 2: if (isnpccloaked()) { message strcharinfo(0), "RIFA EM PROCESSO DE REINICIAR"; end; } mes "^0000FFPrêmio:^000000"; mes "^0000FF[<ITEM>" + getitemname($@raffle_prize_id) + "<INFO>" + $@raffle_prize_id + "</INFO></ITEM>] " + $@raffle_prize_qty + "x^000000"; mes "^FF0000Consolação:^000000"; mes "^FF0000[<ITEM>" + getitemname($@raffle_consol_id) + "<INFO>" + $@raffle_consol_id + "</INFO></ITEM>] " + $@raffle_consol_min + "~" + $@raffle_consol_max +"x^000000"; mes "Preço: " + F_InsertComma($@raffle_cost) + "z"; mes "Chance do prêmio: " + F_ConvertRatio($@raffle_chance) + "%"; mes "Iniciada faz " + (getnpctimer(0)/1000) + " segundos."; close; case 3: .@size = getarraysize(.rifas)/7; for( .@i = 0; .@i < .@size; .@i++ ) { .@r = .@i * 7; mes "^0000FFRifa " + (.@i+1) + " - Prêmio:^000000"; mes "^0000FF[<ITEM>" + getitemname(.rifas[.@r]) + "<INFO>" + .rifas[.@r] + "</INFO></ITEM>] " + .rifas[.@r+1] + "x^000000"; mes "^FF0000Consolação:^000000"; mes "^FF0000[<ITEM>" + getitemname(.rifas[.@r+2]) + "<INFO>" + .rifas[.@r+2] + "</INFO></ITEM>] " + .rifas[.@r+3] + "~" + .rifas[.@r+4] +"x^000000"; mes "Preço: " + F_InsertComma(.rifas[.@r+5]) + "z"; mes "Chance do prêmio: " + F_ConvertRatio(.rifas[.@r+6]) + "%"; if (.@i < .@size-1) { if(select("Ver outra rifa","Fechar") == 1) clear; else break; } } close; case 4: donpcevent strnpcinfo(3)+"::OnStart"; end; } } prontera,115,246,3 script Rifa#raffle_board 2_BULLETIN_BOARD,{ mes "^0000FFGrande prêmio da Rifa:^000000"; mes "^0000FF[<ITEM>" + getitemname($@raffle_prize_id) + "<INFO>" + $@raffle_prize_id + "</INFO></ITEM>] " + $@raffle_prize_qty + "x^000000"; mes " "; mes "^FF0000Prêmio de Consolação:^000000"; mes "^FF0000[<ITEM>" + getitemname($@raffle_consol_id) + "<INFO>" + $@raffle_consol_id + "</INFO></ITEM>] " + $@raffle_consol_min + "~" + $@raffle_consol_max +"x^000000"; mes " "; mes "Preço: " + F_InsertComma($@raffle_cost) + "z"; close; } Using initnpctimer and stopnpctimer you can automate the raffle change. Example: OnInit: // set the first raffle when the server starts. initnpctimer; //start the timer end; OnTimer60000: //after 60 seconds this part will trigger //change the raffle array to new values. stopnpctimer; //erase the old timer initnpctimer; //start the timer again from 0 end;
    3 points
  2. Via color picker. So the code is 255 0 255.
    1 point
  3. Before I saw a few of servers having issue because of groups.yml that written incorrectly, which can makes server couldnt start (stuck at reading groups.yml), or account cannot login because of group ID didnt exist (cant be read by rathena emulator). So I hope this helps, Commands Generator. The list of commands are parsed directly from doc/atcommands.txt so if there is any updates of commands, it should be automatically added too. Let me know if you have any suggestion or improvement ideas for any of this generator.
    1 point
  4. Hello Racaae, thx for your help! i'm testing your script now, and he looks really clean and with more features than i expected! I noticed that some time when even if the player gets the right number of the raffle (win codition) he not get the grand prize istead the npc gives to the player the consolation prize. I've made some changes on my original code yesterday before read your post and here is what my actual raffle script is: prontera,161,188,4 script Ana da Rifa 4_F_PINKWOMAN,{ .@npc_name$ = "[^FF09FF Ana ^000000]"; mes .@npc_name$; if ((gettimetick(2) - .last_participation_time) <= 3) { mes "Você já comprou uma rifa recentemente, aguarde um instante..."; close; } mes "Olá, seja bem-vindo(a) ao nosso sistema de rifas!"; mes "Temos vários prêmios interessantes que podem te ajudar em sua jornada!"; next; mes "Gostaria de participar da rifa do momento?"; mes "O prêmio ^FFAF22 PRINCIPAL ^000000 será: "; mes "x"+.Grand_Prize_Amount[.index]+" ^477FEE"+ .Grand_Prize_T$[.index]; mes "-------------------------------------------"; mes "O prêmio de ^FF0000 consolação ^000000 será: "; mes "x"+.Consolation_Prize_Amount[.index]+" ^895818"+ .Consolation_Prize_T$[.index]; mes "O valor da rifa é de ^FF0000"+ .zeny_required[.index] +"^000000 Zenys"; next; switch( select("Tentar a sorte!", "Hoje não.") ) { case 1: if (Zeny <= .zeny_required[.index]) { mes "Você não tem ^FF0000"+ .zeny_required[.index] +"^000000 Zenys para participar da Rifa!"; close; } .@weight = 100 * Weight / MaxWeight; getinventorylist; if (.@weight > 50) || ((100 - @inventorylist_count ) < 6) { mes "Verifique se você esta sobrecarregado ou com o inventário próximo do limite!"; close; } .@p1 = (rand(1000)+1); mes "Sua chance de ganhar é de "+ (.odds[.index]/10) +"%"; next; mes "Sua sorte hoje é o número - ^FF9900"+ .@p1 +"."; if (.@p1 <= .odds[.index]) { mes "Parabéns voce ganhou o grande prêmio:"; mes "x"+ .Grand_Prize_Amount[.index] +" ^477FEE"+ .Grand_Prize_T$[.index]; Zeny -= .zeny_required[.index]; getitem .Grand_Prize$[.index], .Grand_Prize_Amount[.index]; mapannounce .map$, "O jogador "+ strcharinfo(0) +" foi o vencedor da atual rifa!", 0, 0xFCE516; close2; goto OnInit; } else{ .last_participation_time = gettimetick(2); mes "Infelizmente não foi desta vez, seu prêmio de consolação é: "; mes "x"+ .Consolation_Prize_Amount[.index] +" ^895818"+ .Consolation_Prize_T$[.index]; Zeny -= .zeny_required[.index]; getitem .Consolation_Prize$[.index], .Consolation_Prize_Amount[.index]; close; } } close; OnInit: OnTimer600000: initnpctimer; .map$ = "prontera"; hideonnpc "Ana da Rifa"; sleep 12000; hideoffnpc "Ana da Rifa"; setarray .raffle[0], 0, 1, 2, 3, 4; setarray .Grand_Prize$[0], "Red_Potion", "White_Potion", "Blue_Potion", "Tha_Maero_Card", "Poring_Card"; setarray .Grand_Prize_T$[0], "Poções Vermelhas", "Poções Brancas", "Poções Azuis", "Carta Memória de Thanatos", "Carta Poring"; setarray .Grand_Prize_Amount[0], 20, 30, 5, 50, 25; setarray .Consolation_Prize$[0], "Red_Potion", "White_Potion", "Blue_Potion", "Jellopy", "Stone_Fragments"; setarray .Consolation_Prize_T$[0], "Poção Vermelha", "Poção Branca", "Poção Azul", "Jellopys", "Fragmentos de Pedra"; setarray .Consolation_Prize_Amount[0], 1, 1, 1, 50, 5; setarray .zeny_required[0], 500, 1500, 10000, 2500000, 999; setarray .odds[0], 500, 350, 450, 30, 500; .index = rand(getarraysize(.raffle)); announce "Olá, uma nova rifa está disponível! O prêmio no momento para o ganhador é x"+ .Grand_Prize_Amount[.index]+ " " + .Grand_Prize_T$[.index] +", e para quem não conseguir, o prêmio de consolação será x"+ .Consolation_Prize_Amount[.index]+ " " + .Consolation_Prize_T$[.index] + ", a chance de ganhar o prêmio é de "+ (.odds[.index]/10) +"%." , 0, 0x7AF6EE; end; } Some of the changes: Yet i need to fix a problem when one player wins and the others are chatting with the NPC they also get one last chance to win, but i see in your code the solution (check if the npcs is cloaked before the prize results, if true, go to restarting label!) Thank you very much Racaae for coding my request and for the insights it gives me, I will try to understand the complete code to improve my scripting skills! I will make some changes based on Raccae's code and in a few days i will share it here.
    1 point
  5. I was reading this topic yesterday and discovered that most of the requests were not added. Therefore, I am making my debut here to share with you the updated @autoattack function. Added Commands: @autoattack - display all @autoattack commands. @autoattack on/off @autoattack list @autoattack +monsterID @autoattack -monsterID #Edit If you use [ @autoattack on ] without adding monster targets will attack all the monsters (DEFAULT setting.) Auto-attack can be toggled on or off using the @autoattack on/off command. Specific mobs can be added or removed from the target list using @autoattack +<mobID> or @autoattack -<mobID> respectively. Since I'm using the latest version, applying the patch shouldn't be a problem.(I also removed the struct warnings from the map_session_data). Attached(Updated): atcommand[remix]
    1 point
  6. Version 1.2.5

    10982 downloads

    Heya, This tool is an action file editor, it edits Act and Spr files. You will find similarities with ActOR in its design, but it should be much more enjoyable to edit animations ;]. Special thanks to Nebraskka for testing this software in its early days. All the suggestions and feedbacks made this software much better. How to install Download the zip archive provided from the download link at the bottom of this description or directly from there : http://www.mediafire.com/file/uoymx2vni249mlu Install the application with Act Editor Installer.exe; if you are missing a .NET Framework you will be prompted to download it. Once you are done, you can start the program from the link on your desktop. Key features The software has many, many features available. It would take too long to describe each one of them, so I've only focussed on the more impotant ones. You can undo and redo everything, scripts included. You can edit and add sounds easily. Powerful and easy to use palette editor. Sprite types have been abstracted - you don't have to worry or care about that. Animation speed can be changed easily. Most components have a drag and drop feature. Advanced scripting engine (C# language). The scripts can also be used to customize the software menus. Error checking when saving the act/spr to avoid invalid files. The sprite version will be automatically downgraded if RLE compression is not available. Frame interpolation (inbetweening/tweening) is possible via the Animation menu. Prompts you with an image converter dialog if the added image is invalid. Allows advanced edition for actions and frames via their respective menus. You can load files from GRFs directly (and save in the GRFs directly as well). Technical stuff Requires .Net Framework 3.5 (SP1) Client Profile to run (3.5 or more will work as well). When prompted with an error, use the "Copy exception" button to copy the debugging info. I will need this to fix the issue you're encountering. The editor's primary window The interface is really straightforward and similar to ActOR. I'll only focus on new elements! Rendering mode : This option changes the behavior of how layers are rendered. If you use 'Editor', you'll clearly see all the pixels when zooming in. If you use 'Ingame', it will use a linear scaling instead, which is closer to what the client does. References : These allow you to know where your item will be positionned (the yellow marker is the anchor, see below). Color mask : To edit the color of a layer, simply click on the color rectangle. You can also drag and drop the colors between different layers to quickly modify many of them. Common shortcuts : You can manipulate layers by using common shortcuts. More can be found from the Edit menu. These below are only the primary ones. Ctrl-A : Select all layers. Ctrl-C : Copy the selected layers. Ctrl-V : Paste the copied layers. Ctrl-X : Cut the selected layers. Alt-C : Copy current action. Alt-V : Paste current action. Advanced action and frame editions These expose all the available methods of the editor. You can remove a range of frames or copy a frame 10 times very quickly and easily. This dialog is found in Action/Frame > Advanced edit... Anchors You can edit anchors from the editor directly. Anchors are points that connect frames together, from different act files. Here's an example without and with anchors : This is mostly useful when you're using reference sprites (on the right panel). Clicking on the anchor button will let you choose where to attach the sprite (this is set semi-automatically for you though). You can edit those from the Anchors menu, but it is recommended to start from a pre-existing act to avoid doing this tedious process. Palette editor The palette editor allows you to quickly recolor sprites with an intuitive interface. Only indexed images can be edited (it's a palette editor after all) and three modes are available. The gradient mode changes an existing gradient to another color while keeping the original saturation and brightness of the colors - this makes the gradients blend in better. If there are no gradient (usually because it's a custom sprite), there's always the Adjust color mode. This one changes all color from a specified range to another one (Photoshop has a similar feature, which does work better). You can click on the image (on the left) to automatically select the palette indexes. These will be highlighted for a few seconds to show you what you're about to edit. Interpolation (tweening) This script can be accessed via Animation > Interpolate frames. This process fills the images between two frames by detecting the changes applied to the layers. Here's a simple example of how it can be used : Script engine The script engine can be accessed via Scripts > Script Runner. This is a big feature of Act Editor, it allows you to automate all your work with the act and much more. Click on the Help button for guides and available methods (don't hesitate to try out a script; if an error occurs the act will be reversed to its previous state). The documentation doesn't cover all of the available options and methods for obvious reasons (the .net framework is huge). Doc example : The language used by the script engine is C#. If you're not familiar with it, simply check out the script samples (Scripts > Open scripts folder)! I won't go into details here, questions can be asked in the support thread regarding addiotional features and methods. If you believe your script should be added in the program, send it to me and I'll probably add it. Customizable The settings dialog allows you to modify all colors in the editor easily. You'll also find the sound resources (GRFs and folders) that can be set up in the Sound tab. The Shell integration tab can associate the .act files with the software to edit them more easily. Don't hesitate to give me a feedbacks or suggestions!
    Free
    1 point
×
×
  • Create New...