Wandering mobs do not stop to fight

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Wandering mobs do not stop to fight

Post by John Adams » Sun Aug 10, 2008 6:44 pm

So I walked up to one of my invaders who is set to wander off shortly... attacked him, and beat him down a ways - then suddenly, he wanders off!! exactly as I instructed - however, I was fighting him at the time, so maybe they should ignore their moveto commands while in combat?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sun Aug 10, 2008 8:54 pm

I have an opposite effect to this which I'll just lump in here. Using the new factions, I got the Invaders to wander to the two Defenders and get killed. It was thrilling to watch :)
However, when the invaders respawned, they did not move. Only one round of invaders per /repop.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Aug 11, 2008 3:29 am

When a mob respawns they call the respawn function of the LUA scripts. So you will need to have the same commands in both spawn and respawn functions. Alternatively you can create a LUA function in the script and just call it from both.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Aug 11, 2008 6:27 am

Is there any reason why a respawned mob will not continue it's previous course of action automatically? Meaning, if a wandering gobbie gets killed, respawns 60 seconds later, why would it not just assume it needs to wander again?
We can write our scripts with the respawn function, I am just curious.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Aug 11, 2008 2:31 pm

Well when a spawn is removed from the zone all information associated with the spawn is removed as well so that when the new spawn respawns it is a fresh version of the spawn. The new spawn will have no knowledge of any previous spawn commands you gave to the last spawn which is why you need to include the commands in the respawn method as spawn is only called for the first spawned instance of the spawn.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Aug 11, 2008 4:31 pm

~singing~ "Spawn, spawn, spawn, spawn, spawn-diddy spawn wonderful spawn!"
ugh...

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Aug 11, 2008 7:18 pm

Ok, part 2 of this is resolved by doing what you said, and using the function respawn(NPC):

Code: Select all

function respawn(NPC)
	spawn(NPC)
end 
However, I still have part 1 that is a problem. :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Tue Aug 12, 2008 2:25 pm

Yah, I am rewriting a lot of the NPC aattack and faction code so that will be fixed with it.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests