Jump to content

Home

[K1] Get if npc has weapon


sekan

Recommended Posts

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.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...