movenpc function
i couldnt find a function to move an npc so i decided to make one
there may be a few errors since i only know the basics of C++ parser.cpp Code:
else if (!strcmp(strlwr(command),"movenpc")) { Code:
"sub movenpc{push(@cmd_queue,{func=>'movenpc',args=>join(',',@_)});}" |
Um. MovePC moves the Player not an NPC I believe.........
And this is already quest::movepc(); Thats why theres a fourth arg, zoneid. |
yes.....thats why i made move NPC
|
Quote:
Code:
other->MovePC |
ya sry i just noticed that
like i said i dont know c++ that well hehe... i changed it to other->movenpc not sure if that will work tho |
Nevermind, My bad. But will this work crossing over a zone?
|
not sure.
i have no way of testing it so if someone who has a server wants to test it go ahead :P |
other. Hmm. Im not sure if its MovePC that targets the PC or CastToClient() that does. So I'm not sure if this will work.
|
Err, other->MoveNPC would have to be defined. It wont just 'know' that.
|
how would i go about defining it?
|
Well you could always try quest::moveto()...I think that starts the NPC on a path to the loc, but it will at least move them there(if it's working...haven't really tested it). There's no MoveNPC that I know of...you'd also have to take into account the fact that by simply "moving" them, you pretty much summon them. Summoned NPCs return to their spawn point as far as I know.
You'd have to alter their x/y/z above just moving them to the new location, or create a flag that disables the "return to spawn" code for special cases like this. |
the reason i decided to make this was so i could temorarily move an npc somewhere.
on live there was a monk quest where you had to fight Grand Master Glock. the quest moved you to an enclosed room that couldnt be accessed except by hailing master glock and then you'd get teleported to a new room. i think it was just an entirely different mob in there tho. still, i think this could come in handy with certain things. |
Well, it probably didn't move the NPC but it actually did
quest::spawn(samenpcnumber,x,y,z); quest::movepc($zoneid,x,y,z); quest::depop(); (but it would be in the format of however Sony does quests :D ) it just appeared like the npc moved. |
ya, i realized that when i was spacing out in math class about 3 hours ago lol
|
All times are GMT -4. The time now is 10:26 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.