Jump to content

Extra bonuses [without items]


Lilith

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

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 by Lilith
  • Upvote 3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   57
  • Joined:  01/21/12
  • Last Seen:  

Nice idea :) i think it could be useful for combie with achievement system

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  149
  • Reputation:   12
  • Joined:  02/17/12
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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 by Legato
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Updated. Bug with setting '2' fixed.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Re-uploaded patch. Now bonuses stack...

Edited by Lilith
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   8
  • Joined:  11/16/11
  • Last Seen:  

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;

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  03/11/12
  • Last Seen:  

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 by moneymuch
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  11/22/11
  • Last Seen:  

Hi.

Is it possible to add Extra Bonus, for certain GM level?

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   11
  • Joined:  11/16/11
  • Last Seen:  

Is it possible that the bonuses will be given to the members of a certain guild via guild ID?

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   1
  • Joined:  05/13/12
  • Last Seen:  

Thank you very much for this patch :) it actually works like a charm, really great job!!! And it also works in eAthena last rev :D (only had to manually add the part of battle.c and battle.h, also the MAX_ITEMDB variable :D)

Really: pretty good job. Thank you very much!

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  11/26/11
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

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).

Link to comment
Share on other sites

  • 7 months later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/23/11
  • Last Seen:  

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 by Encon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

Nice source!

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

I cant make it work in the latest svn. :(

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  10/10/12
  • Last Seen:  

autobonus,autobonus2,autobonus3 is not working in extra bonus
anyone face that problem?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

Doesn't work on latest SVN,need an update /sob

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   33
  • Joined:  12/24/11
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 9 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   4
  • Joined:  04/16/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 2 years later...

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

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

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

i need this one but doesn't work on latest SVN

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

On 7/26/2019 at 5:04 PM, Forshaken said:

image.thumb.png.36646d1faebad7d69787cea6e415f349.pngAnyone can fix this error?

@Lilith Please fix this

Anyone can fix this error?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...