How i do make a invencible mob?

luizragna

New member
Messages
114
Points
0
Location
In their hearts
Emulator
Hello everyone, How do I make this unit invincible?

Code:
 universe,19,40,4	script	Huena#OP	1_F_MARIA,{
	 
	 	set .@amount,1;
		for (.@i = 0; .@i < .@amount; .@i++) {
	.mobGID = monster ("universe",20,36,"[Teste] Puto",1004,1);
		setunitdata .mobGID,UDT_LEVEL,7;
		setunitdata .mobGID,UDT_MAXHP,10;
		setunitdata .mobGID,UDT_HP,10;
		
		}
 
i cant think of a way to make an individual mob invincible, but you could make a mapflag for mob's not receiving damage

 
luizragna said:
In case, I can not attack mob.
I want to attack mob and he gets 0 damage.
let's see ...

Code:
#include "common/hercules.h"
#include "map/pc.h"
#include "map/mob.h"
#include "map/battle.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"
HPExport struct hplugin_info pinfo = {
	"Poring invincible",
	SERVER_TYPE_MAP,
	"0_0",
	HPM_VERSION,
};
int64 battle_calc_damage_pre(struct block_list **src,struct block_list **bl,struct Damage **d,int64 *damage,uint16 *skill_id,uint16 *skill_lv) {
	struct block_list *s_bl = *src;
	if ( (s_bl = battle->get_master(*src)) == NULL ) {
		s_bl = *src;
	}
	if ( s_bl->type == BL_PC && (*bl)->type == BL_MOB ) {
		TBL_PC *sd = BL_CAST( BL_PC, s_bl );
		TBL_MOB *md = BL_CAST( BL_MOB, *bl );
		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) && md->class_ == 1002 ) {
			hookStop();
			return 0;
		}
	}
	return 0;
}
HPExport void plugin_init (void) {
	addHookPre( battle, calc_damage, battle_calc_damage_pre );
}
still can agi down the mob ... etc
lazy to do the rest

EDIT: some other answers on rathena forum ...

NPC_INVINCIBlE = SC_INVINCIBLE ....
means dealing 1 damage .... not 0 damage though

EDIT2:

change BL_UCAST into BL_CAST
BL_UCAST should be only use in iteration

 
Last edited by a moderator:
let's see ...

Code:
#include "common/hercules.h"
#include "map/pc.h"
#include "map/mob.h"
#include "map/battle.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"
HPExport struct hplugin_info pinfo = {
	"Poring invincible",
	SERVER_TYPE_MAP,
	"0_0",
	HPM_VERSION,
};
int64 battle_calc_damage_pre(struct block_list **src,struct block_list **bl,struct Damage **d,int64 *damage,uint16 *skill_id,uint16 *skill_lv) {
	struct block_list *s_bl = *src;
	if ( (s_bl = battle->get_master(*src)) == NULL ) {
		s_bl = *src;
	}
	if ( s_bl->type == BL_PC && (*bl)->type == BL_MOB ) {
		TBL_PC *sd = BL_UCAST( BL_PC, s_bl );
		TBL_MOB *md = BL_UCAST( BL_MOB, *bl );
		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) && md->class_ == 1002 ) {
			hookStop();
			return 0;
		}
	}
	return 0;
}
HPExport void plugin_init (void) {
	addHookPre( battle, calc_damage, battle_calc_damage_pre );
}
still can agi down the mob ... etc
lazy to do the rest

EDIT: some other answers on rathena forum ...

NPC_INVINCIBlE = SC_INVINCIBLE ....
means dealing 1 damage .... not 0 damage though
It's a plugin?
What i do after add this plugin?

 
Back
Top