viewing paste topic/11141-k koe_char_0.2.c | C

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#include "common/hercules.h"
#include "map/pc.h"
#include "map/mob.h"
#include "map/mapreg.h"
#include "map/battle.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"
 
HPExport struct hplugin_info pinfo = {
    "koe_char",
    SERVER_TYPE_MAP,
    "0.2",
    HPM_VERSION,
};
 
int battle_check_target_post( int retVal, struct block_list *src, struct block_list *target, int flag ) {
    if ( retVal == 1 ) {
        struct block_list *s_bl = src;
        if ( ( s_bl = battle->get_master(src) ) == NULL )
            s_bl = src;
        if ( s_bl->type == BL_PC && target->type == BL_MOB ) {
            TBL_PC *sd = BL_CAST( BL_PC, s_bl );
            TBL_MOB *md = BL_CAST( BL_MOB, target );
            if ( ( ( md->class_ == MOBID_EMPELIUM || md->class_ == MOBID_BARRICADE_ ) && !strcmp( mapindex_id2name(sd->mapindex), "ordeal_1-1" ) ) &&
                ( sd->status.account_id == mapreg->readreg( script->add_str("$koeaid") ) || battle->get_current_skill(src) > 0 ) )
                return 0;
        }
    }
    return retVal;
}
 
HPExport void plugin_init (void) {
    addHookPost( battle, check_target, battle_check_target_post );
}
Viewed 971 times, submitted by AnnieRuru.