Cloak of Invisiblity

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Cloak of Invisiblity
Warrior
Member # 5274
Profile #0
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

--------------------
I assume my reputation for arrogant presumption precedes me
Posts: 107 | Registered: Thursday, December 9 2004 08:00
...b10010b...
Member # 869
Profile Homepage #1
I remember someone mentioning attempting something like this in the very early days of these forums, by a fairly similar method to what you suggest. I've no idea how far they got with it.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Infiltrator
Member # 5576
Profile Homepage #2
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.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Warrior
Member # 5274
Profile #3
Wow that's great, I'm glad somebody managed to do it. I'll have a fool round later and see if i can come up with something similar.

You should post that on the script codex or something, see if anyones interested.

--------------------
I assume my reputation for arrogant presumption precedes me
Posts: 107 | Registered: Thursday, December 9 2004 08:00
Infiltrator
Member # 5576
Profile Homepage #4
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:
if (dist_to_char(get_target()) <= 16)
set_state(3);
else set_target(ME,-1);
}
to being:
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.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00