PDA

View Full Version : Having monster attack player when spawns.


Randymarsh9
04-18-2009, 10:03 AM
I am trying to get this to happen. The player talks to one person and then that person will disappear and spawn another NPC. I am trying to make that monster attack the player right when it spawns, but it isn't working. I tried Sub EVENT_SPAWN{
quest::attack($name);
}
and also tried setting up a proximity for the mob when it spawns and have it attack anyone who enters that proximity. Neither of these worked.

Randymarsh9
04-18-2009, 11:46 AM
Also, i was testing
sub EVENT_SPAWN{
quest::attack($char);
}
on a mob in gfay to see if it worked, and when the monster spawns it just says "I am unable to attack."

covou
04-18-2009, 12:36 PM
A round about way of doing it would be to have the mob set a temp global with the persons name who spoke to them as the value. Make sure you put this command BEFORE the depop command or it may result in errors.


and then when the mob spawns
sub EVENT_SPAWN
{
quest::attack($qglobals{TempGlobal});
quest::delglobal("TempGlobal");
}

Randymarsh9
04-18-2009, 12:40 PM
I'm not sure how I would write that first part. I am not very good with globals.

So_1337
04-18-2009, 12:42 PM
Why bother with scripting a quest file? Just set the NPC to a KOS faction.

Randymarsh9
04-18-2009, 12:44 PM
Wow, I didn't even think about that. Just make it KoS and have a huge aggro radius

So_1337
04-18-2009, 12:47 PM
Bingo =)

(Extra text here to satisfy the stupid 10 character minimum per post.)

covou
04-18-2009, 02:26 PM
quest::setglobal('TempGlobal','$name',7,'H1');

Add that before your quest::depop();....

agro is also fine, but be aware you can't control who it agro's with KoS faction =D