-
Posts
1,658 -
Joined
-
Last visited
-
Days Won
67
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by sader1992
-
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 [email protected][0], 100, 200, 300, 400, 500, 600; [email protected] = 100; if(countinarray([email protected][0], [email protected])) mes "The number 100 was found in the array [email protected]"; countinarray([email protected][0], [email protected]); //return 1 because the number 100 is an element of the array [email protected] setarray [email protected][0],100,500; countinarray([email protected][0], [email protected][0]); //return 2 because the numbers 100 and 500 are elements of the array [email protected] setarray [email protected][0],100,700; countinarray([email protected][0], [email protected]3[0]); //return 1 because the number 100 is an element of the array [email protected] //but the number 700 is not an element of the array [email protected] //also you can change the position between the arrays in the command if(countinarray([email protected][0], [email protected][0]) == countinarray([email protected][0], [email protected][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([email protected]=0;[email protected]<getarraysize($account_id);[email protected]++){ if(inarray([email protected],$account_id[[email protected]]) == -1){ [email protected][getarraysize([email protected])] = $account_id[[email protected]]; } } //now [email protected] have all the values without duplication //counting for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ [email protected] = [email protected][[email protected]]; [email protected][[email protected]] = countinarray($account_id,[email protected]); } //now [email protected] have all the values count with the index of the value //the result for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ debugmes [email protected][[email protected]] + " = " + [email protected][[email protected]]; } //burning the array but extracting only the first 3 (less if there is less then 3 in the array) [email protected]_count = min(getarraysize([email protected]),3); while([email protected] < [email protected]_count){ [email protected]++; [email protected] = max([email protected]); [email protected] = inarray([email protected],[email protected]); [email protected] = getarraysize([email protected]_value); [email protected]_value[[email protected]] = [email protected][[email protected]]; [email protected]_count[[email protected]] = [email protected][[email protected]]; deletearray([email protected][[email protected]],1); deletearray([email protected][[email protected]],1); } //end result for([email protected]=0;[email protected]<getarraysize([email protected]_value);[email protected]++){ debugmes [email protected]_count[[email protected]] + " = " + [email protected]_value[[email protected]]; } -
oh i see , line 47 from setd(".m_" + [email protected] + "$[" + getarraysize(getd(".m_" + [email protected])) + "]",getarg(1)); to setd(".m_" + [email protected] + "$[" + getarraysize(getd(".m_" + [email protected] + "$")) + "]",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_" + [email protected] + "$"),strcharinfo(3)) != -1){ i edited the script in the first post
-
prontera,0,0,0 script mvp_kill_count 444,{ copyarray([email protected]$,$MVP_KILL_NM$,getarraysize($MVP_KILL_NM$)); copyarray([email protected],$MVP_KILL_COUNT,getarraysize($MVP_KILL_COUNT)); [email protected] = min(.max_show,getarraysize([email protected]$)); if([email protected] <= 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([email protected] < [email protected]){ [email protected]++; [email protected] = max([email protected]); if([email protected] <= 0) break; [email protected] = inarray([email protected],[email protected]); if([email protected] == -1) break; mes "(" + [email protected] + ") " + [email protected]$[[email protected]]; deletearray([email protected]$[[email protected]],1); deletearray([email protected][[email protected]],1); } end; OnNPCKillEvent: [email protected] = killedrid; if(inarray(.mvp_id,[email protected]) != -1){ if(inarray(getd(".m_" + [email protected] + "$"),strcharinfo(3)) != -1){ if(([email protected] = inarray($MVP_KILL_CID,getcharid(0))) == -1){ [email protected] = getarraysize($MVP_KILL_CID); $MVP_KILL_CID[[email protected]] = getcharid(0); $MVP_KILL_NM$[[email protected]] = strcharinfo(0); } $MVP_KILL_COUNT[[email protected]]++; } } end; function AddMvp { [email protected] = getarraysize(.mvp_id); [email protected] = getarg(0); .mvp_id[[email protected]] = [email protected]; setd(".m_" + [email protected] + "$[" + getarraysize(getd(".m_" + [email protected] + "$")) + "]",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; }
-
[email protected] = 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) + [email protected];
-
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 Kai 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 , slice , sort and rename the image to fit Ragnarök Login Background Drag and drop the image you want on the program , there will be a new folder created Next to the image , data , put it in your GRF Require .Net Framwork 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.0.0
288 downloads
resize , convert , slice , sort and rename the image to fit Ragnarök Login Background Drag and drop the image you want on the program , there will be a new folder created Next to the image , data , put it in your GRF Require .Net Framwork 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,{ [email protected] = #DELAY_ERGHLKJ + 60;//60 seconds if([email protected] < gettimetick(2)){ mes "Try again after " + (gettimetick(2) - [email protected]) + " 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 "[email protected]" var like ([email protected] = killedrid;) and what you want is just math , [email protected] = (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: [email protected]$ = strcharinfo(3);//the killer map. [email protected] = getcharid(1);//get killer party id [email protected]_id = getcharid(0);//save char id for check later if([email protected]){//the player is in a party getpartymember([email protected],1,[email protected]);//get party information char id getpartymember([email protected],2,[email protected]);//get party information account id [email protected] = getarraysize([email protected]);//array size for([email protected]=0;[email protected]<[email protected];[email protected]++){ if([email protected][[email protected]] == [email protected]_id) continue;//this is the killer , skip if(isloggedin([email protected][[email protected]],[email protected][[email protected]])){//is the party member online? if(strcharinfo(3,[email protected][[email protected]]) == [email protected]$){//check the map //the party member is in the same map. //your code here. } } } } end; 2. get players list in the map OnNPCKillEvent: [email protected]$ = strcharinfo(3);//the killer map. [email protected] = getcharid(1);//get killer party id [email protected]_id = getcharid(0);//save char id for check later if([email protected]){//the player is in a party [email protected] = getmapunits(BL_PC,[email protected]$,[email protected]$);//get players in the map for([email protected]=0;[email protected]<[email protected];[email protected]++){ if(getcharid(0,[email protected]$[[email protected]]) == [email protected]_id) continue;//this is the killer , skip if(getcharid(1,[email protected]$[[email protected]]) == [email protected]){//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 -
as I said before , the data are saved in the card slots , you can read the card slot and check out what the return value --------------------------------------- *getequipcardid(<equipment slot>,<card slot>) Returns value from equipped item slot in the indicated slot (0, 1, 2, or 3). This function returns CARD ID, CARD0_FORGE, CARD0_CREATE, or CARD0_PET (for card 0, if the item is produced). It's useful for when you want to check whether an item contains cards or if it's signed. ---------------------------------------
-
Utility: All In One - Random Options Script
sader1992 replied to sader1992's topic in Utility Script Releases
what do you mean by "no effect" ,also post all your config from OnInit to the end; -
random options should be ok, as long as you don't edit the item cards.