Jump to content

Extra bonuses [without items]


Lilith

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

with the updated rA emulator, you could actually achieve the same feature using this method

-	script	Sample	-1,{
	
OnPCStatCalcEvent:
	if (EXTRA_BONUS == 0) end;
	else if (EXTRA_BONUS == 1) {
		bonus bStr, 10;
	} 
	else if (EXTRA_BONUS == 2) {
		bonus bStr, 20;
	} 
	else if (EXTRA_BONUS == 3) {
		bonus bStr, 30;
	}
	end;
}

 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  05/16/18
  • Last Seen:  

20 hours ago, Emistry said:

with the updated rA emulator, you could actually achieve the same feature using this method


-	script	Sample	-1,{
	
OnPCStatCalcEvent:
	if (EXTRA_BONUS == 0) end;
	else if (EXTRA_BONUS == 1) {
		bonus bStr, 10;
	} 
	else if (EXTRA_BONUS == 2) {
		bonus bStr, 20;
	} 
	else if (EXTRA_BONUS == 3) {
		bonus bStr, 30;
	}
	end;
}

 

1 problem with the OnPCStatCalcEvent: is that npcs and/or items that use the sc_start script will conflict and clear out the passive bonuses given.

 

issue: sc_start does not call for OnPCStatCalcEvent even tho sc_start actually recalculates a character's stats.

Edited by Kinkykids
Link to comment
Share on other sites


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

On 3/16/2020 at 7:11 PM, Emistry said:

with the updated rA emulator, you could actually achieve the same feature using this method


-	script	Sample	-1,{
	
OnPCStatCalcEvent:
	if (EXTRA_BONUS == 0) end;
	else if (EXTRA_BONUS == 1) {
		bonus bStr, 10;
	} 
	else if (EXTRA_BONUS == 2) {
		bonus bStr, 20;
	} 
	else if (EXTRA_BONUS == 3) {
		bonus bStr, 30;
	}
	end;
}

 

Thank you ❤️

On 3/17/2020 at 6:18 AM, Kinkykids said:

1 problem with the OnPCStatCalcEvent: is that npcs and/or items that use the sc_start script will conflict and clear out the passive bonuses given.

issue: sc_start does not call for OnPCStatCalcEvent even tho sc_start actually recalculates a character's stats.

it works on me and no prob with npc with sc bonuses

Link to comment
Share on other sites

  • 9 months later...

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   26
  • Joined:  11/20/11
  • Last Seen:  

On 6/6/2013 at 8:02 PM, Encon said:

 

 

 

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. ? 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 6.9 kB · 84 downloads

1 unresolved externals...

Link to comment
Share on other sites

  • 2 months later...

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

Up for this. OnPCStatCalcEvent has been removed from the latest git.

Link to comment
Share on other sites

  • 11 months later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  02/04/22
  • Last Seen:  

@Emistry if one would use your method, how the EXTRA_BONUS flag is set ? Does it still need the SRC Modification or can it be done entirely through scripts ?

Thank you!

Link to comment
Share on other sites

  • 3 months later...

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

Having memory leaks on map exit and only if there are enable bonuses on extra_bonus.txt.

Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   26
  • Joined:  11/20/11
  • Last Seen:  

wondering people dont update this anymore this one is a good custom modification...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   0
  • Joined:  05/04/17
  • Last Seen:  

OnPCStatCalcEvent has been removed from the latest git. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   26
  • Joined:  11/20/11
  • Last Seen:  

``` /**
 * Extra Bonuses [Lilith]
 **/ 
struct s_bonus_data {
    extern struct script_code *script;
};
struct s_bonus_data extra_bonus[MAX_ITEMID]; ```

 

this one is there a proper way to code this part

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