Jump to content
  • 0

setBaseExp problem


RCharles

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   8
  • Joined:  05/31/12
  • Last Seen:  

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;
}

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   8
  • Joined:  05/31/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

Oh right, your event. Have you tried changed 100 to 101? o_o. Though, as stated, 100 should be 1% and not 0.9%.. o_o

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   8
  • Joined:  05/31/12
  • Last Seen:  

yeah.. I already did.. Im also confused on why is it 0.9% for both..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try this ?

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

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

5000000

huh ? you sure ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   8
  • Joined:  05/31/12
  • Last Seen:  

@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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites

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.

×
×
  • Create New...