|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10-25-2008, 01:46 PM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
Exp Loss Rule , care to test it anyone?
This works on a scale of 0 -9 ; '0' will loose you about 1 blue on death and '9' will loose you almost a level. I based it on Cbodmers exploss code, as it seems more sane than the current one we use.
ruletypes.h at around line 26;
Code:
RULE_INT ( Character, DeathExpLossMultiplier, 3) //Angelox, adjust how much exp is lost
attack.cpp at around line 1716;
Code:
// figure out if they should lose exp
float GetNum [] = {0.005f,0.015f,0.025f,0.035f,0.045f,0.055f,0.065f,0.075f,0.085f,0.095f };
int Num = RuleI(Character, DeathExpLossMultiplier);
float loss = GetNum[Num];
exploss=(int)((float)GetEXP() * (loss)); //Angelox: loose % of total XP pending rule (choose 0-9)
And the SQL;
Code:
Insert into rule_values values (0, 'Character:DeathExpLossMultiplier', 3);
I've been testing it today, looks to be OK - hoping some one else will test too.
Last edited by Angelox; 10-25-2008 at 10:02 PM..
Reason: Default rule should be '3' and not '0'
|
|
|
|
10-25-2008, 01:53 PM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
how much is 1 yellow?
|
10-25-2008, 02:04 PM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
I think was around 3, I changed default - set to three, i put zero by mistake
|
10-25-2008, 02:25 PM
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
You want to check the sanity of the rule setting, to stop a crash when accessing the array if someone sets it to an invalid value:
Code:
// figure out if they should lose exp
float GetNum [] = {0.005f,0.015f,0.025f,0.035f,0.045f,0.055f,0.065f,0.075f,0.085f,0.095f };
int Num = RuleI(Character, DeathExpLossMultiplier);
if((Num < 0) || (Num > 9))
Num = 0;
float loss = GetNum[Num];
exploss=(int)((float)GetEXP() * (loss)); //Angelox: lose % of total XP pending rule (choose 0-9)
I would also change GetNum & Num to more meaningful names.
Last edited by Derision; 10-25-2008 at 10:30 PM..
|
10-25-2008, 04:09 PM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
Thanks - I'll let it stand around here a few days before committing it all, incase anyone else has more ideas.
I wasn't really sure why this never got in, probably just forgotten I guess.
|
10-26-2008, 06:24 PM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
Just a thought, but couldn't we just set the rule to the % of a level we want to lose on death instead of predefined options?
common/ruletypes.h
Code:
RULE_REAL ( Character, DeathExpLossLevelPercent, 20) //1 yellow of exp lost on death by default. float for a little more accuracy if needed
zone/attack.cpp
Code:
// figure out if they should lose exp
float loss = RuleR(Character, DeathExpLossLevelPercent) / 100.0f;
exploss=(int)((float)GetEXP() * (loss)); //Angelox: loose % of total XP
SQL:
Code:
INSERT INFO rule_values VALUES (0, 'Character:DeathExpLossLevelPercent', 20);
|
10-27-2008, 11:07 AM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
I went ahead and put it in as I originally had it, since it's based on what cbodmer posted and was running on the Rathe server for a long time now (Derisions addition included).
Not that I think it's any better than yours, I'm just sure it all works as is since it's all been tested doesn't show any problems. The variable experience thing was what I added, and I tested it all week too.
It's always up for change anyway.
|
10-27-2008, 12:42 PM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
Quote:
Originally Posted by AndMetal
Just a thought, but couldn't we just set the rule to the % of a level we want to lose on death instead of predefined options?
|
yeah the plain % xp way does seem more straight forward
|
10-29-2008, 06:12 PM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
Cavedude; I saw you put back the old exp multiplier back? You can take the one I put in out if it's no good.
|
10-29-2008, 07:24 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
I added a rule, so admins can either use the old formula or your rule to specify a multiplier. The default is to use your system. I created the rule for purely selfish reasons, I liked the old formula and wished to keep it. But, this is a win-win situation. Stubborn folks like me can continue to use the old system, and people who want control can use yours.
|
05-24-2009, 12:55 AM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
I had an interesting idea.
I like idea that peopel loose Xp on death but I don't like idea of people loosing their level.
Is it posible to implement a rule that when you die, you NEVER loose Xp beyond your level?
|
05-24-2009, 03:57 PM
|
Sarnak
|
|
Join Date: Aug 2003
Location: Recycle Bin
Posts: 90
|
|
CharacterDeathExpLossLevel
This rule exists, Table (rule_values)
Just set to desired level, > than can be made on server?
__________________
I'll be back!
|
05-24-2009, 04:27 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
That rule sets the level that you will lose exp at if you die, not whether or not you will lose a level. He still wants exp loss, just doesn't want players to lose their level. This is actually not a bad idea. I have exp loss disabled because I don't want people losing their levels when they die, due to the special circumstances of my deleveling system. But, if we stopped people from losing their level when they die and could still have exp penalties, I would enable that.
|
05-24-2009, 04:28 PM
|
|
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
well acutly yes and no
I know of this rule, but this rule doesn't help to address the question asked =)
the rule determines LEVEL after which you START to loose XP
I asked for rule to prevent loss of level
in other words. I can set a rule to you mentioned to level 50
this will mean you do not loose Xp until lev 50
NOW you are lev 65 and you died. And you unding to 64
the rule we set do not in anyway prevent deleveling from 65 to 64 due to death.
PS. Trev beat me to a reply by a second =P
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 08:11 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|