Jump to content

Recommended Posts

Posted (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 by Lilith
  • Upvote 3
Posted

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?

Posted (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 by Legato
Posted

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?

Posted

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?

Posted

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;

  • 4 weeks later...
Posted (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 by moneymuch
  • 2 months later...
  • 2 weeks later...
Posted

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!

  • 2 weeks later...
Posted

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.

  • 1 month later...
Posted

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

  • 7 months later...
Posted (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 by Encon
  • 2 months later...
  • 4 weeks later...
  • 3 months later...
Posted

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.

  • 9 months later...
Posted

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

  • 2 years later...
Posted

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
  • 1 year later...
  • 1 year later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...