Aller au contenu

Photo

Px lost on death


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

#1
Talon

Talon
  • Members
  • 51 messages

I have this script for now:

void main()
{
object oDead = GetLastRespawnButtonPresser();
    int nXP = GetXP(oDead);
    int nPenalty = 50 * GetHitDice(oDead);
    int nHD = GetHitDice(oDead);
    int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
    int nNewXP = nXP - nPenalty;
    if (nNewXP < nMin)
       nNewXP = nMin;
    SetXP(oDead, nNewXP);
    int nGoldToTake =    FloatToInt(0.10 * GetGold(oDead));
    if (nGoldToTake > 10000)
    {
        nGoldToTake = 10000;
    }
    AssignCommand (oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
    DelayCommand (4.0, FloatingTextStrRefOnCreature (58299, oDead, FALSE));
    DelayCommand (4.8, FloatingTextStrRefOnCreature (58300, oDead, FALSE));
    ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectResurrection() ,oDead);
    ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectHeal (GetMaxHitPoints(oDead)) , oDead);
    RemoveEffects (oDead);
}

I want add a script on module that player under level 4 lost only 50  px and money on death.

From 5 they lost 50px  per level + 10%mo.

Someone could help me?

Thanks!

 



#2
WhiZard

WhiZard
  • Members
  • 1 204 messages

Not that hard to do

 

Instead of:

int nPenalty = 50 * GetHitDice(oDead);

use

 

int nHitDice = GetHitDice(oDead);

if(nHitDice < 5) nHitDice = 1;

int nPenalty = 50 * nHitDice;

 

Instead of

int nGoldToTake =    FloatToInt(0.10 * GetGold(oDead));

use

 

int nGoldToTake = GetGold(oDead) / 10;

if(nHitDice == 1  && nGoldToTake > 50) nGoldToTake = 50;



#3
Talon

Talon
  • Members
  • 51 messages

thanks :D