Jump to content
  • 0

Question

Posted

Hello!

This script should decrease 1% exp if the player is killed by mob otherwise if killed by a player it decrease 2% exp.

The problem here is that for both condition it decreases only 0.9%.

OnPCDieEvent:
 if (!$@MapFlagStatus) end;
 if (killerrid < 5000000) { // Lower ID's are humans, killerrid = account_id
	 dispbottom "You have been killed by "+rid2name(killerrid)+".";
	 callfunc "PenaltyBaseExp",2; // 2%
  } else {
	 // Higher values... monsters
	 callfunc "PenaltyBaseExp",1; // 1%
  }
}
function script PenaltyBaseExp {
  if (BaseExp) {
	 set BaseExp, BaseExp - (BaseExp / 100 * getarg(0));
 //set BaseExp, BaseExp - (BaseExp * ( getarg(0)/100));
	 announce "~ Nightmare Penalty: -" + getarg(0) + "% Base Exp", bc_self, 0xEAC8E7;
  }
  return;
}

7 answers to this question

Recommended Posts

Posted

You could always use this feature o_o https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/conf/battle/exp.conf

// When a player dies, how should we penalize them?
// 0 = No penalty.
// 1 = Lose % of current level when killed.
// 2 = Lose % of total experience when killed.
death_penalty_type: 1
// Base exp. penalty rate (Each 100 is 1% of their exp)
death_penalty_base: 100
// Job exp. penalty rate (Each 100 is 1% of their exp)
death_penalty_job: 100

Posted (edited)

You could always use this feature o_o https://rathena.svn....battle/exp.conf

// When a player dies, how should we penalize them?
// 0 = No penalty.
// 1 = Lose % of current level when killed.
// 2 = Lose % of total experience when killed.
death_penalty_type: 1
// Base exp. penalty rate (Each 100 is 1% of their exp)
death_penalty_base: 100
// Job exp. penalty rate (Each 100 is 1% of their exp)
death_penalty_job: 100

Im using the my code because im just enabling the Penalty when my event is active..

and also from the code, im comparing whether killed by mob or by player.

Edited by RCharles
Posted

try this ?

set BaseExp, BaseExp - (( BaseExp * getarg(0) ) / 100 );

btw....your monster ID...all are above this value ?

5000000

huh ? you sure ?

Posted (edited)

@Emistry

I will try it asap...

------------------------------------------------------------------

is killerrid in mob = monsterid?

Do you have the suggestion on what should it be?

----------------------------------------------------------------

Using this:

dispbottom "You have been killed by "+killerrid+".";

im killed by a poring. then the poring killerrid is 110012049

Edited by RCharles
Posted

OnPCKillEvent / OnNPCKillEvent will save the killed data into killedrid

OnPCDieEvent will save the killer data into killerrid

OnNPCKillEvent:
OnPCKillEvent:
dispbottom "You killed "+rid2name(killedrid);

OnPCDieEvent:
dispbottom "You killed by "+rid2name(killerrid);

if monster killed you or you killed monster..

it will save the monster id

if player killed you or you killed player

it will save player id

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...