Jump to content

Home

stealth mode behaviour. a little help please -_-'


jinger

Recommended Posts

Spawn in stealth mode, get close, then attack, and here I thought it would be that simple :) please help! i have found that creatures can spawn in stealth mode only if they're not in front of you, say in another room…

[size=1]	ActionUseSkill(
	SKILL_STEALTH,OBJECT_SELF,0,
	GetItemInSlot(INVENTORY_SLOT_BELT)
);[/size]

…but it takes a couple of seconds for them to disappear and when one enters combat mode all the rest do as well, so i figure l'll just have to script the whole ai to avoid that (and to make them come close before an attack). Any help would be a great help ;)

 

If only I knew how to execute a script when a creature succeeds with an attack… well I could emulate the stealth mode this way:

1- spawn: turn off rendering and make invisible.

2- enemy damaged: turn on rendering, make visible, apply the uncloak vfx, reduce base attack.

 

it'd be definitely much easyer

Link to comment
Share on other sites

never mind, this seems to work, any corrections would be welcome anyway

[size=1]
#include "k_inc_generic"
#include "k_inc_debug"

void Uncloak();

void main(){
int nUser = GetUserDefinedEventNumber();
if(nUser == 1003) // END OF COMBAT
{
	if(!GetLocalBoolean(OBJECT_SELF,42) && GetLastAttackResult()){
		Uncloak();
	}
}else if(nUser == 1005) // ATTACKED
{
	if(!GetLocalBoolean(OBJECT_SELF,42)) Uncloak();
}else if(nUser == HOSTILE_RETREAT)
{
	UT_ReturnToBase();
}
}


void Uncloak(){
RemoveEffect(OBJECT_SELF,EffectInvisibility(INVISIBILITY_TYPE_NORMAL));
ApplyEffectToObject(
	DURATION_TYPE_PERMANENT,
	EffectVisualEffect(8001),
	OBJECT_SELF
);
EnableRendering(OBJECT_SELF,TRUE);
SetLocalBoolean(OBJECT_SELF,42,TRUE);
}[/size]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...