Jump to content
Daxter

EXP Bonus as a static effect

Recommended Posts

Hi,

 

I'm working on some "Heirloom Gear" and I wanted it to improve EXP rate while equipped.

I've already added the base stat scripts into cha_timer:

 

		local Check_Heirloom = CheckItem_Heirloom ( role )
		if Check_Heirloom == 1 then
				local str = GetChaAttr(role, ATTR_STR)
				local agi = GetChaAttr(role, ATTR_AGI)
				local con = GetChaAttr(role, ATTR_CON)
				local spr = GetChaAttr(role, ATTR_STA)
				local acc = GetChaAttr(role, ATTR_DEX)
				local lv = GetChaAttr(role, ATTR_LV)

				if lv <= 20 then
					local str2 = GetChaAttr(role, ATTR_STR) + 1
					local agi2 = GetChaAttr(role, ATTR_AGI) + 1
					local con2 = GetChaAttr(role, ATTR_CON) + 1
					local spr2 = GetChaAttr(role, ATTR_STA) + 1
					local acc2 = GetChaAttr(role, ATTR_DEX) + 1
					SetCharaAttr(str2, role, ATTR_STR )
					SetCharaAttr(agi2, role, ATTR_STR )
					SetCharaAttr(con2, role, ATTR_STR )
					SetCharaAttr(spr2, role, ATTR_STR )
					SetCharaAttr(acc2, role, ATTR_STR )
(...)

I tried looking at amplifier of strive in itemeffects but the added state wasn't clear to me, nor could I find any references to it:

 

function ItemUse_WeiXing( role , Item )
	local statelv = 1
	local ChaStateLv = GetChaStateLv ( role , STATE_SBJYGZ )
	if ChaStateLv > statelv then
		SystemNotice ( role , "Better fruit in effect. Please use it later" )
		UseItemFailed ( role )
		return
	end
	local lv_star = GetChaAttr( role , ATTR_LV) 
	if lv_star > 40 then
		SystemNotice ( role , "Effective only for those below Lv 40" )
		UseItemFailed ( role )
		return
	end
	local statetime = 60+5*(lv_star-1)
	local Cha_Boat = 0
	Cha_Boat = GetCtrlBoat ( role )
	if Cha_Boat ==  nil then
		AddState( role , role , STATE_SBJYGZ , statelv , statetime )
	else
		AddState( Cha_Boat , Cha_Boat , STATE_SBJYGZ , statelv , statetime )
	end
end

Any ideas?

 

EDIT:

This script is untested, and as I wrote this I got to wonder whether it would stack infinitely,  increasing everytime cha_timer runs. Would it be better to built the bonus stats as if it were a fairy of sorts, and if so, how to go about it?

Edited by Daxter
added info

Share this post


Link to post
Share on other sites

 

this script would be worst thing  u may run in your server ever

you don't need cha_timer if you're seeking to boost exp for players killing monsters

you must done it inside 

 

function ShareTeamExp

but u also can take alook inside

function GetExp_PKM(dead, atk)

where shareteamexp called as well , 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for your insight. I moved the exp bonus to ShareTeamExp as suggested, and, at least until I think of an alternative, gave up on the variable stat bonuses.

Share this post


Link to post
Share on other sites
On 1/15/2024 at 1:04 PM, mkhzaleh said:

 

this script would be worst thing  u may run in your server ever

you don't need cha_timer if you're seeking to boost exp for players killing monsters

you must done it inside 

 


function ShareTeamExp

but u also can take alook inside


function GetExp_PKM(dead, atk)

where shareteamexp called as well , 

 

 

Just as he mentioned, ShareTeamExp would be the best place to do the experience bonus. You can look how fairies are handled since they're are being checked there. The fairy possession side of the experience bonus is basically a item and active effect check, not a bonus on the effect itself. So you can basically just copy that and remove the active effect check and just leave the item check for your specific item.

 

As for adding stats, if you have sources just create functions for equip/unequip items, check for your specific item and add/remove the corresponding stats. Without sources, there must be a way on how to do it, just can't remember right now since I haven't touched files in a few months already. Additionally, you can try checking this script out!

 

As a side note, try to clean/remove unnecessary stuff from cha_timer, since if something goes wrong, it will hang your server and clog up your log files very fast.

  • Thanks 1

Share this post


Link to post
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.   Restore formatting

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