Ninja Posted August 15, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Share Posted August 15, 2012 (edited) 8/21: Sup all! hope you like my releases Note: No 3ceam patches for now. Please convert them by manually looking at the whole patch file. changelog: 8/15 original script [no patch file] 8/16 revised the whole thing. +added common/custom.c ~ to separate custom code from the whole rAthena code +added common/custom.h ~ made a header file so all codes from custom.c can be ported to other *.c's when modding +this release comes with a Guild Mod: Max/Min Member modification but you can still use it as a framework +added patch file for Guild Mod +fixed a file read closing after 1 iteration of reading custom.conf +EDP+SL mod enable/disable option +added patch file for EDP+SL mod 8/17 added the read custom conf framework added the SL + EDP Mod added the Guild Mod 8/21 added the Hardcore Mode mod credits to Lighta for methods of improvements My MODS: [0] Read Custom Conf Framework Description: This is a prerequisite to all of my mods. allows reading of conf/custom.conf upon runtime. download: custom framework.zip Instructions: 1. copy "custom.conf" to /conf folder 2. copy "custom.h" and "custom.c" to /src/common folder 3. apply patch: custom framework.patch [1]EDP+SL MOD Description: A Mod for enabling/disabling EDP+SL via conf/custom.conf download: sl + edp.patch download: additional.patch Instructions: 1. install [0] Read Custom Conf Framework 2. apply patch: sl + edp.patch 3. apply patch: additional.patch 4. adjust settings in conf/custom.conf screenshots: [2]GUILD MOD: Description: A Mod for adjusting Min/Max/GuildExtension Guild options via conf/custom.conf download: guild mod.patch Instructions: 1. install [0] Read Custom Conf Framework 2. apply patch: guild mod.patch 3. adjust settings in conf/custom.conf screenshots: [3]HARDCORE MODE: Description: A Mod similar to the Diablo's HARDCORE Mode mechanics. In this Mod, you will be teleported to a certain pvp map if you die, you'll get [HC] tag in your name if you choose to be a hardcore char, @hardcoreon/@hardcoreoff commands, and script functions f_hardcoreon/f_hardcoreoff. Settings are inside custom.conf. Side Note: I'd really appreciate if someone can redo the scripting of the NPC's >_< I admit that I really suck at it. by the way, I used scripting for the new atcommand so you really need it. download: hardcore_mode.patch download: hardcore_mode.txt Instructions: 1. install [0] Read Custom Conf Framework 2. copy hardcore_mode.txt to npc/custom 3. add this line to scripts_custom.conf npc: npc/custom/hardcore_mode.txt 4. apply patch: hardcode_mode.patch 5. modify your sql database by running these commands: alter table `char` add hardcore int not NULL default 0 after robe alter table `char` add old_name varchar(30) not NULL default 'none' after hardcore; screenshots: Edited August 21, 2012 by jezznar 4 Quote Link to comment Share on other sites More sharing options...
Lighta Posted August 15, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted August 15, 2012 Quite hard to follow you jezznar, a diff would really help. If you're on windows and using tortoise svn : right click on folder and chose create patch; it will create a unified diff with you change. If you're on linux : "svn diff > mypatch.diff" it will create again an unified diff name mypatch.diff Beside that : MAX_GUILD is usually defined to 76, more specifically to 16+6*10, using something superior is more likely to create out of bound array and crash. (Much more delicate imo) and there some check in guild.c that you didn't take care of : if(g->max_member > MAX_GUILD) { ShowError("guild_recv_info: Received guild with %d members, but MAX_GUILD is only %d. Extra guild-members have been lost!\n", g->max_member, MAX_GUILD); g->max_member = MAX_GUILD; } So in short in think you need to review your release. Still a nice mod tought thx =) Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 15, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 15, 2012 (edited) Hi Lighta, thanks! I think I missed that part regarding guild.c when I searched the whole code about which stuff uses MAX_GUILD. thanks man. I'll add that the whole Guild Mod is really just an example and just a reply to another thread.. I just tried to create a general one so other's may use it if ever. and oh, i didnt know that SVNTORTOISE is able to create diff's automatically~ I'll do that tomorrow because I left my Laptop at the office. Well, Guess I'm gonna have to put another Warning message in the custom.conf file then. Thanks! i'm currently studying how to mod rathena. and its pretty hard granting that I suck at coding >_> but comments like yours really help //edit: next time i'll make sure its refined Edited August 15, 2012 by jezznar Quote Link to comment Share on other sites More sharing options...
Lighta Posted August 15, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted August 15, 2012 No probleme happy it help you =) Quote Link to comment Share on other sites More sharing options...
Reducto Posted August 16, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 231 Reputation: 9 Joined: 12/16/11 Last Seen: August 10, 2016 Share Posted August 16, 2012 (edited) There is a error in compiling it said that common/custom_conf.h not fount. Please help. Thank you very much. How about in 3ceam? Edited August 16, 2012 by Cuspid Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 17, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 17, 2012 (edited) all patches redone. tested to work on 16625 several times before reposted. please follow the instructions in a strictly manner. no 3Ceam patches made(just see the patch themselves and try to convert it to 3Ceam) released: Custom.conf Framework Guild Mod (adjust min/max/guildextension skill) Disable/Enable SL + EDP hope you guys enjoy it. if there'd be problems, please post them. thanks. I'd appreciate good and bad comments. Edited August 17, 2012 by jezznar Quote Link to comment Share on other sites More sharing options...
QQfoolsorellina Posted August 20, 2012 Group: Members Topic Count: 40 Topics Per Day: 0.01 Content Count: 587 Reputation: 105 Joined: 11/19/11 Last Seen: July 7, 2019 Share Posted August 20, 2012 Hi~ jezznar, I was wondering if it's possible to make mmo.h to read Custom.Conf ,coz I want the PACKETVER in mmo.h to read Custom.Conf setting. Is it possible to implement? Quote Link to comment Share on other sites More sharing options...
KazuyaX93 Posted August 20, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 63 Reputation: 0 Joined: 08/05/12 Last Seen: September 11, 2012 Share Posted August 20, 2012 how can I apply .patch-Files? Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 20, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 20, 2012 (edited) hi Marin, I dont really think it'll be possible since(correct me if I'm wrong) PACKETVER's are only used during compile time and not during runtime.. if you happen to try and take off preprocessors, you're gonna have to do a major change in the whole code. hi kazuya, download tortoiseSVN. install it. make sure your "trunk" folder is an SVN folder. then right-click on your "trunk" folder and choose tortoiseSVN->apply patch. Edited August 20, 2012 by jezznar Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 21, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 21, 2012 Bump! New Hardcore Mode Mod up! Quote Link to comment Share on other sites More sharing options...
Judas Posted August 21, 2012 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 2244 Reputation: 182 Joined: 11/19/11 Last Seen: September 15, 2024 Share Posted August 21, 2012 awesome rep Quote Link to comment Share on other sites More sharing options...
Ninja Posted August 21, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted August 21, 2012 thanks Judas! Quote Link to comment Share on other sites More sharing options...
RAWRs Posted January 13, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 76 Reputation: 1 Joined: 11/17/11 Last Seen: April 19, 2013 Share Posted January 13, 2013 (edited) custom.c: In function âcustom_config_readâ:custom.c:37: warning: too few arguments for formatPlease help me! // Framework for Custom.conf [Jezznar] // separate custom codes by putting them here. #include <stdio.h> #include <stdlib.h> #include "showmsg.h" #include "strlib.h" #include "custom.h" #include "showmsg.h" //put variables being used globally here int d_max_gmembers=76; int d_min_gmembers=16; int d_gdext_adjustment=6; // put custom codes here int custom_config_read(const char *cfgName) { FILE *fp; int line_num = 0; //add more w's if you need more char line[1024], w1[64], w2[64]; if((fp = fopen(cfgName, "r")) == NULL) { ShowWarning("Custom configuration file is not found: %s\n", cfgName); return 1; } ShowInfo("Reading the configuration file %s...\n", cfgName); while(fgets(line, sizeof(line), fp)) { line_num++; if ((line[0] == '/' && line[1] == '/') || line[0] == '\n' || line[1] == '\n') continue; if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2) != 2) { /* if you need more paramaters, just add more w's and change "!=2" to "<=2" to how many w's are present[Jezznar] */ ShowWarning("Error syntax of configuration file %s in line %d.\n", cfgName, line_num); continue; } remove_control_chars(w1); remove_control_chars(w2); //if there are more parameters just add more /* put all config fetches here [Jezznar] if( strcmpi(w1, "<parameter_name_from_custom.conf>") == 0 ) { d_<parameter_name_from_custom.conf> = atoi(w2); } else if (condition) {arguments;} */ if(strcmpi(w1,"max_gmembers") == 0) { d_max_gmembers = atoi(w2); } else if (strcmpi(w1,"min_gmembers") == 0) { d_min_gmembers = atoi(w2); } else if (strcmpi(w1,"gd_extadjustment") == 0) { d_gdext_adjustment = atoi(w2); } } ShowInfo("Done reading %s.\n", cfgName); fclose(fp); return 0; } Edited March 6, 2013 by RAWRs Quote Link to comment Share on other sites More sharing options...
RAWRs Posted March 6, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 76 Reputation: 1 Joined: 11/17/11 Last Seen: April 19, 2013 Share Posted March 6, 2013 I need help,someone? Quote Link to comment Share on other sites More sharing options...
Lighta Posted March 6, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted March 6, 2013 not sure but I think it should be : - if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2) != 2) {+ if(sscanf(line,"%[^:] :%[^\r\n]", w1, w2) != 2) { Quote Link to comment Share on other sites More sharing options...
rafoka Posted March 6, 2013 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 48 Reputation: 8 Joined: 01/09/12 Last Seen: September 5, 2021 Share Posted March 6, 2013 Good job, I personally like that hard core system Quote Link to comment Share on other sites More sharing options...
RAWRs Posted March 7, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 76 Reputation: 1 Joined: 11/17/11 Last Seen: April 19, 2013 Share Posted March 7, 2013 not sure but I think it should be : - if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2) != 2) { + if(sscanf(line,"%[^:] :%[^\r\n]", w1, w2) != 2) { Perfect,my problem solved. Thank You very much! Quote Link to comment Share on other sites More sharing options...
Ninja Posted September 19, 2013 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Author Share Posted September 19, 2013 been a bit of a long time since i've coded. guess i'll be coming back and sorry for the ones that I wasnt able to help with. Quote Link to comment Share on other sites More sharing options...
Terrorsoul Posted February 13, 2014 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 32 Reputation: 2 Joined: 06/09/12 Last Seen: January 17, 2018 Share Posted February 13, 2014 (edited) I have this error: undefined reference to `custom_config read error in this line: // read custom.conf framework [Jezznar] custom_config_read(CUSTOM_CONF_NAME); Edited February 13, 2014 by Terrorsoul Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.