Jump to content

GmOcean

Community Contributors
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by GmOcean

  1. - script at_sameip -1,{OnInit:bindatcmd "sameip",strnpcinfo(3)+"::OnAtSameIP";//,99,99,0; // 0 = No log, 1 = Log usageend;OnAtSameIP:freeloop(1);.@size = query_sql("SELECT `account_id` FROM `char` WHERE `online` = '1'",.@acct_id);.@size2 = query_sql("SELECT `account_id`, `last_ip` FROM `login` WHERE `account_id` != '1'", .@aid, .@ip$);while( .@a < .@size ) { for( .@i = 0; .@i < getarraysize(.@aid); .@i++ ) { if( .@aid[.@i] == .@acct_id[.@a] ) { .@tempaid$[.@a] = ""+ .@aid[.@i] +""; .@tempaip$[.@a] = .@ip$[.@i]; } } .@a++;}.@size3 = getarraysize(.@tempaid$);while( .@c != .@size3 ) { for( .@i = 0; .@i < getarraysize( .@usedaids$ ); .@i++ ) { if( .@usedaids$[.@i] == .@tempaid$[.@c] ) { //Account ID already in array. .@used = 1; } } if( !.@used ) { .@usedaids$[( getarraysize( .@usedaids$ ) + 1 )] = .@tempaid$[.@c]; .@duplicateaid$[.@c] = "Account IDs: "+ .@tempaid$[.@c] +""; .@duplicaterid2name$[.@c] = "Character Names: "+ rid2name( atoi( .@tempaid$[.@c] ) ) +""; .@duplicateaip$[.@c] = "IP Address: "+ .@tempaip$[.@c] +""; for( .@i = 0; .@i < getarraysize( .@tempaid$ ); .@i++ ) { if( .@tempaip$[.@c] == .@tempaip$[.@i] && .@tempaid$[.@c] != .@tempaid$[.@i] ) { .@duplicateaid$[.@c] = .@duplicateaid$[.@c] +", "+ .@tempaid$[.@i] +""; .@duplicaterid2name$[.@c] = .@duplicaterid2name$[.@c] +", "+ rid2name( atoi( .@tempaid$[.@i] ) ) +""; .@usedaids$[( getarraysize( .@usedaids$ ) + 1 )] = .@tempaid$[.@i]; } } } .@used = 0; .@c++; }dispbottom "---------------- List of Same IP User ----------------";for( .@i = 0; .@i < getarraysize(.@duplicateaid$); .@i++ ) { if( .@duplicateaid$[.@i] != "" ) { dispbottom " "; dispbottom .@duplicateaip$[.@i]; dispbottom .@duplicateaid$[.@i]; dispbottom .@duplicaterid2name$[.@i]; } }freeloop(0);end;} All you needed to do was just change the sql query to omit the requirement for a map name, and then it'll get data on everyone who is online at the time of the scripts activation. My only concern is that your using rAthena emulator. This means your arrays are limited to 128 elements. A lot more would have to be changed to make it work 100% for you. So, you can just take this edit and have someone over there change it to work with rA's array system
  2. I agree! Begin the purge !! My Disguise Event has lived in that dusty old folder amongst the revisions for long enough lol. It's time to let it die, and give breed to a new era of innovation! ( Besides, I recently updated that script for myself using new standard techniques and replaced the black list with a dynamic function which does the same thing, but never needs to be updated, unless mob_ids go past 32k ). Not to mention, every time I decide to make a new test server, I always head over to script release forums to find a Warper, Healer(+ Buffer), Jobchanger, Stylist,, etc.. that I like. The ones in the revision work, but they don't have that pazazz that newer scripts have since they have just the bare minimum. It's like comparing comparing a 2d game to it's re-mastered 3d version. Just not living up to the expectations. Edit: Except Card Remover. That script is just perfect as it is lol. I say just update this one to the new standard and let it live. Because players just do not make this script at all lol. It's practically 1 of a kind.
  3. GmOcean

    Status Point

    If you disable all of renewal then renewal items will not exist so they become apples to prevent clients from crashing.
  4. @Dastgir - Noted and changed. I'll try to do that from now on lol. Constants for items, are kind of new for me, because I don't think rAthena has them, and I've only recently made the switch to Herc. Edit: Okay, figured out how item constants are listed =P. I'll make sure to use them from now on, atleast in my tuts lol. No promises for script releases Also, for some reason, my scripts won't load when using Direction Constants in a script header :/ Edit: @Haru - Alright, well. For now I'll leave it as numbers, since that's what's working. And I'll change it to the constants once it's been implemented.
  5. Hmm, that does make sense. Alright, since there really is no down side to changing it, I'll go ahead and make those changes D:.
  6. I am definitely going to be setting variables like that in the future, starting with my next script tutorial. I just feel that using " set " as a corner stone for scripting is almost a necessity for helping people understand the process of how to set a variable. This will also help make the shift to the new standard easier imo. It's just that's how I learned, so I figured it'd be easier to teach if they go through the same process. But thank you for letting me know. I guess i'm using a mix of Kernel and K&R style @.@; How mixed I must be lol.
  7. Yes, as Angelmelody showed, that is the proper way to handle your particular situation. However with other concerns where you may be using a make shift loop like the following: L_Loop:.@a = rand(1,6);if( .@a != 2 ){ .@b++; goto L_Loop; }mes "It took you "+ .@b +" tries to roll a 2.";close; You can replace goto L_Loop with 1 of the following. The first example being the correct way. while( rand(1,6) != 2 ) {.@b++}mes "It took you "+ .@b +" tries to roll a 2.";close; OR simply replace goto with callsub .@a = rand(1,6);if( .@a != 2 ){ .@b++; callsub L_Loop; }mes "It took you "+ .@b +" tries to roll a 2.";close; But lastly, if you read the documentation in that link, they did mention a synonym may be provided. Meaning a command which will act like goto " could " be created. The difference is, this will also act like jump_zero as well. So basically replacing 2 commands with 1 command.
  8. First script in the beginner series is complete. Next I'll be moving on to a basic item trader script, that gives players one item in exchange for other items. If you found this helpful to you let me know, if it wasn't, still let me know lol.
  9. Awesome, I've been looking around for one of these. Now I don't have to memorize the process. Just click->search-> read lol. More space in my tiny head to do other things now =P
  10. Script Techniques, Tutorials/Guides well underwant imo D:

  11. Yea, the active and inactive tabs on the client are purely visual. It's to help players decide quests they want to (actively) complete. So they are over whelmed by a lot of quests. They choose have 2 or 3 active. However, this doesn't matter source side. Since even if a quest is inactive, kills and the like, will still be counted. This is the same with 99.9% of all other MMO-RPG games with a questing system. If you have ever played WoW, it's the same way. AION, same thing. Ragnarok Online 2,same thing. So, we should make the changes. Because that is how official works. If we keep what we have, we're just using a make-shift system. Even if it does work.
  12. O.o I didn't know that menu was being removed lmao. In that case I'll switch it around to select. Even though I like using menu in some cases =p
  13. Can't be done unless we know EXACTLY when the monster is going to respawn. In other words you need to edit your monster spawn files so they always spawn on a fixed rate. Then once you provide that information a working command can be written. But i suggest just going the src route and having a command hook into the MVP tomb/graveyard code.
  14. Scripting Tutorials and Guides I'm going to attempt to help everyone here with their scripts while not being directly involved in helping you with them xD. This will also help future/current scripters get some fresh info and maybe inspire innovative ideas towards scripting. So that we can prove that us " Scripters " are the superior ragnarok emulation race! Take that Source Code writers!! Jk lol, we need you too . What I'm going to do, is write detailed tutorials on how to write a few scripts. Starting from the basics to more advanced scripts. This way everyone can follow along. And hopefully this will help everyone understand how to write a few scripts and even troubleshoot their own scripts. Also please read: Scripting Standards. It will help you understand how to read some of the syntax and way people script things. // A list of <sprite id>s can be found here: Sprite_IDs Credits: Ai4rei Scripting Tutorials & Guides In this section you will learn how to write scripts ranging from Complete Begginer Level Scripts ( Me and Some of you ) -> Expert Level Scripts ( Think, Developer Status O.o; ) - Beginner Scripts - Scripts for complete beginners and novice scripters. - Intermediate Scripts - Scripts for intermediate level scripters. If you completed my beginner script series, then you are ready for this section. - Advanced Scripts - Scripts for advanced level scripters. If you completed my intermediate script series and have made a few of your own intermediate scripts, then you are ready for this section. The idea behind this topic, is for new users, and current ones, to have a (second)place they can go to for reference when trying to write a script if they can't figure it out with script_commands.txt file. It will also help people learn how to write scripts. While hopefully, keeping script writing techniques to a ' very ' similar structure! *Read Me* - I have updated the links on this post to link to the oldboard so these guides can be viewed. However, do note that the script_commands.txt links within those guides are no longer accurate. Enjoy your scripting.
  15. This looks amazing. How far along would you say it is towards completion? 20%? 50%? 99% (I hope)? lol. Edit: @Mysterious ( below ) - Yeah, I meant the main page lol. And glad to hear it's so far along
  16. @Zephyr - See, your situation is a matter of just scripting flaw. Instead of determining whether or not to give a player based on whether the quest is active or not, you should be deciding whether or not to give the player the quest depending on whether or not it's complete. for( set @i, 50009; @i <= 50036; set @i, @i +1 ) { if( !checkquest( @i ) && getd("quest_limit"+@i+"") <= 10 ) { // Hasn't obtained quest mes "Do you want to obtain this quest?"; if( select("Yes:No") == 2 ) { close; } setquest @i; } else if( checkquest( @i ) != 2 ) { // Has quest but is unfinished. mes "Do you want to abandon this quest?"; if( select("Yes:No") == 2 ) { close; } erasequest @i; } else if( getd("quest_limit"+@i+"") > 10 ) { mes "You can't do this quest anymore times today."; } else { mes "Congratulations! You fished the quest. Did you want to turn it in?"; if( select("Yes:No") == 2 ) { close; } setd "quest_limit"+@i+"", getd("quest_limit"+@i+"") - 1; // Obtain Reward. erasequest @i; //Erase quest again. if( !getd("quest_limit"+@i+"") ) { setd "quest_limit"+@i+"", gettimetick(2) + (3600 * 24 ); } mes "Quest turned in."; } close;}OnPCLoginEvent:for( @i = 50009; @i <= 50036; @i++ ) { if( gettimetick(2) > getd("quest_limit"+@i+"") ) { setd "quest_limit"+@i+"", 10; }}end;
  17. 3 ways of doing this. 1. Use bindatcmd in combination with Sql table. ( Recommended & Permanent ). 2. Use bindatcmd in combination with NPC variables. ( Temporary & Not-Recommended ). 3. Use bindatcmd in combination with Per-Global variables. ( Permanent & Not-Recommended ). - script playtime -1,{OnInit:bindatcmd "playtime",strnpcinfo(3)+"::OnPlayTime";// 1 = TempVariable | 2 = PermVariable | 3 = PermSQL// Default: 3.mode = 3;end;OnPlayTime:switch( .mode ) { case 1: if( .@atcmd_parameters$[0] == "" ) { .@atcmd_parameters$[0] = strcharinfo(0); } if( (.@size = query_sql( "SELECT char_id FROM char WHERE name= "+ .@atcmd_parameters$[0] +"",.@char_id ) ) ) { query_sql "SELECT lastlogin FROM login WHERE char_id="+ .@char_id[0] +"",.@login$; mes "-------- "+ .@atcmd_parameters$[0] +" --------", ""+ getd(".idlehours"+.@atcmd_parameters$[0]+"") +"hours "+ getd(".idleminutes"+.@atcmd_parameters$[0]+"") +"minutes idle.", ""+ getd(".activehours"+.@atcmd_parameters$[0]+"") +"hours "+ getd(".activeminutes"+.@atcmd_parameters$[0]+"") +"minutes active.", "Last Time Online: "+ .@login$ +"; close; } case 2: if( .@atcmd_parameters$[0] == "" ) { .@atcmd_parameters$[0] = strcharinfo(0); } if( (.@size = query_sql( "SELECT name,char_id FROM char WHERE name= "+ .@atcmd_parameters$[0] +"",.@name$,.@char_id ) ) ) { query_sql "SELECT lastlogin FROM login WHERE char_id="+ .@char_id[0] +"",.@login$; mes "-------- "+ .@name$ +" --------", ""+ getd("$idlehours"+.@atcmd_parameters$[0]+"") +"hours "+ getd("$idleminutes"+.@atcmd_parameters$[0]+"") +"minutes idle.", ""+ getd("$activehours"+.@atcmd_parameters$[0]+"") +"hours "+ getd("$activeminutes"+.@atcmd_parameters$[0]+"") +"minutes active.", "Last Time Online: "+ .@login$[0] +""; close; } case 3: if( .@atcmd_parameters$[0] == "" ) { .@atcmd_parameters$[0] = strcharinfo(0); } if( (.@size = query_sql( "SELECT char_id,idle_hour,idle_minute,active_hour,active_minute FROM playtime WHERE name="+ .@atcmd_parameters$[0] +"", .@char_id, .@idleh, .@idem, .@activeh, .@activem ) ) ) { query_sql "SELECT lastlogin FROM login WHERE char_id="+ .@char_id[0] +"",.@login$; mes "-------- "+ .@atcmd_parameters$[0] +" --------", ""+ .@idelh[0] +"hours "+ .@idlem[0] +"minutes idle.", ""+ .@activeh[0] +"hours "+ .@activem[0] +"minutes active.", "Last Time Online: "+ .@login$[0] +""; close; }}end;OnPCLoginEvent: @login = gettimetick(2); freeloop(1); while(1) { if( checkidle ) { @idle++; } else { @active++; } sleep2 1000; }end;OnPCLogoutEvent:.@idleh = @idle / 3600;.@idlem = @idle % 3600;.@activeh = @active / 3600;.@activem = @active % 3600;switch( .mode ) { case 1: setd ".idleh"+strcharinfo(0)+"", getd(".idleh"+strcharinfo(0)+"") + .@idleh; setd ".idlem"+strcharinfo(0)+"", getd(".idlem"+strcharinfo(0)+"") + .@idlem; setd ".activeh"+strcharinfo(0)+"", getd(".activeh"+strcharinfo(0)+"") + .@activeh; setd ".activem"+strcharinfo(0)+"", getd(".activem"+strcharinfo(0)+"") + .@activem; end; case 2: setd "$idleh"+strcharinfo(0)+"", getd("$idleh"+strcharinfo(0)+"") + .@idleh; setd "$idlem"+strcharinfo(0)+"", getd("$idlem"+strcharinfo(0)+"") + .@idlem; setd "$activeh"+strcharinfo(0)+"", getd("$activeh"+strcharinfo(0)+"") + .@activeh; setd "$activem"+strcharinfo(0)+"", getd("$activem"+strcharinfo(0)+"") + .@activem; end; case 3: if( query_sql( "SELECT * FROM playtime WHERE char_id="+getcharid(0)+"",.@char_id,.@name$,.@ihours,.@imins,.@ahours,.@amins) ) { query_sql "UPDATE playtime SET(idle_hours,idle_minutes,active_hours,active_minutes) VALUES("+ (.@ihours + .@idleh) +","+ (.@iminutes + .@idlem) +","+ (.@ahours + .@activeh) +","+ (.@aminutes + .@activem) +")"; } else { query_sql "INSERT INTO playtime char_id="+getcharid(0)+",name="+strcharinfo(0)+",idle_hours="+.@idleh+",idle_minutes="+.@idlem+",active_hours="+.@activeh+",active_minutes="+.@activem+""; } end;}end;} *NOTE - Completely untested. Just going off of what I can remember. unfortunately I have work, so you may have to rely on someone else to help you if there are bugs *
  18. if( gettimetick(2) < lastTimeTalked ) {mes "You talked recently";close;} else {set lastTimeTalked, gettimetick(2) + ( 3600 * 24 );mes "You may not talk to me again for 24 hours.";close;} I'm assuming you mean something like this? If so, then your problem is you didn't actually set ' lastTimeTalked ' to anything. So, you were trying to check if gettimetick(2) - 0 would be greater than ( 60 * 60 * 24 ) [24 hours]. Which of course it will be since it's a number that goes up every second since 1950? 1960?. At anyrate, as long as you set the variable to current time ( gettimetick(2) ) plus 24 hours, then you won't have an issue.
  19. You, mean uses the same window as Kafra Storage, but doesn't share the same inventory? Like how Storage and Guild Storage work? If so then yes. Since Guild Storage is just a clone of regular storage. It's possible to make a unique storage for each individual character, a storage depending on whether or not you have a variable set to 1 or not. And assuming you have a faction system, you could even create a storage depending on what faction they are in.
  20. O.o What!? They even changed the buttons for Inventory, Party, Booking, Equipment, Skills and such !? Or is that just your skin >.>? Also, yay, lucky roulette button is there. Guess gotta wait longer till we can find the RoDex one D: (Pokedex O.o)
  21. I just wanna suggest that the *explode script command, should push the array size of the one it creates. So that things like this are possible: .@a = 10;while( .@b != .@a ) { .@menu$ = .@menu$ +""+ .@b +":"; .@b++;}.@menu$ = .@menu$ +"Last Option";if( select( .@menu$ ) == ( .@size = explode( .@temp$, .@menu$, ":" ) ) ) { close; } // Clicked Last Option in list. vs what we have to do now: .@a = 10;while( .@b != .@a ) { .@menu$ = .@menu$ +""+ .@b +":"; .@b++;}.@menu$ = .@menu$ +"last Option";explode( .@temp$, .@menu$, ":" );if( select( .@menu$ ) == getarraysize( .@temp$ ) ){ close; } // Clicked Last Option in list. It's not really " needed " more of just a feature I think it should have since commands like query_sql have it. I figure why not give it the extra feature since it's not a downgrade nor does it break backwards compatibility.
  22. GmOcean

    NPC Buy/Sell

    Yeah, sorry, that's my fault, I just copy pasted the table from my sql, and that's what my test server's sql_db table is called.
  23. You mean, have it shout out random headgear names, and then players just type it out as fast as they can? This can be done, but I think i can make it more entertaining or rather more appealing by use of <ITEMLINK> if I can figure out why it doesn't work :/
  24. I completely agree with the removal of those extra values. It's really not needed. Because, I only need to know 2 things, 1) Does Player have quest? Yes/No 2) Is quest Done? Yes/No. Everything else, is a waste of time imo. It doesn't really matter to me if they obtained the quest but aren't tracking it. Because to me, that is purely for their ease. It's like this in almost every MMO ever... 1. You obtain a quest. 2. You either choose to track it ( active ) or remove it from your tracking bar since it's not that important ( inactive ). 3. You kill monsters, talk to npcs, etc.. 4. Your quest get's updated whether your tracking it or not (active or inactive). 5. You turn it in whether your tracking it or not (active or inactive). So again, let's just remove it, not needed D:
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.