npc template?
Posted: Thu Jun 14, 2012 6:52 am
hey guys, i was just making this script for moving an npc around inside a house, and it doesnt seem to work correctly ~.~ i cant figure out how to determine a specific npc template only(so that characters cant be moving around all mobiles).
i was hoping for a helping hand
here is what i have so far:
as you can see ive written if (vend.npctemplate == "playermerchant") but i cant seem to move npcs only still, is there a better way to define this?
please and thankyou
i was hoping for a helping hand
here is what i have so far:
Code: Select all
////////////////////
///move a vendor
/////////////////////
function MoveVendor(parms)
var sign := parms[1];
var character := parms[2];
var homeinfo := GetObjProperty (sign, "homeinfo");
if (!homeinfo)
return;
endif
if (!IsAOwner (sign, character))
if (!character.cmdlevel)
return;
else
SendSysMessage (character, "Command level override", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
endif
endif
if (!IsInsideTheHouse(character, sign))
return;
endif
SendSysMessage(character, "Please select a vendor to move", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
var vend := Target(character);
if (!IsInside (character, sign, vend))
return;
else
if (vend.npctemplate == "playermerchant")
SendSysMessage(character, "Please select where you would like your vendor", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
var targ := TargetCoordinates(character);
if (!IsInside (character, sign, targ))
SendSysMessage(character, "you can only target inside your house!", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
return;
else
SendSysMessage(character, "moved", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
MoveObjectToLocation( vend, targ.x, targ.y, targ.z, targ.realm, MOVEOBJECT_FORCELOCATION );
return;
endif
else
SendSysMessage (character, "The gods feel you shouldnt have this power...", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
return;
endif
endif
endfunctionplease and thankyou