Hey folks! Got another sneaky script that I just can't seem to fire on a conversation conditional - TEXT APPEARS - and would like some help. I've tried two variations from examples found via the NWN Omnibus but it still does not return TRUE.
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oItemR = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
object oItemL = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
if ( (GetItemHasItemProperty(oItemR, SPELL_FLAME_WEAPON)) ||
(GetItemHasItemProperty(oItemL, SPELL_FLAME_WEAPON))
) return TRUE;
return FALSE;
}
My second attempt was with a loop to detect the item property but it fails too.
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oItemR = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
object oItemL = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
itemproperty ipLoopR=GetFirstItemProperty(oItemR);
itemproperty ipLoopL=GetFirstItemProperty(oItemL);
while (
(GetIsItemPropertyValid(ipLoopR)) ||
(GetIsItemPropertyValid(ipLoopL))
)
{
if (
(GetItemPropertyType(ipLoopR)==SPELL_FLAME_WEAPON) ||
(GetItemPropertyType(ipLoopL)==SPELL_FLAME_WEAPON)
)
return TRUE;
ipLoopR=GetNextItemProperty(oItemR);
ipLoopL=GetNextItemProperty(oItemL);
}
oItemR = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
oItemL = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
return FALSE;
}
The idea here is to check for the spell FLAME_WEAPON in a conversation, so a mounted wall torch can be lit with the flames from the weapon.
Thanks,
FP!