Jump to content

Cloak of Invisiblity


Poit

Recommended Posts

Hey I was just wondering about the possiblity of imbuing an item with either a script or function that would give the effect of invisibility for a player.

 

I've considered trying to toy with the set_town_hostile calls so that when the cloak or charm is equipped all monsters would become neutral. This is all just theory at the moment but I'm wondering if anyone else has either thought of a similar idea or achieved this effect.

 

-cheers

Link to comment
Share on other sites

I have made an item which gives an 'invisibility' effect; it sets an SDF, and then I have swapped basicnpc for an altered copy which makes creatures forget their target if the target is in the party and the SDF is set. It seems to work fine, and can give more complex behaviors, such as, if you are invisible and hit a hostile creature, it will notice and attack you.

Link to comment
Share on other sites

I could, but the trouble is that the code is divided into a number of pieces in different scripts (basicnpc, the scenario script START_STATE and in another scenario script state), and I also added another feature to my basicnpc which adds a lot of code and isn't fully debugged yet. The important part is in basicnpc, where for instance I changed:

Code:
 if (dist_to_char(get_target()) <= 16)	set_state(3);	else set_target(ME,-1);} 
to being:

Code:
  if ((dist_to_char(get_target()) <= 16) && ((get_flag(299,26) == 0) || (char_in_group(get_target(),0) == 0))){	   set_state(3);}else 	set_target(ME,-1);
where flag(299,26) is my invisiblity counter flag.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...