RCharles Posted July 27, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 154 Reputation: 10 Joined: 05/31/12 Last Seen: May 15, 2014 Share Posted July 27, 2012 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; } Quote Link to comment Share on other sites More sharing options...
Mystery Posted July 27, 2012 Group: Members Topic Count: 94 Topics Per Day: 0.02 Content Count: 2192 Reputation: 253 Joined: 11/11/11 Last Seen: June 24, 2020 Share Posted July 27, 2012 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 Quote Link to comment Share on other sites More sharing options...
RCharles Posted July 27, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 154 Reputation: 10 Joined: 05/31/12 Last Seen: May 15, 2014 Author Share Posted July 27, 2012 (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 July 27, 2012 by RCharles Quote Link to comment Share on other sites More sharing options...
Mystery Posted July 27, 2012 Group: Members Topic Count: 94 Topics Per Day: 0.02 Content Count: 2192 Reputation: 253 Joined: 11/11/11 Last Seen: June 24, 2020 Share Posted July 27, 2012 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 Quote Link to comment Share on other sites More sharing options...
RCharles Posted July 27, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 154 Reputation: 10 Joined: 05/31/12 Last Seen: May 15, 2014 Author Share Posted July 27, 2012 yeah.. I already did.. Im also confused on why is it 0.9% for both.. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 28, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 18 hours ago Share Posted July 28, 2012 try this ? set BaseExp, BaseExp - (( BaseExp * getarg(0) ) / 100 ); btw....your monster ID...all are above this value ? 5000000 huh ? you sure ? Quote Link to comment Share on other sites More sharing options...
RCharles Posted July 29, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 154 Reputation: 10 Joined: 05/31/12 Last Seen: May 15, 2014 Author Share Posted July 29, 2012 (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 July 29, 2012 by RCharles Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 29, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 18 hours ago Share Posted July 29, 2012 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 Quote Link to comment Share on other sites More sharing options...
Question
RCharles
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%.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.