Aller au contenu

Photo

Killer Death System


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Evelath

Evelath
  • Members
  • 56 messages
Looking at the following line:

const int    DEFAULT_PER_LEVEL_XP_LOSS           = 250;

I am attempting to turn the amount of XP lost to a Percentage rather than a strict number. 

Thanks for any assistance!

#2
Thayan

Thayan
  • Members
  • 244 messages
You'll need to change the line of code that is using that variable. I don't use his system, but there should be a line somewhere that looks like this:
SetXP(oPC, GetXP(oPC)-DEFAULT_PER_LEVEL_XP_LOSS*GetHitDice(oPC));

There a bunch of different ways you can modify that line, but something like this following example would take 10% of the PC’s XP every time they respawn (and provide you an infinite number of complaints about how harsh a 10% XP loss is for dying ;) )
SetXP(oPC, GetXP(oPC)-(GetXP(oPC)/10));

Modifié par Thayan, 15 février 2011 - 10:45 .


#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
lol,   Nope not that simple.  I was just looking at his scripts.   There are about 7 different spots that will need to be modified.   There are also different settings for the situation.   Death plane, temple and field raise. a lot of it is written with the  ?: Ternary Conditional .  I am not sure how good   the OP will be at reading that.  

I don't have time to work up a fix for you right now.  I'll try and get one for you later  if no one else jumps in with one before hand.

Modifié par Lightfoot8, 15 février 2011 - 11:04 .


#4
Thayan

Thayan
  • Members
  • 244 messages
Heh - should have figured as much from Axe. Sounds like a pretty interesting (complex) system though.

#5
Evelath

Evelath
  • Members
  • 56 messages
Any assistance would be greatly appreciated. :)  I could likely find all of the files for the fix if there is only one line of code that needs to be altered.

#6
Greyfort

Greyfort
  • Members
  • 234 messages
Do you have a link for Killer Death script, I could give it a look.

#7
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Axe Murderer's Killer Death System 1 v2.2 by Axe

#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Evelath wrote...

Any assistance would be greatly appreciated. :)  I could likely find all of the files for the fix if there is only one line of code that needs to be altered.


The following lines will need to be changed to the formula you want. 

kds1_purg_tawred (36):   int nPenaltyXP    = nLevel *PER_LEVEL_XP_LOSS;
kds1_purg_tawred (38):   int nPenaltyXP_DS = nLevel *PER_LEVEL_XP_LOSS_DS;
_kds1_inc (650):   int nRezXPPenalty = PER_LEVEL_XP_LOSS_FR *nPCLevel;
_kds1_inc (784):           int nPenalty = PER_LEVEL_XP_LOSS *nLevel;
_kds1_inc (879):           int nPenalty = PER_LEVEL_XP_LOSS_DS *nLevel;
_kds1_inc (975):         int nPenalty = PER_LEVEL_XP_LOSS *nLevel;
_kds1_inc (994):         int nPenalty = PER_LEVEL_XP_LOSS_DS *nLevel;
_kds1_inc (1007):         int nPenalty   = PER_LEVEL_XP_LOSS_DS *nLevel;
_kds1_inc (1026):         int nPenalty   = PER_LEVEL_XP_LOSS_DS *nLevel;
_kds1_inc (1374):           int nPenalty = PER_LEVEL_XP_LOSS *nLevel;

#9
Evelath

Evelath
  • Members
  • 56 messages
Would it be sufficient to plug in the script provided up top into those particular areas?:

SetXP(oPC, GetXP(oPC)-(GetXP(oPC)/10));

Or will this require more in-depth changes?

Thank you so much for the help.

#10
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
That would give you a 10% xp loss. But keep in mind :

The lines with PER_LEVEL_XP_LOSS in them is what happens if you are raised By the church.

Lines with PER_LEVEL_XP_LOSS_DS in them are what happens getting out of your death spot.

And lines with PER_LEVEL_XP_LOSS_FR in them is what happens when another PC raises the PC in the field.

Edit:  Just struck through my blunder.  No you would not want to use that in place of the lines given. 

Lets try this.  

kds1_purg_tawred (36):   int nPenaltyXP    = (nCurrXP *PER_LEVEL_XP_LOSS) /100;
kds1_purg_tawred (38):   int nPenaltyXP_DS =( nCurrXP*PER_LEVEL_XP_LOSS_DS) /100;
_kds1_inc (650):   int nRezXPPenalty =( PER_LEVEL_XP_LOSS_FR *GetXP(oPC)) /100;
_kds1_inc (784):           int nPenalty = (PER_LEVEL_XP_LOSS *nCurrXP) /100;
_kds1_inc (879):           int nPenalty =( PER_LEVEL_XP_LOSS_DS *nCurrXP) /100;
_kds1_inc (975):         int nPenalty = (PER_LEVEL_XP_LOSS *nCurrXP) /100;
_kds1_inc (994):         int nPenalty = (PER_LEVEL_XP_LOSS_DS *nCurrXP) /100;
_kds1_inc (1007):         int nPenalty   = (PER_LEVEL_XP_LOSS_DS *nCurrXP) /100;
_kds1_inc (1026):         int nPenalty   = (PER_LEVEL_XP_LOSS_DS *nCurrXP) /100;
_kds1_inc (1374):           int nPenalty = (PER_LEVEL_XP_LOSS *nCurrXP) /100;

Then go back to your constants to what ever % you want as a default % 

  _kds1_inc (43): const int    DEFAULT_PER_LEVEL_XP_LOSS           = 10;

everything in the system should work as a percent then.   Just keep in mind that your vars that read Per_Level_ Xp  are now Percentages. 

Modifié par Lightfoot8, 22 février 2011 - 02:47 .


#11
SHOVA

SHOVA
  • Members
  • 522 messages
great job Lightfoot, it works perfectly with the %. I am going ot hijack this thread a bit, as I am having a different problem with this system.

My mod on load gets a error when I build the mod. Going back in to check the problem and hitting save and compile, I get that the error is really in NW_I0_PLOT line 1404. the part of the include that seams to have a problem with this system is



// * returns true if the player can afford to lose the indicated amount of XP without losing a level

int plotCanRemoveXP(object oPC, int nPenalty)

{

int nXP = GetXP(oPC);

int nHD = GetHitDice(oPC);

// * You can not lose a level with this

--> int nMin = ((nHD * (nHD - 1)) / 2) * 1000; // the error PARSING VARIABLE LIST



int nNewXP = nXP - nPenalty;

if (nNewXP < nMin)

return FALSE;

return TRUE;

}



any ideas?

#12
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
There is nothing wrong with with the fragment you posted. The problem is most likely in your client on enter script. MisLeading errors like this can ocure form the main body of the code.