Author Topic: Weapon Enhancement  (Read 428 times)

Legacy_Madasahatter

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Weapon Enhancement
« on: December 07, 2010, 06:58:17 pm »


               Ok can anyone help me, I need to be able to add / increase a weapons enhancement to +10 from a conversation only if player has a 100mil token and remove token after enhancement,

Thanx
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Weapon Enhancement
« Reply #1 on: December 07, 2010, 08:30:18 pm »


               Super simple method off the top of my head would be something like so:

#include "x2_inc_itemprop"
void main()
{
    object oPC = GetPCSpeaker();
    object oToken = GetItemPossessedBy(oPC, "TAG OF TOKEN HERE");
    object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);

    if (oToken == OBJECT_INVALID)
    {
        ActionSpeakString("You do not possess the token. Return to me when you have it.");
        return;
    }

    else
    {
        itemproperty ipAdd = ItemPropertyEnhancementBonus(10);
        IPSafeAddItemProperty(oWeapon, ipAdd, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
        ActionSpeakString("You have successfully added the enchantment.");
        DestroyObject(oToken);
        //Could also add visual effects here.
    }
}


Of course there are a lot of ways to go about this and different checks you will probably want to use. But without more specifics this should do what you want.

Good luck.
               
               

               


                     Modifié par GhostOfGod, 07 décembre 2010 - 08:31 .