MaxLvExpGain

AnnieRuru

~~Cute~Cute~Scripter~~
Messages
1,677
Points
0
Location
your next door ~
Discord
AnnieRuru#1609
Github
AnnieRuru
Emulator
Client Version
2019-05-30aRagexeRE
I saw a lot of methods on how to stop players from gaining exp after certain level
but all of them have flaws, so I release mine, its from my google drive

Download: 1.3
plugin

Full Description of what this plugin DO

  • stop players gain exp through killing monsters, mvp exp, or share party experience
  • allows to gain exp by *getexp script command or BaseExp++ / JobExp++
  • allows players to pay guild tax exp after they hit your capped level value
  • if your server has heal_exp, resurrection_exp or shop_exp enable,
    they will stop gain exp from these action after they hit your cap level
  • if the player do SA_LEVELUP ( a random skill from Hocos-Pocus ) after the cap level, they can't gain exp
if it doesn't follow this list, then this is bug

there is a small issue with this plugin,

without this plugin, which follow the official server rule
when the sage already hit the capped level,
sage class can use 1 of the skill from hocus-pocus' SA_LEVELUP to pay huge exp to the guild as tax
after install this plugin,
when the sage already hit the capped level in the config,
sage class hocus-pocus' SA_LEVELUP is broken, no exp gain, and cannot pay exp to the guild using this skill
everything else in the above list will still works, don't worry, tested

0.2 - topic
- reset BaseExp gain after certain level

1.0 - plugin
- stop BaseExp/JobExp gain after certain level

1.1 - plugin
- fixed an issue that when player hit that cap level, they are unable to pay guild tax exp
- fixed an issue that player should've stop earning exp, but they are actually gain 1 exp
--- blame to the cap_value command inside pc_calcexp function

1.1a
- fixed player can still gain exp by spamming hocus-pocus skill, SA_LEVELUP to be exact

1.2 - plugin
-- fixed an issue that when player hit that cap level, they are unable to pay guild tax exp ... again ...

1.3 - plugin
-- update to latest revision, thanks to Dastgir for upkeeping

 
Last edited by a moderator:
+1 rep for this very useful plugin (and not a script or src based)
default_no1.gif
:no1:
default_no1.gif


 
1.1

- fixed an issue that when player hit that cap level, they are unable to pay guild tax exp

- fixed an issue that player should've stop earning exp, but they are actually gain 1 exp

--- blame to the cap_value command inside pc_calcexp function

1.1a

plugin

- fixed player can still gain exp by spamming hocus-pocus skill, SA_LEVELUP to be exact

 
Last edited by a moderator:
default_swt3.gif


... fix the guild exp tax gain, hocus-pocus broken

then I fix hocus-pocus, guild exp tax NOW break again ...

these 2 seems to hate each other

haiz ... have to make a decision

1.2

plugin

- fixed an issue that when player hit that cap level, they are unable to pay guild tax exp ... again ...

.

.
there is an issue with this plugin,

without this plugin, which follow the official server rule

when the sage already hit the capped level,

sage class can use 1 of the skill from hocus-pocus' SA_LEVELUP to pay huge exp to the guild as tax
after install this plugin,

when the sage already hit the capped level in the config,

sage class hocus-pocus' SA_LEVELUP is broken, no exp gain, and cannot pay exp to the guild using this skill
in other words, SA_LEVELUP skill from hocus-pocus is nullify after the player hit the cap levelin order to make experience tax to the guild from killing normal monster works

everything else at the above list will still works, don't worry, tested

if somebody has a better idea how to fix this rare bug, always welcome any suggestion

 
Last edited by a moderator:
Hello this happens when compiling in windows. what should i do?
 

1>------ Build started: Project: MaxLvExpGain, Configuration: Debug Win32 ------
1>  MaxLvExpGain.c
1>..\src\plugins\MaxLvExpGain.c(104): warning C4003: not enough actual parameters for macro 'addBattleConf'
1>..\src\plugins\MaxLvExpGain.c(104): error C2059: syntax error : ')'
1>..\src\plugins\MaxLvExpGain.c(105): warning C4003: not enough actual parameters for macro 'addBattleConf'
1>..\src\plugins\MaxLvExpGain.c(105): error C2059: syntax error : ')'
1>..\src\plugins\MaxLvExpGain.c(109): warning C4013: 'addHookPre' undefined; assuming extern returning int
1>..\src\plugins\MaxLvExpGain.c(110): warning C4013: 'addHookPost' undefined; assuming extern returning int
========== Build: 0 succeeded, 1 failed, 8 up-to-date, 0 skipped ==========
 
errormax.PNG

 
Last edited by a moderator:
Change to this:

HPExport void server_preinit (void) {
addBattleConf( "max_blv_exp_gain", battle_config_setting, return_battle_config, false );
addBattleConf( "max_jlv_exp_gain", battle_config_setting, return_battle_config, false );
}

HPExport void plugin_init (void) {
addHookPre( pc, gainexp, pc_gainexp_pre );
addHookPost( pc, calcexp, pc_calcexp_post );
}


But be careful, i tried it, and it blocks exp gain for all player regardless of my battle conf.

I still don't know why x)

 
Change these 2 lines for the meantime:

int max_blv_exp_gain = 5; // when player reach this BaseLevel, they stop gain BaseExp

int max_jlv_exp_gain = 5; // when player reach this JobLevel, they stop gain JobExp

I just learned that addBattleConf needs some changes so that it can read from battle folder.

 
Last edited by a moderator:
Change to this:

HPExport void server_preinit (void) {
addBattleConf( "max_blv_exp_gain", battle_config_setting, return_battle_config, false );
addBattleConf( "max_jlv_exp_gain", battle_config_setting, return_battle_config, false );
}

HPExport void plugin_init (void) {
addHookPre( pc, gainexp, pc_gainexp_pre );
addHookPost( pc, calcexp, pc_calcexp_post );
}


But be careful, i tried it, and it blocks exp gain for all player regardless of my battle conf.

I still don't know why x)
I get the follow error:

1>------ Build started: Project: proyecto: MaxLvExpGain, Configuration: Debug Win32 ------
1> MaxLvExpGain.c
1>..\src\plugins\MaxLvExpGain.c(109): warning C4013: 'addHookPre' undefined; It is assumed that extern returns as int result
1>..\src\plugins\MaxLvExpGain.c(109): error C2065: 'gainexp' : undeclared identifier
1>..\src\plugins\MaxLvExpGain.c(110): warning C4013: 'addHookPost' undefined; It is assumed that extern returns as int result
1>..\src\plugins\MaxLvExpGain.c(110): error C2065: 'calcexp' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm using the latest Herc.

:s

 
Ups forget to tell you to also import the HPM Hooking system

Add this: #include "plugins/HPMHooking.h"

so it looks like this:

Code:
#include "common/hercules.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "map/pc.h"
#include "common/memmgr.h"
#include "common/nullpo.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"
 
1.3 .... plugin
well just copy paste from Dastgir's topic

and split 2 posts from this topic for the "@blockexp" request

 
Last edited by a moderator:
Back
Top