Jump to content
  • 0
Sign in to follow this  
Salty

Set base_exp gain to 0 at certain level

Question

Hello!
I know I found this source edit somewhere on the forums here a while ago but I can't for the life of me find it anywhere.

Essentially I want to make it so that when a player reaches level 195, their base experience gain from any monster kill is set to 0. This essentially soft caps the max level to 195 until a player does a

quest chain to reach level 200, which is the real maximum.

 

I'm pretty sure it's an easy config in the mob.c file but I can't seem to remember where to put it.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I just solved the other topic by reading the mob_dead function ... LOL

#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"NoEXP_Gain",	SERVER_TYPE_MAP,	"0.1",	HPM_VERSION,};int max_lv_exp_gain = 99;int pc_checkbaselevelup_pre( struct map_session_data *sd ) {	nullpo_ret(sd);	if ( (int)sd->status.base_level >= max_lv_exp_gain ) {		sd->status.base_exp = 0;		hookStop();		return false;	}	return true;}HPExport void plugin_init (void) {	addHookPre( "pc->checkbaselevelup", pc_checkbaselevelup_pre );}
just like this is enough,

this line in mob.c

party->exp_share(pt[i].p, &md->bl, pt[i].base_exp,pt[i].job_exp,pt[i].zeny);
I saw party_exp_share function also runs pc_gainexp function, so just hook this 1 function enough

 

EDIT: erm ... it seems to block job_exp gain ... now fixing ...

EDIT2: ok done

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0
http://herc.ws/wiki/Hercules_Plugin_Manager
//===== Hercules Plugin ======================================//= Maximum Level Exp Gain//===== By: ==================================================//= AnnieRuru//===== Current Version: =====================================//= 0.2//===== Compatible With: ===================================== //= Hercules 2015-12-19//===== Description: =========================================//= stop players from gaining exp after certain level//===== Topic ================================================//= http://herc.ws/board/topic/11510-set-base-exp-gain-to-0-at-certain-level//===== Additional Comments: =================================  //= the 1st one I did has a battle config//============================================================#include "common/hercules.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include "map/pc.h"#include "common/nullpo.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = {	"MaxLvExpGain",	SERVER_TYPE_MAP,	"0.2",	HPM_VERSION,};int max_lv_exp_gain = 99;void battle_config_setting( const char *key, const char *val ) {	if ( !strcmpi( key, "max_lv_exp_gain" ) )		max_lv_exp_gain = atoi(val);}int return_battle_config( const char *key ) {	if ( !strcmpi( key, "max_lv_exp_gain" ) )		return max_lv_exp_gain;	return 0;}int pc_checkbaselevelup_pre( struct map_session_data *sd ) {	nullpo_ret(sd);	if ( (int)sd->status.base_level >= max_lv_exp_gain ) {		sd->status.base_exp = 0;		hookStop();		return false;	}	return true;}HPExport void server_preinit (void) {	addBattleConf( "max_lv_exp_gain", battle_config_setting, return_battle_config );}HPExport void plugin_init (void) {	addHookPre( "pc->checkbaselevelup", pc_checkbaselevelup_pre );}
hahaha ... Edited by AnnieRuru

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.