sekan Posted March 14, 2008 Posted March 14, 2008 Hi, I need a script that checks if a npc got a weapon. The weapon for this script is equipped. This shall be used in a dialog as a Conditional script.
Stream Posted March 14, 2008 Posted March 14, 2008 int StartingConditional() { object oNPC = GetObjectByTag("NPC_TAG"); object oWeapon = GetItemPossessedBy(oNPC, "WEAPON_TAG"); if ((GetIsObjectValid(oWeapon) == TRUE)) { return TRUE; } return FALSE; } --Stream
stoffe Posted March 15, 2008 Posted March 15, 2008 Hi, I need a script that checks if a npc got a weapon. The weapon for this script is equipped. This shall be used in a dialog as a Conditional script. Or, if the weapon has to be in one of the main character's weapon slots you could do something like: int IsEquipped(int iSlot, string sTag, object oActor) { return (GetTag(GetItemInSlot(iSlot, oActor)) == sTag); } int StartingConditional() { object oPC = GetFirstPC(); string sTag ="[color=Yellow]WeaponTag[/color]"; return ( IsEquipped(INVENTORY_SLOT_RIGHTWEAPON, sTag, oPC) || IsEquipped(INVENTORY_SLOT_LEFTWEAPON, sTag, oPC)); } (Change WeaponTag to the tag of the weapon to look for.)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.