PDA

View Full Version : quest function question


dr00dguy
01-16-2012, 07:30 AM
Is there a quest function to toggle an npc's bodytype?

I have an npc I want to be bodytype 11 (untargettable) until it receives a signal from another npc, then become targettable.

looked thought the quest intro and cheat sheet and did not see anything.

thanks

joligario
01-16-2012, 09:21 AM
Your best bet would be to create two NPCs and just spawn the targetable one and depop the original.

dr00dguy
01-16-2012, 02:57 PM
was trying to keep away from doing that. but I guess if its the only way I'll give it a go. Thanks

Tabasco
01-16-2012, 03:30 PM
I use $npc->SetBodyType();
It doesn't appear to be in the wiki, but it is in perl_mob.cpp.

dr00dguy
01-16-2012, 04:55 PM
That worked perfectly for what I needed. Thanks Tabasco

trevius
01-17-2012, 03:14 AM
I added SetBodyType(type, overwrite_orig=false) to the wiki. I don't believe that is able to toggle whether an NPC is targetable in realtime. I think you would have to set the overwrite_orig field to true and repop the NPC to toggle that, but I haven't messed with that function yet really.

To toggle an NPC from targetable to untargetable, you can use SetTargetable(targetable=true), which is in the wiki already. I am not sure if we have the opcodes for all clients yet for that command. You might need to check it on Titanium to make sure it works before making too much use of it.