Aller au contenu

Photo

Weapon Enhancement


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Madasahatter

Madasahatter
  • Members
  • 111 messages
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

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .