Jump to content

GmOcean

Members
  • Posts

    666
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by GmOcean

  1. To clean a single value in an array use: cleararray .@arrary[1],0,1; OR set .@array[1],0; Either one of those will work, additionally, you can use copyarray to simply move values [2]->[127] down 1 thus, replacing [1] with [2], technically this removes [1]'s orignal value, but keeps the array in tact if you needed to add stuff to the end of the file. But the quick solotions i give in the code.
  2. Lol, i looked at one of the posts, that WhiteEagle linked, and it seems, i was given credit for a WoE setter lol. I'm flattered, but I must point out, it was GmXeon and not me lol. I didn't create one, since at the time Toasty's was working splendidly. And now Euphy's has taken that position. And frankly i just don't feel the needed to replicate a script to duplicate it's functionality when it is already working as is intended.
  3. @Topic Starter - Umm, I just want to point out, that I don't remember making any WoE Setters lol... I think you may be referring to GmXeon ...So you should give him credit lol..
  4. Lol, cuz i wrote it from my phone @.@; normally when i reply to requests, or support, i double check the functions of script commands, but meh, too slow internet to bother going to the svn location lol. So i just wrote what i knew off hand 100% lol. Edit: Updated the script for item_id fixes and jobname() suggestion lol. Edit2: I keep looking back at everyone's scripts using switch(select); I just can't bring myself to use it lol, i like menu, even though switch(select) is better in the long run for eliminating the use of Labels, and much more.
  5. Well, in regards to your global variables, you can remove all of those, an replace them with .variables then, when you need to call them for information, just use, getvariableofnpc(); however, do note, that, it will get a little confusing, as each npc does have it's own .value for the variable, so you just need to make sure you ping the correct npc when using the command. And you wouldn't need to change them asap, just little by little... i unfortunately had over 1thousand $(@)variables in use at the time, since i was using everything with set/getd. This just means i had a $var for each character involved at the time, i also didn't do the proper measures to make sure they were erased when they were no longer needed. Lastly as an alternative to .variables and using getvariableofnpc(); you can also just use, setd/getd to store the information into perm-char variables, if they need to be perm. e.g: setd "variable"+ getcharid(0) +"",123; getd("variable"+ getcharid(0) +""); This efficently stores the information in a variable UNIQUE to the character, since part of the variable has the character's ID_num as it's name. This way, you know, no other person can access the data stored in another's variable. (Unless they hacked his/her account lol).
  6. mapname,x,y,z script npcname 123,{ set .@jobs[0],0,1,2,3,4,5,6,7,8,9,10; //Add more jobs as needed. set .@req,3; mes "Welcome, I can change your appearance, from one job to another."; mes "Example: AssassinCross look like an Archer."; for(.@i,0; .@i<(getarraysize(.@jobs); .@i++){set .@menu$,.@menu$ + jobname(.@jobs[.@i]) + ":";} menu .@menu$,-; if(countitem(7227) < .@req){next; mes "Not enough TCG"; close;} delitem 7227, .@req; setlook(0,.@jobs[(.@i-1)]); end; } Btw, I don't really remember what the itemID of TCGs are, but something keeps telling me it's 7091 lol. If i'm wrong just edit the script and change those entries to the correct item_id. Edit: updated item_ids to 7227 & to use jobname (suggested by Euphy).
  7. Okay, so you want an NPC which basically makes your character look like another character or did you want to turn them into a monster?
  8. That's because, those variables, are not just regular vars, they are arrays. for( set .@i,0; .@i<3; set .@i,.@i+1){ mes "======================="; mes "Top "+ ( .@i + 1 ) +" Blacksmith"; mes ( .@i + 1 ) +". "+ .@name$[.@i] +" with fame of: "+ .@fame$[.@i] +"."; mes "=======================";} close; Edit: Also, i could have sworn, ' fame ' was stored as an integer in the sql_db. So, I really don't think you need to have stored into a str_variable. So, your sql_query should look like this: query_sql "SELECT `fame`,`name` FROM `char` WHERE `fame`>0 AND (`class`='10' OR `class`='4011' OR `class`='4033' OR `class`='4058' OR `class`='4064' OR `class`='4100') ORDER BY `fame` DESC LIMIT 0,3", .fame, .name$; The reason, i used .variables, is because you also said you wanted to give these players a bonus of 3 luk or w/e. So we'd need to be able to get this information. a .@scope variable, would dissapear as soon as the script ended. For getting the bonuses, i suggest, you use the NPC to do it, for a set time, such as give the stats to those who are #1-3 for 1day, then check for the new people lol. OnInit: //Just let it run to the next label =P donpcevent "npcname::OnFameLoop"; OnClock0000: query_sql "SELECT `fame`,`name` FROM `char` WHERE `fame`>0 AND (`class`='10' OR `class`='4011' OR `class`='4033' OR `class`='4058' OR `class`='4064' OR `class`='4100') ORDER BY `fame` DESC LIMIT 0,3", .fame, .name$; end; OnFameLoop: freeloop(1); while(1){ if( attachrid( getcharid(3, .name$[0]) ){ bonus bLuk,3; detachrid;} if( attachrid( getcharid(3, .name$[1]) ){ bonus bLuk,3; detachrid;} if( attachrid( getcharid(3, .name$[2]) ){ bonus bLuk,3; detachrid;} } end; In regards to the looping for bonuses, yea, it's pretty bad, i know, but unless you use a src edit (which is already out: Extra Bonuses), almost all scripts like this are gonna be costly.
  9. Well, at my I'm at work, so I can't really go looking through my sql files. But, there is a database which stores ranking information. So try and run a sql query for the information and store it like that. eg: query_sql( "SELECT * FROM 'table' ORDER BY DESC LIMIT='3'",.@char_id,.@ranking); Something like that, I'd be able to help more when I get home.
  10. That's not too hard, all the information needed is stored in the sale files if I'm not mistaken. The only tricky part is giving them the bonus indefinitely. But this is only because rA's current script engine will make those bonus reset upon adding stats. But thankfully we have freeloop() command. So we can just do: freeloop(bonus bLuk, 3;);
  11. @Euphy - I do know that is a possibility, however, I was merely trying to solve his !variable use lol. Also, i would normally use ( == " " )
  12. You could however do something like this: if( !axtoi(#AccountPW$) ){do blah;} OR set .@var,axtoi(#AccountPW$); if(!.@var){do blah;} That'll turn your string into an interger, by assuming its a Hex value, this way, any Alpha-numeric combinations will be accepted, vs atoi (which only accepts strings consitant of only numbers). Edit: NVM, that wont work lol.. just realized hex only has A->F as letters lmao, but you CAN do this: if( !getstrlen(#AccountPW$) ){do blah;}
  13. In short, you don't really need to worry too much about using perm-char variables. But watch out for too much #variables($) & $variables($) as these will slowly start to eat your server...(I learned the hard way, but Annie saved me before it was too late =P).
  14. It attaches the accountID, however the player currently logged in is the one affected. Besides, killerrid & killedrid = acct_ids
  15. Well, all in all, there is no need for OnPCDieEvent, since in an OnPCKillEvent, both killerrid & killedrid are both character IDs (That is before you activate a sleep command, and let another instance run thus changing the id). So leave it as it may, you can simply just use attachrid(killerrid) & attachrid(killedrid) to do each labels task respectively. Edit: Btw, are the killerrid & killedrid labels still backwards as ever? e.g: killedrid = killer | killerrid = killed Atleast i know in eAthena that was the case, not sure if it still is here. In which case I say, change around lol, because if it is the way it was in the past it's so confusing @.@;
  16. Okay then, let's assume the function is working properly. That being said, your variable .RaiftMap$[ ] and .RiftRank[ ], those ARE apart of the same NPC right? Becuase .variables are npc specific unless you use the command ' getvariableofnpc '. And if that's not the issue here, do you have any errors on your map-serv? But, all in all, i can't do a 100% check of this script since i'm using my phone, and well, i don't really have an RO emulator on here lol.
  17. Well, what is this, ' getRank_() ' command i keep seeing you use? I'm fairly certain that's not part of rA's svn, so is it a custom command or is that supposed to be a variable array. In which case your syntax is wrong, and it should look like this: ' getRank_[ ] ' but that's assuming it is indeed a variable array, and not a custom command.
  18. My only guess is that perhaps the OnPCKillEvent & OnPCDieEvent work the same as the variables in getpartymember. In other words, the label runs each instance one by one. If this is the case, then your sleep, command is basically telling the script instance behind it to do its thing. Thus screwing up information and whatnot. But this is only just speculation, but for debugging sake, remove your sleep2 commands and see if you still have a problem.
  19. rid2name(killerrid); rid2name(killedrid); As for the actual label... I can't remember if either killerrid or killedrid is attached to the script right away. But that would only help determine if your use of sleep2 was correct. As for your script not working, can't help you there if you don't show us the script.. After all, we're not mind readers.
  20. Thanks for this lol. I had managed to get it to work for a players name, but for the life of me couldn't figure out how for player id lol.
  21. Sorry, if you look there's an extra 't' in that command, sticky keys ¬.¬; as for the rest of the script... You have to complete the question without logging out. If you do logout you'll have to start over. I could write it better to not use any player variables or temp variables, but that makes it a bit more complicated for you to configure. As it is now, it'll work fine.
  22. mapname,x,y,z script quest_warp 45,2,2{ if(!variable_A){dispbotttom "You have not done the quest to enter yet. Talk to NPC A to start the quest."; end;} warp "mapname",x,y; end; } mapname,x,y,z script NPC A 89,{ if(variable_A){dispbottom "You have already one this quest."; end;} if(@v_{set variable_A,1; mes "You can now use the warp"; close;} set @v_a,1; mes "Talk to NPC B to further the quest."; close; } mapname,x,y,z script NPC B 89,{ if(!@v_a){mes "Speak to NPC A first"; close;} if(countitem(512)){set @v_b,1; mes "Talk to NPC A to finish the quest."; close;} mes "Bring me an Apple"; close; }
  23. Yea, i'm not very good with src edits at all (Complete noob)... But what i'm requesting is fairly simple for those who do understand. I would just like the npc commands: percentheal & heal to be modified to support an optional parameter of char_id OR char_name. Also, I have no idea why they weren't coded like this to begin with, since it's kind of a hassle to attachrid's just to use these commands, if we were to use them outside of 1click healers/buffer npcs...but i dunno, just my 2cents. percentheal <hp>,<sp>{,<"char_name">}; percentheal <hp>,<sp>{,<char_id>}; heal <hp>,<sp>{,<"char_name">}; heal <hp>,<sp>{,<char_id>}; granted i do know the same could easily be done by using atcommand <command> <char_id/name>; I'd prefer to use only script commands in a script if at all possible, since atcommands in a script (to me atleast) seem like using god-mode cheats while trying to beat a game lol. With the exception of scripts that enable/disable commands for w/e purposes.
  24. Well, it wouldn't be TOO difficult at all really. Just have an NPC register both parties. Then create an instance with one of the 2parties when they both meet a certain criteria, let's say atleast 5people in each party for arguments sake. After creating the instance, warp both parties to the instance, and then lock the warp so that no one can just reenter, upon death warp them out and count 1 less person. When 5 people from 1 team dies, then that'll be it. Warp out, delete instance. Rinse and repeat.
  25. You know, you don't need other people to test it for you... just try running it in your sql, and if its correct, it'll run and finish, if it's not, it will show you an error, and nothing will change.
×
×
  • Create New...