Lilith Posted April 22, 2012 Posted April 22, 2012 (edited) This code adds the 'item bonuses' to players without any items. The code have 3 settings if conf/player.conf // Enable [1-2] or disable[0] player's Extra Bonuses?// 1 = enable for all players any bonuses from db/extra_bonuses.txt // 2 = enable only for players which have a specific variable "EXTRA_BONUS" enable_extra_bonus: 2 I make '2' setting for faction-like systems. Just set the player variable EXTRA_BONUS to 1, and player will be received first line bonuses from db/extra_bonuses.txt You can add/change/delete bonuses in/from file db/extra_bonuses.txt // Extra Bonuses [Lilith]// If enable_extra_bonus is 1 this and below Extra bonuses will be received by all players // If enable_extra_bonus is 2 this Extra bonus will be received by players which have variable EXTRA_BONUS = 1 { bonus bStr,15; bonus bSpeedAddRate,50; /* more bonuses */ } // If enable_extra_bonus is 2 this Extra bonus will be received by players which have variable EXTRA_BONUS = 2 { bonus bAgi,10; bonus bMdef,30; /* more bonuses */ } // More bonuses...etc... {} {} {} Bonuses will be reloaded by @reloaditemdb command. enjoy. Extra_Bonuses.patch Edited May 4, 2012 by Lilith 3 Quote
Gennosuke Kouga Posted April 22, 2012 Posted April 22, 2012 Nice idea i think it could be useful for combie with achievement system Quote
sizenine Posted April 25, 2012 Posted April 25, 2012 instead of having the extra bonus overlap effects for all values under it, can you make it so that a different bonus can be set to every value without effects from bonuses above overlapping it? Quote
Legato Posted May 1, 2012 Posted May 1, 2012 (edited) Hello.. Could someone help me adding bonuses to specific players? I already set the enable_extra_bonus to enable_extra_bonus : 2 and add some bonuses on extra_bonuses.txt on db. But, the bonuses doesn't apply to these 2 CIDs. Here's the script I have. Please correct it if you see something wrong with it. - script Bonus -1,{ OnPCLoginEvent: if(bbinus) end; if( getcharid(0) == 150000 ) Set EXTRA_BONUS,1; if( getcharid(0) == 150001 ) Set EXTRA_BONUS,2; set bbonus,1; end; } instead of having the extra bonus overlap effects for all values under it, can you make it so that a different bonus can be set to every value without effects from bonuses above overlapping it? Bump 1 for my post and for this 1. Edited May 1, 2012 by Legato Quote
Legato Posted May 1, 2012 Posted May 1, 2012 Thanks for the fixed, Lilith. Uhh, any update on how you'd fix this? D: instead of having the extra bonus overlap effects for all values under it, can you make it so that a different bonus can be set to every value without effects from bonuses above overlapping it? Quote
Lilith Posted May 4, 2012 Author Posted May 4, 2012 (edited) Re-uploaded patch. Now bonuses stack... Edited May 4, 2012 by Lilith Quote
Legato Posted May 9, 2012 Posted May 9, 2012 Hi, Lilith. Thanks for the updates. I wanna ask something, though. Any news about this ? | v instead of having the extra bonus overlap effects for all values under it, can you make it so that a different bonus can be set to every value without effects from bonuses above overlapping it? Quote
dreamunreal Posted May 14, 2012 Posted May 14, 2012 small question. how about: // Enable [1-2] or disable[0] player's Extra Bonuses? // 1 = enable for all players any bonuses from db/extra_bonuses.txt // 2 = enable only for players which have a specific variable "EXTRA_BONUS", type 1 // 3 = enable only for players which have a specific variable "EXTRA_BONUS", type 2 enable_extra_bonus: X( X can be 1,2,3) 1,{ bonus bStr,20; } 2,{ bonus bAgi,20; } switch(enable_extra_bonus) { case 1: work on all players; break; case 2: all bonuses work on all players which specific variable "EXTRA_BONUS" != 0; break; case 3: bonuses just work on players which specific variable "EXTRA_BONUS" = bonus's number; break; } end; Quote
moneymuch Posted June 6, 2012 Posted June 6, 2012 (edited) small question. how about: // Enable [1-2] or disable[0] player's Extra Bonuses? // 1 = enable for all players any bonuses from db/extra_bonuses.txt // 2 = enable only for players which have a specific variable "EXTRA_BONUS", type 1 // 3 = enable only for players which have a specific variable "EXTRA_BONUS", type 2 enable_extra_bonus: X( X can be 1,2,3) 1,{ bonus bStr,20; } 2,{ bonus bAgi,20; } switch(enable_extra_bonus) { case 1: work on all players; break; case 2: all bonuses work on all players which specific variable "EXTRA_BONUS" != 0; break; case 3: bonuses just work on players which specific variable "EXTRA_BONUS" = bonus's number; break; } end; Laugh ~~~ I want to use this mode , too. But I have not found the solution. My idea is the way that resemble "manner_system", 1 + 2 + 4 + 8 + 16.............,but i don't know to edit it Edited June 6, 2012 by moneymuch Quote
Lai Posted June 11, 2012 Posted June 11, 2012 Hi. Is it possible to add Extra Bonus, for certain GM level? Quote
Linkin Park Posted September 7, 2012 Posted September 7, 2012 Is it possible that the bonuses will be given to the members of a certain guild via guild ID? Quote
HitsuzenRO Posted September 18, 2012 Posted September 18, 2012 Thank you very much for this patch it actually works like a charm, really great job!!! And it also works in eAthena last rev (only had to manually add the part of battle.c and battle.h, also the MAX_ITEMDB variable ) Really: pretty good job. Thank you very much! Quote
emo182 Posted September 30, 2012 Posted September 30, 2012 small question. how about: // Enable [1-2] or disable[0] player's Extra Bonuses? // 1 = enable for all players any bonuses from db/extra_bonuses.txt // 2 = enable only for players which have a specific variable "EXTRA_BONUS", type 1 // 3 = enable only for players which have a specific variable "EXTRA_BONUS", type 2 enable_extra_bonus: X( X can be 1,2,3) 1,{ bonus bStr,20; } 2,{ bonus bAgi,20; } switch(enable_extra_bonus) { case 1: work on all players; break; case 2: all bonuses work on all players which specific variable "EXTRA_BONUS" != 0; break; case 3: bonuses just work on players which specific variable "EXTRA_BONUS" = bonus's number; break; } end; Laugh ~~~ I want to use this mode , too. But I have not found the solution. My idea is the way that resemble "manner_system", 1 + 2 + 4 + 8 + 16.............,but i don't know to edit it i think that too, 1+2+4+8 will be good, or maybe it can modified using array like EXTRA_BONUS[0,1,2,3....], so a character can have many effect. Quote
Vach Posted November 4, 2012 Posted November 4, 2012 I agree that this would jump in use if you could enable specific variables to work specific bonus lines... otherwise it could become difficult to use for sparse server populations (with npc hosted events). Quote
Encon Posted June 6, 2013 Posted June 6, 2013 (edited) Laugh ~~~ I want to use this mode , too. But I have not found the solution. My idea is the way that resemble "manner_system", 1 + 2 + 4 + 8 + 16.............,but i don't know to edit it I agree that this would jump in use if you could enable specific variables to work specific bonus lines... otherwise it could become difficult to use for sparse server populations (with npc hosted events). Super late, but rawr. Modified patch file attached to this post. (Leave enable_extra_bonus as 2 for this to work) Right now it works with up to 90 bonus effects, but it's easy to edit it to allow for more if you need to. First 30 bonuses in the db/extra_bonuses.txt file apply to the EXTRA_BONUS variable, next 30 bonuses apply to EXTRA_BONUS2, next 30 apply to EXTRA_BONUS3. Make sure you leave all the blank {} lines, otherwise it'll mess things up since it relies on the empty bonuses to know where the next variable starts. Inside conf/battle/player.conf: extra_bonus_count1: 30 // EXTRA_BONUS extra_bonus_count2: 30 // EXTRA_BONUS2 extra_bonus_count3: 30 // EXTRA_BONUS3 That sets how many lines it'll count for each variable, that's just random optimizing in case you use less than 30 each. I'm sure it barely makes a difference but I'm tired and it seemed like a good idea at the time so leave me alone. </3 You can probably just leave them at 30 I guess, I dunno. As a note, even if you set it to less than 30, the EXTRA_BONUS2 variable will still start from the 31st bonus line, so don't erase the empty {} lines or anything. This just tells the server to skip to the next variable once it hits the max amount for the current one. The EXTRA_BONUS variables use those bitwise number things that moneymuch mentioned, so when you set the variables it's like...uh... 1 = first bonus line 2 = second bonus line 4 = third bonus line 8 = fourth bonus line etc. 6 = 4+2 = second and third bonus lines 7 = 4+2+1 = first, second and third bonus lines etc. Holy crap I'm so tired...this is the worst explanation ever. Anyways yeah. Don't hate pl0x, I know I could have done it better but I'm too tired/lazy to really care, and as long as it works I'm happy. :x (Almost guaranteed that I'll forget to ever check this for replies, but uh...yeah...) Extra_Bonuses.patch Edited June 6, 2013 by Encon Quote
alibaba Posted September 14, 2013 Posted September 14, 2013 autobonus,autobonus2,autobonus3 is not working in extra bonusanyone face that problem? Quote
Norse Posted September 22, 2013 Posted September 22, 2013 Doesn't work on latest SVN,need an update Quote
Jonne Posted January 2, 2014 Posted January 2, 2014 If I set the EXTRA_BONUS variable to a negative value, I'm sure there will be an error because you don't check it before using it as index. And C will stop working for negative indice. Quote
t3quila Posted October 3, 2014 Posted October 3, 2014 autobonus,autobonus2,autobonus3 is not working in extra bonus anyone face that problem? yes bumb for this~ if i use autobonus (effect like issila card) server always give this report issue "[Error]: itemdb_readbonus: Extra columns in line 8 of "db/extra_bonuses.txt", skipping." pls help us.. how to fix it issue? thanks Quote
Skorm Posted January 1, 2017 Posted January 1, 2017 I'm not all that great at source but I did update this script to work with the most recent version of rAthena as of 1/1/17. I also added the bitwise operation thing people were asking for. I noticed that MAX_ITEMDB was never set so that was change to MAX_ITEMID which increased the size of the array and instead of resizing it which is a pain in that butt with C I just had to break the loop when it runs out of bonuses. I couldn't figure out how to make a patch file from a git commit so I just kinda made my own. So it probably won't work like a normal patch and instead you'll have to manually add the changes. Extra_bonus.patch 1 Quote
MukkiesftKies Posted July 8, 2018 Posted July 8, 2018 i need this one but doesn't work on latest SVN Quote
Forshaken Posted February 24, 2020 Posted February 24, 2020 On 7/26/2019 at 5:04 PM, Forshaken said: Anyone can fix this error? @Lilith Please fix this Anyone can fix this error? Quote
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.