• 0
Sign in to follow this  
Followers 0
luizragna

How i do make a invencible mob?

Question

Hello everyone, How do I make this unit invincible?

 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;
		
		}

 

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

https://rathena.org/board/topic/115702-how-i-do-make-a-invencible-mob/
unfortunately, hercules doesn't have the script command to make monster immune ...

although I have a better idea on how to do this ...but I have to say currently hercules mob controller system is f*ck up
better fix existing one 1st before moving on implement new stuffs

Share this post


Link to post
Share on other sites
  • 0

i cant think of a way to make an individual mob invincible, but you could make a mapflag for mob's not receiving damage

Share this post


Link to post
Share on other sites
  • 0
21 hours ago, luizragna said:

In case, I can not attack mob.
I want to attack mob and he gets 0 damage.

let's see ...

#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

Share this post


Link to post
Share on other sites
  • 0
On 16/05/2018 at 9:56 PM, AnnieRuru said:

let's see ...

#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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0