Author Topic: Killer Death System  (Read 308 times)

Legacy_Evelath

  • Full Member
  • ***
  • Posts: 108
  • Karma: +0/-0
Killer Death System
« on: February 15, 2011, 08:30:56 pm »


               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!
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Killer Death System
« Reply #1 on: February 15, 2011, 10:45:06 pm »


               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 '<img'> )
SetXP(oPC, GetXP(oPC)-(GetXP(oPC)/10));
               
               

               


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


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Killer Death System
« Reply #2 on: February 15, 2011, 10:57:43 pm »


               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 .
                     
                  


            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Killer Death System
« Reply #3 on: February 16, 2011, 05:01:52 pm »


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

               
            

Legacy_Evelath

  • Full Member
  • ***
  • Posts: 108
  • Karma: +0/-0
Killer Death System
« Reply #4 on: February 18, 2011, 04:03:56 pm »


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

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Killer Death System
« Reply #5 on: February 20, 2011, 01:05:29 am »


               Do you have a link for Killer Death script, I could give it a look.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Killer Death System
« Reply #6 on: February 20, 2011, 01:13:05 am »


               Axe Murderer's Killer Death System 1 v2.2 by Axe
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Killer Death System
« Reply #7 on: February 22, 2011, 01:36:38 am »


               

Evelath wrote...

Any assistance would be greatly appreciated. '<img'>  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;
               
               

               
            

Legacy_Evelath

  • Full Member
  • ***
  • Posts: 108
  • Karma: +0/-0
Killer Death System
« Reply #8 on: February 22, 2011, 02:09:27 am »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Killer Death System
« Reply #9 on: February 22, 2011, 02:24:39 am »


               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 .
                     
                  


            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Killer Death System
« Reply #10 on: February 24, 2011, 02:51:28 pm »


               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?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Killer Death System
« Reply #11 on: February 24, 2011, 11:27:16 pm »


               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.