chrismed0
10-05-2012, 06:35 AM
Hello,
Writting a quest for an ENTER / EXIT event that has a proximity. Seems pritty strait forward but I'm having a little problem and have searched and haven't been able to find the answer yet.
What I'm trying to do is turn "FlyMode" on when entering the proximity of the NPC and turn it off when leaving the proximity. The catch, the NPC moves.
I need the proximity to stay with the NPC and not where the NPC spawns.
This is a boat. So I want FlyMode to stay on while on the boat and when you exit it turns off.
I have tried:
sub EVENT_SPAWN
{
quest::set_proximity( $x -100, $x +100, $y -50, $y +50, $z -150, $z +150);
}
sub EVENT_ENTER
{
quest::FlyMode(2);
}
sub EVENT_EXIT
{
quest::FlyMode(0)
}
and this:
sub EVENT_SPAWN
{
$x = $npc->GetX();
$y = $npc->GetY();
quest::set_proximity($x - 100, $x + 100, $y - 200, $y + 200);
}
sub EVENT_ENTER
{
quest::FlyMode(2)
}
sub EVENT_EXIT
{
quest::FlyMode(0)
}
Both work great but the proximity doesn't follow the NPC it stays where the NPC spawns.
Not sure how to make it follow the NPC and can't find a refrence.
thanks
~edit~
I was thinking, If you can't make the proximity follow the NPC could you make the proximity follow the PC.
With maybe a player.pl for that zone. When ever the PC gets close to "x" npc then "this" happens. And when ever the PC leaves the proximity of "x" NPC then "this" happens?
Writting a quest for an ENTER / EXIT event that has a proximity. Seems pritty strait forward but I'm having a little problem and have searched and haven't been able to find the answer yet.
What I'm trying to do is turn "FlyMode" on when entering the proximity of the NPC and turn it off when leaving the proximity. The catch, the NPC moves.
I need the proximity to stay with the NPC and not where the NPC spawns.
This is a boat. So I want FlyMode to stay on while on the boat and when you exit it turns off.
I have tried:
sub EVENT_SPAWN
{
quest::set_proximity( $x -100, $x +100, $y -50, $y +50, $z -150, $z +150);
}
sub EVENT_ENTER
{
quest::FlyMode(2);
}
sub EVENT_EXIT
{
quest::FlyMode(0)
}
and this:
sub EVENT_SPAWN
{
$x = $npc->GetX();
$y = $npc->GetY();
quest::set_proximity($x - 100, $x + 100, $y - 200, $y + 200);
}
sub EVENT_ENTER
{
quest::FlyMode(2)
}
sub EVENT_EXIT
{
quest::FlyMode(0)
}
Both work great but the proximity doesn't follow the NPC it stays where the NPC spawns.
Not sure how to make it follow the NPC and can't find a refrence.
thanks
~edit~
I was thinking, If you can't make the proximity follow the NPC could you make the proximity follow the PC.
With maybe a player.pl for that zone. When ever the PC gets close to "x" npc then "this" happens. And when ever the PC leaves the proximity of "x" NPC then "this" happens?