Jump to content

Ryokem

Members
  • Posts

    205
  • Joined

  • Last visited

Everything posted by Ryokem

  1. I can't remember SQL tables used, but I believe you can simply query the IP to get it, if that command is broken.
  2. You want to modify the current refiner NPC or create a custom NPC for this matter?
  3. Ryokem

    [Rank] MvP

    I honestly don't really like how that script is written. In the MvPRank function, you are trying to build up a script-based ranking without facing position swaps or referals. If it is of just 1 variable, I'd just run a query_sql command to get the ranking positions, there should be an example of exactly what you need in the script_commands.txt file, under the query_sql command explanation. About the variable being resetted, I honestly didn't find anything that actually resets it. Try to check if you have some other scripts that may use the same variable.
  4. each part of the header are separated by tabulations (made with the TAB key) and not spaces. TAB is the key above the CAPLOCK one.
  5. Refering to this thread, don't forget to add proper tabulations in the header.
  6. The script seems fine. Be sure you have added the proper tabulations in the header.
  7. Add a restriction list as NPC-array in a OnInit event label: OnInit: setarray .restrictedMaps$[0],"prontera","your_map",[...]; Add a check at the very beginning of your script after the NPCKillEvent label call: OnNPCKillEvent: for( .@i=0; .@i<getarraysize(.restrictedMap$); .@i++ ) if(strcharinfo(3) == .restrictedMaps$[.@i]) end; if($@CPc && (getgmlevel() < $@CPgm0)) { //[...]
  8. prontera,147,171,3 script IRO Freebies Giver 509,{ mes "[^000088 Freebies Giver ^000000]"; mes "Hello "+strcharinfo(0)+", Welcome To Infinite-RO."; mes "I'm the freebies giver."; mes "I only give 1 freebies per account and can be use by this character only."; next; mes "[^000088 Freebies Giver ^000000]"; if(#freebies) { mes "You already have your freebies."; close; } if (select ("Please Bless me:I Change my mind") == 2) { Mes "Come back for my Blessing"; Mes "Thank you"; close; } else { set #freebies, 1; getitem2 2357,1,1,7,0,0,0,0,0; // +7 valkarmor getitem2 2524,1,1,7,0,0,0,0,0; // +7 valkmant getitem2 2421,1,1,7,0,0,0,0,0; // +7 valksh getitem2 2102,1,1,7,0,0,0,0,0; // +7 Guard[1] getitem2 2115,1,1,7,0,0,0,0,0; // +7 Shoes[1] getitem 4174, 2; getitem 4302, 2; getitem 4142, 3; mes "[^000088 Freebies Giver ^000000]"; mes "Enjoy your Gifts."; close; } end; //Should never happen OnInit: waitingroom "WELCOME",0; end; }
  9. mes "15 Heroic Quest Token = 1 Sacred Token(20001)";\ There is an unknown \ at the end of this line
  10. I'm not really updated about Athena, but you can try to remove the "E.G" part in every variable check call. if( #quest_done ) { set #quest_done, 1; Also, your freebies, even if divided by "Strengh, Dexterity and Intellect Type", give all the same items (you may need to check thi
  11. My bad about that then, but Kenpachi said it correctly:
  12. You mean the variable player_point stay the same ? player_point -> 0 set player_point, player_point++; -> 0 ? Coz that's not true Actually, he is correct speaking about the instance scope. But you are correct as well, because the variable check is located in another scope. a = 1; b = a++; //b stores 1, not 2. a = 1; b = ++a; //b stores 2 That's what Kenpachi means. During the execution command, a "var++" command is executed after the scope of the command it is located. Practically, as it is the same variable you are using, it makes no difference but to set an unneeded command; otherwise, if you work with more than 1 variable, it may land out in weird errors. set a, a++; //Is equal to: set a, a; a++; It's really long I don't script for Ragnarok Online, so I don't really know if OnHit actually is a viable On-label event or not, what it does or if you recall it through a onevent command. Just remember that each time you click on the NPC, you get your variable resetted. So, to trigger the getitem thing, you need to activate the "OnHit" label 5 times without clicking on the NPC. Also, the L_change label is pretty much useless 'cause you jump in there in any case. payon,111,110,5 script Crazy Man 757,{ set player_point, player_point==0; //I don't know if you need a reset here... but well... OnHit: player_point++; if( player_point == 5 ) getitem 999,1; dispbottom "..."; end; }
  13. What about to use sc_invincible instead? I find it more practical.. sc_start sc_invincible 60000; Edit: I hope that bonus wasn't been nerfed or deleted.
  14. What do you mean by "costume"? If you mean cloth-changing, such as Santa Suit or other custom suits, refer to Checkoption. If you mean to check if there is an item equipped on a certain slot, refer to Getequipid. Tip: getequipid() is a function that needs a certain argument to work. You can find the list of possible arguments in the wiki page I linked above. Tip2: to check if the slot is empty (nothing is equipped), just check if the function returns -1 or not. if( getequipid(2) == -1 ) { mes "You are not wearing an Armor!!"; } About the input command, try not to use permanent player-attached variables to store your input, but just set them as Scope. input .@low_head; // OR, if you need to attach it to a player input @low_head;
  15. You can optimize this part just by using attachrid. A little bit more tricky, but helps saving heap and lowers the C-O (credits to you) input .@tmp$; set .@MyID, getcharid(3); if( !attachrid(getcharid(3,.@tmp$)) ) { mes "Char is offline or not exist"; close; } set .@value, ABCDEFG; attachrid(.@MyID); mes .@tmp$ + "'s ABCDEFG variable has value: " + .@value;
  16. The area is based on where the npc is located. prontera,100,150,0 script Summoner -1,2,2,{ OnTouch: the "2,2" after -1 script means that you're gonna trigger the OnTouch even label when a player walks into a 5x5 square centred at prontera 100 150. So basically, X: 98~102, Y: 148~152. Changing the "2,2", will increase/decrease the area. 1,1 -> 3x3 area around where the npc is located. 2,2 -> 5x5 3,3 -> 7x7 And so on. OnTouch: //Prevent to summon if a monster is already summoned or before 30 minutes if( .isSummoned ) end; .isSummoned = 1; getmapxy .map$, .@x, .@y, 0; monster .map$, .@x, .@y, "Summoned Monster", 1952, 1, strnpcinfo(0) + "::OnMonsterDead"; initnpctimer; end; //10 minutes... OnTimer600000: killmonster .map$, strnpcinfo(0) + "::OnMonsterDead"; end; //Reopening the event after 30 minutes OnTimer1800000: stopnpctimer; .isSummoned = 0; end; Note that the part of not being able to summon in 30 minutes can be easily done with gettimetick() as well, but as I started a timer for killing it, I prefered to keep using that timer.
  17. This should work, why replacing it? bc_map already sent the broadcast to the map the atteched character is... EDIT: How I could know he had this sort of script lol? he asked for how to announcing in 1 map only
  18. I don't think you can do it without source modifications
  19. Also, assuming you want to use setd/getd for other reason, lemme explain how to do it properly, 'cause the way you did is wrong. setd / getd dynamically recall the name of a variable. This means that the variable name must be the argument of those functions. Example: Here you have an array of N elements, and you want to set all N elements to 1; (Don't answer with "there are more efficient methods to do this", I know there are, I'm just showing how setd/getd works). set .@array[0], 1; set .@array[1], 1; //[...] set .@array[N], 1; Let's use setd for( .@i = 0; .@i < N; .@i++ ) setd ".@array[" + .@i + "]", 1; The same thing goes for getd. if you want to recall index 9 of .SummonType array, all the array name and index is the "variable name", so must be everything inside getd argument. set .@i, 9; mes "Your array has value: " + getd(".SummonType[" + .@i + "]") + " in index 9."; It's obvious that not only munbers can be built into setd/getd function, but also the variable names themselves. set $@pikachu, 2; //The same as... set .@temp$, "@pika"; setd "$" + .@temp$ + "chu", 2; Hope it helped
  20. Refer to Mapannounce //announcing in prontera only mapannounce "prontera", "Broadcasting to prontera only!", 0;
  21. Still wondering why people on the net are so selfish and look only at themselves, raging to whoever correct them, because they loose fame. Wow.

  22. I like an explanation to this ... What's so hard to understand? set .@rand, rand( 20+50+60 ) ; Will randomize a number from 0 to (20+50+60)-1. Are you fine with this? else if ( .@rand < 20+50+60 ) .@rand is OBVIOUSLY < (20+50+60) because its range goes from So you are just using server memory to check something obvious. Then, just use else, instead of else if, as there no need to check the obvious. Is this really so difficult to understand? O.o
  23. I meant like this - script asdf -1,{ Onasdf: set .@rand, rand( 20+50+60 ); if ( .@rand < 20 ) { getitem "gold_coin", 2; announce strcharinfo(0) +" has earn gold coin x2", bc_all; } else if ( .@rand < 20+50 ) { getitem "poring_coin", 5; announce strcharinfo(0) +" has earn poring coin x5", bc_all; } //else if ( .@rand < 20+50+60 ) { //Your version. else { set zeny, zeny + 50000000; announce strcharinfo(0) +" has earn zeny 50,000,000", bc_all; } } 'Cause you will 100% fall in that case if it jumps to that else. So no need to do the if (.@rand < 20+50+60 ) check
  24. I was trying to do this years ago. However it's not optimized and query_sql will really simplify and speed up everything, that's a sample of what I planned years ago (also, when my scripting abilities were not great.) First, I was saving all the players IDs into an array each time they log in, and deleting them each time they log out. OnPCLoginEvent: set .PeopleOnline[getarraysize(.PeopleOnline)], getcharid(0); //... OnPCLogoutEvent: set .@tmp$, strcharinfo(0); for( .@i = 0; .@i < getarraysize(.PeopleOnline$); .@i++ ) if( .@tmp$ == PeopleOnline$[.@i] ) { deletearray PeopleOnline$[.@i], 1; break; //Useless to keep the for loop } Second, I looped all the online players to check whoever was in that map. then, I save players into a temporary array //Save my AID set .@myAid, getcharid(3); for( for( .@i = 0; .@i < getarraysize(.PeopleOnline$); .@i++ ) { attachrid(getcharid(3,.PeopleOnline$[.@i])); //Actually it shouldn't be necessary an online check for obvious reason. if( strcharinfo(3) == "Your_map" ) set .@array$[getarraysize(.@array)], .PeopleOnline$[.@i]; } //Attaching back my RID attachrid(.@myAid); //There, maybe a check should be added. So, you now have .@array$ array that has stored the names of who is in "Your_map" map. So you can choose one randomly... set .@randomPlayer$, .@array$[rand(getarraysize(.@array$))]; dispbottom "You randomly selected " + .@randomPlayer$;
  25. What's the point of this? .@rand goes from 0 to (20+50+60)-1, it's obvious that its lower than (20+50+60) xD You added an useless check. Just like this will be enough set .@rand, rand( 20+50+60 ); // [...] else { //Do stuff }
×
×
  • Create New...