Aller au contenu

Photo

ItemProperty restriction


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
So... I have something like this:

void SetRune(itemproperty ipProperty)
{

object oPC      = GetItemActivator();
object oActiv   = GetItemActivated();
object oTarget  = GetItemActivatedTarget();
string sDesc    = GetDescription(oTarget);
int nFreeSlot   = GetLocalInt(oTarget, "RUNESLOT");
int nWeaponOnly = GetLocalInt(oActiv, "WEAPON_ONLY_RUNE");
int nGetStack   = GetItemStackSize(oActiv);

    if(nWeaponOnly == 1 && (IPGetIsRangedWeapon(oTarget) || IPGetIsMeleeWeapon(oTarget)) == FALSE)
        SendMessageToPC(oPC, "This rune can be aplied only on weapon");
    else
        {
        if(nFreeSlot > 0)
            {
            AddItemProperty(DURATION_TYPE_PERMANENT, ipProperty, oTarget);
            SetDescription(oTarget, sDesc + "\\n" + GetName(oActiv));
            SetLocalInt(oTarget, "RUNESLOT", nFreeSlot-1);

            if(nGetStack == 1)
                DestroyObject(oActiv);
            else
                SetItemStackSize(oActiv, nGetStack-1);
            }
        else
            SendMessageToPC(oPC, "This item has no free rune slot");
        }
}

How to modify it to restrict the possibility of adding the same rune again?
I tried to set on rune var: RUNE_TYPE string TIER_1_RUNE_1, but if I set other rune on the item (TIER_1_RUNE_2), I can set up first again :huh:

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
look in the bioware include x2_inc_itemprop at the function IPSafeAddItemProperty

#3
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
LOL!
Not exactly as you say, but I forget about IPGetItemHasProperty haha
Thanks :-D