2. can it be use as script onPCLogin?? and does this one stop gaining exp from mvp too?

utofaery

New member
Messages
101
Points
0
#include "common/hercules.h"
#include "map/pc.h"
#include "common/nullpo.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
"blockexp",
SERVER_TYPE_MAP,
"0.1",
HPM_VERSION,
};

bool pc_authok_post( bool retVal, struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers ) {
if ( retVal == false )
return false;
if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) == true )
clif->message( sd->fd, "@blockexp turn ON." );
return true;
}

bool pc_gainexp_pre( struct map_session_data **sd, struct block_list **src, uint64 *base_exp, uint64 *job_exp, bool *is_quest ) {
nullpo_ret(*sd);
if ( *src == NULL && pc_readglobalreg( *sd, script->add_variable("blockexp") ) == true )
*base_exp = 0;
return true;
}

void pc_calcexp_post( struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src ) {
if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) == true )
*base_exp = 0;
return;
}

ACMD(blockexp) {
if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) ) {
clif->message( sd->fd, "@blockexp turn OFF." );
pc_setglobalreg( sd, script->add_variable("blockexp"), false );
}
else {
clif->message( sd->fd, "@blockexp turn ON." );
pc_setglobalreg( sd, script->add_variable("blockexp"), true );
}
return true;
}

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


As Topic

 
yes it block exp from anything, including script commands *getexp

if you want to block from OnPCLoginEvent, just use player variable, don't use atcommand

- script BmapMobList -1,{
OnPCLoginEvent:
blockexp = true;
dispbottom _( "You no longer gain experience." ), C_WHITE;
end;
}


something like that

 
Back
Top