-
Posts
1691 -
Joined
-
Last visited
-
Days Won
77
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by sader1992
-
this is a reference for you if(getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) < .day_limit){ .@left = .day_limit - getd("#wqeqwe_" + gettime(DT_YYYYMMDD)); mes "Input how many"; input .@count,0,.@left; delitem .@coin,.@count; getitem .@new_coin,.@count; setd("#wqeqwe_" + gettime(DT_YYYYMMDD),getd("#wqeqwe_" + gettime(DT_YYYYMMDD)) + .@count); end; } mes "You cannot exchange anymore today!"; end;
-
query_sql for the 3 most frequent value in array
sader1992 replied to kilow's question in Scripting Support
for(.@i=0;.@i<getarraysize(.@vtemp);.@i++){ to for(.@i=0;.@i<getarraysize(.@result_value);.@i++){ -
I can see a problem in the code without testing it not sure if there is more , will leave it for you to test
-
most errors break the code most warnings does not break the code if there is a bug , there is a higher chance to abuse it if it was a warning like for example a shop that sell item for zeny less then the sell price you will get a warning , still players can abuse it, if you messed up the shop writing you will get and error and the shop wont work ?
-
query_sql for the 3 most frequent value in array
sader1992 replied to kilow's question in Scripting Support
https://github.com/rathena/rathena/blob/22c7f3988dd0b8f0b8089acb2f1e2cd11ca008ee/doc/script_commands.txt#L2305 --------------------------------------- *countinarray <array name>{[<start index>]},<array name>{[<start index>]}; This command will check for matches between the array values and return the number of matches. While being optional, if [<start index>] is supplied, the search will begin from the given index value. setarray .@array[0], 100, 200, 300, 400, 500, 600; .@variable = 100; if(countinarray(.@array[0], .@variable)) mes "The number 100 was found in the array .@array"; countinarray(.@array[0], .@variable); //return 1 because the number 100 is an element of the array .@array setarray .@array2[0],100,500; countinarray(.@array[0], .@array2[0]); //return 2 because the numbers 100 and 500 are elements of the array .@array setarray .@array3[0],100,700; countinarray(.@array[0], .@array3[0]); //return 1 because the number 100 is an element of the array .@array //but the number 700 is not an element of the array .@array //also you can change the position between the arrays in the command if(countinarray(.@array[0], .@array3[0]) == countinarray(.@array3[0], .@array[0])) //This is true For more details, see the sample in 'doc/sample/inarray.txt'. --------------------------------------- Example: //creating an array with the values with no duplication for(.@i=0;.@i<getarraysize($account_id);.@i++){ if(inarray(.@vtemp,$account_id[.@i]) == -1){ .@vtemp[getarraysize(.@vtemp)] = $account_id[.@i]; } } //now .@vtemp have all the values without duplication //counting for(.@i=0;.@i<getarraysize(.@vtemp);.@i++){ .@v = .@vtemp[.@i]; .@ctemp[.@i] = countinarray($account_id,.@v); } //now .@ctemp have all the values count with the index of the value //the result for(.@i=0;.@i<getarraysize(.@vtemp);.@i++){ debugmes .@ctemp[.@i] + " = " + .@vtemp[.@i]; } //burning the array but extracting only the first 3 (less if there is less then 3 in the array) .@wanted_count = min(getarraysize(.@ctemp),3); while(.@max < .@wanted_count){ .@max++; .@c = max(.@ctemp); .@ndx = inarray(.@ctemp,.@c); .@s = getarraysize(.@result_value); .@result_value[.@s] = .@vtemp[.@ndx]; .@result_count[.@s] = .@ctemp[.@ndx]; deletearray(.@vtemp[.@ndx],1); deletearray(.@ctemp[.@ndx],1); } //end result for(.@i=0;.@i<getarraysize(.@result_value);.@i++){ debugmes .@result_count[.@i] + " = " + .@result_value[.@i]; } -
oh i see , line 47 from setd(".m_" + .@id + "$[" + getarraysize(getd(".m_" + .@id)) + "]",getarg(1)); to setd(".m_" + .@id + "$[" + getarraysize(getd(".m_" + .@id + "$")) + "]",getarg(1));
-
oh I see , when I fixed the warning , I also changed the function call , didn't notice that will update it the fix is from sprintf(mobname, "Mob Name - %s", mob_db(pet_db_ptr->class_)->jname); to std::string temp_name = "Mob Name - " + mob_db.find(pet_db_ptr->class_)->jname; strcpy(mobname, temp_name.c_str()); Thank you for notifying me!
-
on what hash? , I use petstats rAthena Cpp 25_04_2020 on around 1 month old rathena and still work with a small warning for string
-
yes, yes #THQ_DELAY/60 = minutes
-
I already did consider the multi field AddMvp(1785,"ra_fild02","ra_fild03","ra_fild04","ve_fild01","ve_fild02"); to AddMvp(1785,"ra_fild02"); AddMvp(1785,"ra_fild03"); AddMvp(1785,"ra_fild04"); AddMvp(1785,"ve_fild01"); AddMvp(1785,"ve_fild02");
-
replace the line with if(inarray(getd(".m_" + .@id + "$"),strcharinfo(3)) != -1){ i edited the script in the first post
-
prontera,0,0,0 script mvp_kill_count 444,{ copyarray(.@name$,$MVP_KILL_NM$,getarraysize($MVP_KILL_NM$)); copyarray(.@count,$MVP_KILL_COUNT,getarraysize($MVP_KILL_COUNT)); .@mx = min(.max_show,getarraysize(.@name$)); if(.@mx <= 0){ mes "No records found"; end; } if(getgmlevel() >= .gm_level){ switch(select("Skip:Skip:Reset:Skip")){ case 3: deletearray($MVP_KILL_COUNT,getarraysize($MVP_KILL_COUNT)); mes "Done"; end; } } while(.@max < .@mx){ .@max++; .@t1 = max(.@count); if(.@t1 <= 0) break; .@n = inarray(.@count,.@t1); if(.@n == -1) break; mes "(" + .@t1 + ") " + .@name$[.@n]; deletearray(.@name$[.@n],1); deletearray(.@count[.@n],1); } end; OnNPCKillEvent: .@id = killedrid; if(inarray(.mvp_id,.@id) != -1){ if(inarray(getd(".m_" + .@id + "$"),strcharinfo(3)) != -1){ if((.@ndx = inarray($MVP_KILL_CID,getcharid(0))) == -1){ .@ndx = getarraysize($MVP_KILL_CID); $MVP_KILL_CID[.@ndx] = getcharid(0); $MVP_KILL_NM$[.@ndx] = strcharinfo(0); } $MVP_KILL_COUNT[.@ndx]++; } } end; function AddMvp { .@s = getarraysize(.mvp_id); .@id = getarg(0); .mvp_id[.@s] = .@id; setd(".m_" + .@id + "$[" + getarraysize(getd(".m_" + .@id + "$")) + "]",getarg(1)); return; } OnInit: .gm_level = 99; .max_show = 10; //AddMvp(<Monster ID>,<"Map Name">); //AddMvp(<Monster ID>,<"Map Name">); //AddMvp(<Monster ID>,<"Map Name">); end; }
-
.@delay = 600; //delay in seconds , 600 = 5 min if(gettimetick(2) < #THQ_DELAY){ mes "Call in " + gettimestr("%H:%M:%S",21,#THQ_DELAY); end; } #THQ_DELAY = gettimetick(2) + .@delay;
-
My internet was down and I was stuck with my 3g internet which was expensive and slow I needed something to waste my free time xD this is the result Muse Dash is a rhythm game (which i play a lot of) I tried to make something like that in Ragnarok ofc now that my internet is back I won't complete it ? the plan was to create more ways not just up and down , to add bosses etc also to complete the rhythm of the game , but well , who care The song is Punai Punai Taisou (プナイプナイたいそう) (if you like the song , you might like the 2 follow up to the sung , they also called punai punai) here is a clip of gura playing it inside of muse dash
-
it depend on what your #THQ_DELAY is if it's only the time left use this mes "Call in " + gettimestr("%H:%M:%S",21,#THQ_DELAY);
-
you get a warning or an error ?
-
Why MVP Summon with Bloody Branch got less damage
sader1992 replied to Krit TH's question in General Support
Maybe the problem is that specific map you are in while testing bloody branch does not edit the monsters it spawn. -
Utility: All In One - Random Options Script
sader1992 replied to sader1992's topic in Utility Script Releases
the short answer is no the npc config allow you to sort out the options for the equipment , however the UI is the list of what the player is wearing while talking to the npc , similar to the refine npc , so the player cannot choose an equipment in his inventory , he must equip it, and he will see one option for left hand and one option for right hand , he wont see one option for weapon and one option for shield. -
View File Ragnarök Login Background Generator resize , convert and slice the image to fit Ragnarok Login Background Drag and drop the image you want onto the exe application. Do not double click the application, just drag and drop the image onto the application. A 'data' folder will be created next to the image (not the application unless they are in the same folder). You can add that folder as it is in your '.grf' file. This application requires .Net Framework 4.7.2 I know there is other tools, however it didn't work for me, and I am bored of debugging every time I want to create a login background ? Source Code: https://github.com/sader1992/Sader-Ragnarok-Login-Background https://sader1992.com/ Submitter sader1992 Submitted 10/07/2021 Category Client Tools Video Content Author sader1992
-
Version 1.2.0.0
1495 downloads
resize , convert and slice the image to fit Ragnarok Login Background Drag and drop the image you want onto the exe application. Do not double click the application, just drag and drop the image onto the application. A 'data' folder will be created next to the image (not the application unless they are in the same folder). You can add that folder as it is in your '.grf' file. This application requires .Net Framework 4.7.2 I know there is other tools, however it didn't work for me, and I am bored of debugging every time I want to create a login background ? Source Code: https://github.com/sader1992/Sader-Ragnarok-Login-Background https://sader1992.com/Free -
prontera,0,0,0 script delay 444,{ .@t = #DELAY_ERGHLKJ + 60;//60 seconds if(.@t < gettimetick(2)){ mes "Try again after " + (gettimetick(2) - .@t) + " seconds"; end; } #DELAY_ERGHLKJ = gettimetick(2); mes "Hello!"; end; } #ACCOUNT_VARIABLE
-
Check if party member is same map with the mob killer
sader1992 replied to Eross's question in Scripting Support
as a start do not use addrid and do not set the exp variable , use getexp command , and you can provide the char id to it so player attaching is not needed and this is wrong (.mobid = killedrid;) , just use it as it is or set it to ".@" var like (.@mobid = killedrid;) and what you want is just math , .@exp = (original_exp/100)*70; -
*getmapunits(<type>,<"map name">{,<array_variable>[<first value>]}) NOT *getmapunits(<type>,<array_variable>,<"map name">)
-
Check if party member is same map with the mob killer
sader1992 replied to Eross's question in Scripting Support
there is 2 ways i can think of 1. get party information OnNPCKillEvent: .@m$ = strcharinfo(3);//the killer map. .@pid = getcharid(1);//get killer party id .@char_id = getcharid(0);//save char id for check later if(.@pid){//the player is in a party getpartymember(.@pid,1,.@cid);//get party information char id getpartymember(.@pid,2,.@aid);//get party information account id .@size = getarraysize(.@cid);//array size for(.@i=0;.@i<.@size;.@i++){ if(.@cid[.@i] == .@char_id) continue;//this is the killer , skip if(isloggedin(.@aid[.@i],.@cid[.@i])){//is the party member online? if(strcharinfo(3,.@cid[.@i]) == .@m$){//check the map //the party member is in the same map. //your code here. } } } } end; 2. get players list in the map OnNPCKillEvent: .@m$ = strcharinfo(3);//the killer map. .@pid = getcharid(1);//get killer party id .@char_id = getcharid(0);//save char id for check later if(.@pid){//the player is in a party .@size = getmapunits(BL_PC,.@m$,.@name$);//get players in the map for(.@i=0;.@i<.@size;.@i++){ if(getcharid(0,.@name$[.@i]) == .@char_id) continue;//this is the killer , skip if(getcharid(1,.@name$[.@i]) == .@pid){//check the party id //the party member is in the same map. //your code here. } } } end; -
buildin_dispbottom: fatal error ! player not attached!
sader1992 replied to DEsMOn's question in Scripting Support
Use "end;" before "OnCommand:" from hideonnpc "Barricade#B16"; OnCommand: to hideonnpc "Barricade#B16"; end; OnCommand: AND hideonnpc "AB Buffs#AB4"; OnCommand: to hideonnpc "AB Buffs#AB4"; end; OnCommand: this will fix the dispbottom error