Log in

View Full Version : Moving mobs


Razzel
12-06-2008, 12:07 PM
Is there a way I can get a mob to move somewhere and then stay there? Whenever I use MoveTo(), the mob will move to the location and then immediately go right back to where it spawned.

joligario
12-06-2008, 09:59 PM
Spawn him on a grid and when he gets to the end, respawn him off of grid.

cavedude
12-07-2008, 12:35 AM
Or set a huge pause on the last grid_entry.

Razzel
12-07-2008, 01:25 AM
Is there anyway to do this within the context of a script though? I wanted to have scripts for mobs that would allow them to strategically move to different locations in battle. Like a rogue getting behind a player or a caster moving a safe distance away from the fighting. I can get them to move to these places but as soon as they get there, they turn around and go back to their spawn point. Waypoints would work if it was a pre-planned move but I'm trying to get the mobs to decide where to move within the script based on the location of the players and other factors.

Striat
12-07-2008, 02:03 AM
You're npcs are returning to their guard spots.

You'll want to use $npc->SaveGuardSpot(0); to prevent the return. for example,

sub EVENT_WAYPOINT {
$npc->SaveGuardSpot(0);
}

Razzel
12-07-2008, 02:23 AM
Awesome, it works. Thanks

trevius
12-07-2008, 05:32 AM
Holy cow, Strait! I am saving that info for later use!