Jump to content
  • 0
Sign in to follow this  
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

Recommended Posts

  • 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
On 5/16/2018 at 11:21 PM, 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_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

Edited by AnnieRuru

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

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.