Skip to content

Custom ammunition while shifted

How do you equip custom ammunition to a shifted shape?

I gave my drider a bow in polymorph.2da and want to also equip custom arrows to the shape. I've tried the following in the module OnEquip handle:
            if( sItemTag == "rl_driderbow" )
            {
                object oArrow = CreateItemOnObject("driderarrow1",oPC,99);
                AssignCommand(oPC,ActionEquipItem(oArrow,INVENTORY_SLOT_ARROWS));
                SendMessageToPC(oPC,"Drider arrows equiped.");
            }

The code fires, it sends me the message, but the arrows never equip and if I attack something it says I'm Out of Ammo.

The bow works fine with the Unlimited Ammo property, but I want to add an OnHit property that I can't get otherwise.

Comments

  • TerrorbleTerrorble Member Posts: 179
    Alternatively, is there a way to edit/alter the properties of unlimited ammo?
  • TerrorbleTerrorble Member Posts: 179
    Terrorble wrote: »
    Alternatively, is there a way to edit/alter the properties of unlimited ammo?

    The answer is yes! (I thought I tried this a long time ago and didn't think it worked)
    if( sItemTag == "rl_driderbow" )
    {
        object oArrow = GetItemInSlot(INVENTORY_SLOT_ARROWS,oPC);
        
        itemproperty ip = ItemPropertyVampiricRegeneration(5);
        DelayCommand(2.0,IPSafeAddItemProperty(oArrow,ip,0.0f));
           
        ip = ItemPropertyOnHitProps(IP_CONST_ONHIT_FEAR,IP_CONST_ONHIT_SAVEDC_16,IP_CONST_ONHIT_DURATION_50_PERCENT_2_ROUNDS);
        DelayCommand(2.1,IPSafeAddItemProperty(oArrow,ip,0.0f));
        
    return;
    }
    

    Thanks for allowing me to think out loud here.
Sign In or Register to comment.