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 .