Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/31/18 in all areas

  1. How to use *addrid script command properly Method 1: Exploits its multi-concurrent run -> use *addrid right before ending the script addrid will run multiple instances equal to number of player attached, which, not entirely a bad thing when use properly, as shown below, don't have to use loop prontera,155,179,5 script kickall 1_F_MARIA,{ if ( getgmlevel() < 99 ) end; mes "I will kick all players after this dialog close"; mes "Exclude: autotrader, GMs, wondering in town."; close2; addrid 0; if ( getgmlevel() >= 60 ) end; // don't kick GMs if ( checkvending() & 2 ) end; // shouldn't kick @autotraders if ( getmapflag( strcharinfo(3), mf_town ) ) end; // doesn't kick anyone in the town atcommand "@kick "+ strcharinfo(0); end; } Method 2: Get all the RID in an array -> use donpcevent as calling a function, within that label, store the account IDs the preferred method, this method is safe from running multiple instances prontera,155,182,5 script getallusers 1_F_MARIA,{ donpcevent strnpcinfo(0)+"::OnGetAID"; // treat this as calling a function to get online player's account ID for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 0; .aid[.c++] = getcharid(3); end; } - script getallmap HIDDEN_NPC,{ end; OnTest: donpcevent strnpcinfo(0)+"::OnGetAID"; for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 5, 0, "payon"; // only attach to everyone inside payon map .aid[.c++] = getcharid(3); end; OnInit: bindatcmd "test", strnpcinfo(0)+"::OnTest"; end; } guild_vs2,0,0,0 script getareausers HIDDEN_NPC,{ end; OnTest: donpcevent strnpcinfo(0)+"::OnGetAID"; for ( .@i = 0; .@i < .c; ++.@i ) announce (.@i +1)+". "+ rid2name(.aid[.@i]), bc_all; end; OnGetAID: .c = 0; addrid 4, 0, 46, 46, 53, 53; // attach everyone in the map 'guild_vs2' of (46,46,53,53) area .aid[.c++] = getcharid(3); end; OnInit: bindatcmd "test2", strnpcinfo(0)+"::OnTest"; end; }
    2 points
  2. Story Time: A lot of players run into problems. They disconnected in an instance, they bought the wrong item, someone is being a nuisance in battlegrounds. After cursing, they usually type `@request`. But alas, none of the GMs you hired are online! You need to dock their pay. The message is lost in the void. Until now. Discord has support for webhooks, which is a way to associate callbacks to HTTP requests. Their developer docs for webhooks can be found here. Basically, you can send a POST to your discord webhook url, and the contents will be printed to the associated channel. "So?" When someone uses `@request`, the message is sent from the map server to the character server, which then sends it back to all map servers, and the map servers send the message to all connected GMs. Because it sends it to the character server, we're able to send the POST request from the character server. This helps performance, since the map server is constantly doing things and the character server generally uses less resources. "That's great! But how do we send this POST request? Do I need a stamp?" If you're on Linux, there's a great command line tool called `curl`. It's mostly used to download files from a server, but it also has support for all other HTTP methods. "Command line? How do we put it in rathena?" Curl also comes with a library called libcurl that we can use in c/c++ programs! "I see, so we use libcurl to send the message to the discord webhook!" Exactly! How it looks: Installation: Two config options are added in this patch: gm_whisp_webhook and gm_whisp_webhook_url This makes a change to configure, and adds a new flag. You need to add --with-lcurl to your arguments. Example: ./configure --enable-prere --enable-vip --enable-packetver=20170614 --with-lcurl Disclaimers: This only works on linux. I don't run rAthena servers on windows, and neither should you. (personal opinion) You need to install libcurl-devel. On some OSes it could be called something else; on Ubuntu, it's libcurl4-openssl-dev. Don't ask me for a lot of help if you can't get it to work. This is supposed to be a showcase, but I'm giving the code out. I made this in a day, it's not the greatest code. Initializing curl and cleaning up on every call is not the greatest, but unless you are getting 100 requests a minute, it should be ok for now. Eventually, I want to add it to src/common or something. But that'll happen in a future weekend. Code: The code is here: https://pastebin.com/Z82M9ssf
    1 point
  3. Version 1.0.0

    235 downloads

    Apply the patch manually These commands allow you to create duplicates at run time. duplicatecreate("sourcename", "targetnameshown", "targetnamehidden", "targetmap", targetx, targety, targetdir{, targetspriteid{, targetxs, targetys}}); duplicateremove("npcname");
    Free
    1 point
  4. The topic has been removed because of rAthena staff double standards and hypocrisy things. (rA staff blame me that I made a money on this topic while it's not and never was) All that I did for the last 2.5 years with around ~1k answers from my side is help for free for newbies here, but to rA staff, my topic is a pain in the ass. Sorry guys, but the topic can't be maintained on such a community anymore because of its admins. Bye
    1 point
  5. Transitioning from SVN to GIT While switching your server to GIT may sound like a daunting task, it's relatively simple and straightforward, even for servers with heavy modifications. We strongly encourage you to do so, since our primary efforts will now be directed towards our repository on GitHub. Simply follow the steps listed below, depending on your OS: Windows Instructions Linux Instructions Conflicts It's possible that you'll run into conflicts along the way, with messages such as: When you see these messages, a conflict in merging your code occurred. Much like resolving code conflicts in SVN, these conflicts create points within the files which show your code compared to the code pulled from the remote repo. To fix them, open your files and find the conflict locations denoted by: Then you can choose which piece of code you wish to keep. After all shown conflicts are corrected, you can continue your normal update process. References Setting your email in git How do I resolve git saying "Commit your changes or stash them before you can merge"? CONFLICT (content): Merge conflict in Credits to @Akinari for writing a good part of this guide.
    1 point
  6. I make a continuation of this topic this topic mainly concern about unpopular but useful scripting techniques ... should wiki this up someday Randomize item reward Method 1: use F_Rand function. Method 2: use temporary variables. Method 3: use array. Method 1: use F_Rand function Method 2: use temporary variables Method 3: use array sigh ... I seriously need someone to make the english better, my explanation always sux any staff member here feels like can make this topic better, please do so
    1 point
  7. find close2; ... add announce strcharinfo(0) +" has join blah blah", bc_all;
    1 point
  8. https://github.com/rathena/rathena/blob/master/db/castle_db.txt there are 20 first edition castles ... you mean like each castle open randomly ... but only loop back every 20 days ? sounds like need a shuffle algorithm to do this . so which castles are chosen ? only the 1st edition castles ? but since you say all castles that would include novice castles and third edition castles
    1 point
  9. By "update your server files" he meant to alter your defines_pre.h file to set a PACKETVER appropriate for the client you're using. Let's say you are using a 2016-04-16 client, then you should modify src\custom\defines_pre.h: Just above #endif // _CONFIG_CUSTOM_DEFINES_PRE_H_ Add: #define PACKETVER 20160416 Set the number according to your client. Then, recompile the rAthena solution. You may refer to this post if you are looking for additional information regarding PACKETVER.
    1 point
  10. I think the FTP is the same but the patch list address changed for sure. Won't patch last week or this week updates.
    1 point
  11. kRO updated their FTP again last week for main and sakray server.
    1 point
  12. To be quite honest, if you're not capable of searching these forums, you likely aren't capable of making the necessary changes for the project you're trying to create.
    1 point
  13. @Stolao I mean like .... can you guys stop spreading this kind of technique ? OnHour00: if(gettime(DT_DAYOFWEEK) == SUNDAY){ query_sql("DELETE FROM `acc_reg_num` WHERE `key` = '#HReward'"); addrid(0); #HReward = 0; } end; in the `acc_reg_num` table, the `key` column isn't index if even as a developer is teaching this method, might as well go index the `key` column CREATE TABLE IF NOT EXISTS `acc_reg_num` ( `account_id` int(11) unsigned NOT NULL default '0', `key` varchar(32) binary NOT NULL default '', `index` int(11) unsigned NOT NULL default '0', `value` int(11) NOT NULL default '0', PRIMARY KEY (`account_id`,`key`,`index`), KEY `account_id` (`account_id`), KEY `key` (`key`), # <-- PLEASE ADD THIS IN YOUR main.sql ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `char_reg_num` ( `char_id` int(11) unsigned NOT NULL default '0', `key` varchar(32) binary NOT NULL default '', `index` int(11) unsigned NOT NULL default '0', `value` int(11) NOT NULL default '0', PRIMARY KEY (`char_id`,`key`,`index`), KEY `char_id` (`char_id`), KEY `key` (`key`), # <-- ALSO ADD THIS IN YOUR main.sql ) ENGINE=MyISAM;
    1 point
  14. 3360 downloads

    This is just a compilation of aura's I've had for quite a few years. I figured since you don't really see many aura's anymore I'd upload all of them from old projects I used to have. IDK who owns all of these so if anyone can look through them and maybe shoot me a pm I'll be able to change this post to give credit where due.
    Free
    1 point
×
×
  • Create New...