Jump to content
Sign in to follow this  
Naruto

onenemystatus monster target condition

Recommended Posts

Hi im trying to develop some advance monster commands/conditions

 

Having issues... i think linking the sub protocol with the primary function ? 

 

But It works fine when i replace it completely in the src 

 

mob.c

static int mob_getfriendstatus_sub(struct block_list *bl, va_list ap)
{
	int cond1,cond2;
	struct mob_data **fr = NULL, *md = NULL, *mmd = NULL;
	int flag=0;

	nullpo_ret(bl);
	Assert_ret(bl->type == BL_MOB);
	md = BL_UCAST(BL_MOB, bl);
	nullpo_ret(mmd=va_arg(ap,struct mob_data *));

	if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) )
		return 0;

	if (battle->check_target(&mmd->bl,bl,BCT_ENEMY)>0)
		return 0;
	cond1=va_arg(ap,int);
	cond2=va_arg(ap,int);
	fr=va_arg(ap,struct mob_data **);
	if( cond2==-1 ){
		int j;
		for(j=SC_COMMON_MIN;j<=SC_MAX && !flag;j++){
			if ((flag=(md->sc.data[j] != NULL))) //Once an effect was found, break out. [Skotlex]
				break;
		}
	}else
		flag=( md->sc.data[cond2] != NULL );
	if( flag^( cond1==MSC_FRIENDSTATUSOFF ) )
		(*fr)=md;

	return 0;
}

 

Lets go over the code together 

	if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) )
		return 0;
Quote

// 0x010: If set, mob skills defined for friends will also trigger on themselves.

Not positive what the first part is about but its not important to my release so lets just delete this entire thing... thinking about it i need to test if it effects themselves without it... really easy to spot though so lets leave it be

 

	if (battle->check_target(&mmd->bl,bl,BCT_ENEMY)>0)
		return 0;

This is what limits it to friends

 

static int mob_getfriendstatus_sub(struct block_list *bl, va_list ap)
{
	int cond1,cond2;
	struct mob_data **fr = NULL, *md = NULL, *mmd = NULL;
	int flag=0;

	nullpo_ret(bl);
	Assert_ret(bl->type == BL_MOB);
	md = BL_UCAST(BL_MOB, bl);
	nullpo_ret(mmd=va_arg(ap,struct mob_data *));

	cond1=va_arg(ap,int);
	cond2=va_arg(ap,int);
	fr=va_arg(ap,struct mob_data **);
	if( cond2==-1 ){
		int j;
		for(j=SC_COMMON_MIN;j<=SC_COMMON_MAX && !flag;j++){
			if ((flag=(md->sc.data[j] != NULL))) //Once an effect was found, break out. [Skotlex]
				break;
		}
	}else
		flag=( md->sc.data[cond2] != NULL );
	if( flag^( cond1==MSC_FRIENDSTATUSOFF ) )
		(*fr)=md;

	return 0;
}

 

 

so now in your mob skill db

	nanobot: 
	{
		NPC_SELFDESTRUCTION: {
			SkillState: "MSS_ANY"
			SkillLevel: 1
			Rate: 10000
			Delay: 0
			Cancelable: false
			SkillTarget: "MST_SELF"
			CastCondition: "MSC_FRIENDSTATUSON"
			ConditionData: "SC_BERSERK"
		}
	}

 

 

so now we should trigger skills on monster status 

 

giphy.gif

 

 

Now im having an issue with using my CUSTOM status as triggers though...


Ive tried adding them to my constants file...

 

Ill let you know if i figure out more 

 

 

BTW: the rest wont bother you.... and i plan on replacing onfriendstatusoff with the old onfriendstatuson . . . 

 

 

Edited by Naruto

Share this post


Link to post
Share on other sites

So after testing it doesnt seem like the monster with the AI dedicated to setting off a skill when their target is effect by a status

 

Lets go over the code together 

	if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) )
		return 0;
	if( mmd->bl.id == bl->id && !(battle_config.mob_ai&0x10) )
		return 0;
  Quote
// 0x010: If set, mob skills defined for friends will also trigger on themselves.

Not positive what the first part is about but its not important to my release so lets just delete this entire thing... thinking about it i need to test if it effects themselves without it... really easy to spot though so lets leave it be

 

But

It seems like cloaking is messing with my followers... let me know if you notice anything strange though if you plan on using this code

 

 

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
Reply to this topic...

×   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.