Author Topic: Item Properties  (Read 369 times)

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Item Properties
« on: January 17, 2011, 02:59:21 am »


               I am haveing a heck of a time taking saved item props back into item props.  I am doing this with the nwnDB useing a function that IDs item props turns them into a string then saves them.  The issue is taking that string and turning it back into a Item prop.  If any of you Know or could help that would be great.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Item Properties
« Reply #1 on: January 17, 2011, 03:58:13 am »


               I may be mistaken but I don't think you can save item properties the way you are trying to. Lets take "ItemPropertySkillBonus" for example. If you use the function "GetItemPropertyType" it will return ITEM_PROPERTY_SKILL_BONUS. This part would work fine. You can get that integer and convert it to string and save it to the database like you are. But when you use the function "GetItemPropertySubType" it will return "skills". Not which skill you wanted to increase or the amount you increase the skill. And again "GetItemPropertyDurationType" I believe only returns whether or not it is a permanent or temporary item property. Not a bonus amount or anything like that.

What you would have to do is create a script that not only applies an item property but also adds variables somewhere that pertain to that specific property.

I think this would be a huge undertaking to script out a system like this. I haven't given it a whole lot of thought so I could be wrong but I don't think there are any simple convenient ways to save the item properties from an item.

One thing you might want to attempt would be to perhaps use the function "StoreCampaignObject" to store a copy of  the players item with its current item properties, then remove the item properties from the players item. At this point you might also add a variable to the item whos properties have been removed so that you can find these items to destroy later. Then when it's time to give the item properties back, you just create the stored weapon on the player and destroy the other one without the item properties. Hope that makes sense.

Good luck.
               
               

               


                     Modifié par GhostOfGod, 17 janvier 2011 - 04:02 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Item Properties
« Reply #2 on: January 17, 2011, 04:19:45 am »


               try instead of string this custom library
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Item Properties
« Reply #3 on: February 06, 2011, 10:14:58 pm »


               Ok I have, a small issue LOL...



when I create the item by resref, in a chests inventory,  I can not make item identified then strip of props then place new props.  I feel its because it fired on the on open.  The idea I had was to make chest locked then on disturb start a conversation then from there create the items in chest id/remove old props/ set new props.  then open the chest for the player.  Although this all seems possible in theroy.  My question is when the scripts fire, will I be waiting for them to finish like the issue you have with destory item but item doesn't get destoryed until script all finished.  Its a silly question I'm sure.  Probly better just to try then ask,  I just hoped someone might know who has gone before me so to say
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Item Properties
« Reply #4 on: February 06, 2011, 10:59:08 pm »


               Here is a better Question.



Why strip the prop in the first place, If it already on the item you want to make.   When you are adding the props check to see if it is already on the item.  If it is just leave it and dont add the new/same prop again.



And you are thinking along the correct lines.  

Item Props get added to an item right away.  They however do not get removed from an item untill after the script is finished running.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Item Properties
« Reply #5 on: February 10, 2011, 11:11:13 pm »


               ok I need some help with these...

// get data from db set item props on item

// itm_exam_get
// Gets item data from db
// gets data and creates new item by resref then using DB adds properties to
// new item item in objects inventory allowing retrieving of custom items.
// **NOTE**
// so far will only store item that is in toolset pallet
///////////////////////////////////////////////////////////////////
#include "grey_item_func"
/////////////////////////////////////////////////
// these includes are in above include

////////////////////////////////////////////
void main()
{
object oObject= OBJECT_SELF;
string sDBName="DB_"+GetTag(OBJECT_SELF)+"";
string sNumItems="NumItems";
//item info vars
object oItem;
int iItemNumber=0;//item number
string sItemResRef;
int iItemNumProp=0;//item property number
itemproperty iItemProp;
string sPropInfo;
itemproperty iPropFix;
string ipString;
string sItmCreate;
itemproperty ipProperty;
///////////////////////////////////////////////////////////////////

int nMaxIndex= GetCampaignInt(sDBName,"NumItems",oObject);
int nIndex;

for (nIndex = 1; nIndex <= nMaxIndex; nIndex++)
{
sItmCreate=GetCampaignString(sDBName,"Item_"+IntToString( nIndex )+"",oObject);
object oItem=CreateItemOnObject(sItmCreate,OBJECT_SELF);
if( GetIsObjectValid (oItem)==TRUE ){
    //id and strip item props
    ip_ID_StripItemProps(oItem);}

    if( GetIsObjectValid (oItem)==TRUE )
    {

        int nMaxIndexProp= GetCampaignInt(sDBName,"Item_"+IntToString( nIndex )+"_MaxItemProps",oObject);
        int nIndexProp;
        for (nIndexProp = 1; nIndexProp <= nMaxIndex; nIndexProp++)
        {

     ipString= GetCampaignString(sDBName,"Item_"+IntToString( nIndex )+"_ItemProp_"+IntToString( nIndexProp )+"",oObject );
//debug
    PrintString("item ResRef="+sItmCreate+" funtion string="+ipString+"");
    SendMessageToPC( GetLastUsedBy(),"item ResRef="+sItmCreate+" funtion string="+ipString+"" );
//debug end
     iPropFix= StringToItemProp( ipString );
     ipProperty = iPropFix;
        // add the item props from db
        //AddItemProperty( DURATION_TYPE_PERMANENT,ipProperty,oItem);
        IPSafeAddItemProperty(oItem,ipProperty,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
        }//end of for item props
    }//end of if oItem valid
}//end of for number of items

//////////////// //
}// end of script

// reads item and props sets data in db

// itm_exam_set
// examines item sets into db
///////////////////////////////////////////////////////////////////
#include "grey_item_func"
///////////////////////////////////////////////// //
// these includes are in above include
//#include "nwnx_funcs" this include in grey_item_func
//#include "x2_inc_itemprop" this include in grey_item_func
////////////////////////////////////////////
void main()
{
object oObject= OBJECT_SELF;
string sDBName="DB_"+GetTag(OBJECT_SELF)+"";
string sNumItems="NumItems";
//item info vars
object oItem;
int iItemNumber=0;//item number
string sItemResRef;
int iItemNumProp=0;//item property number
itemproperty iItemProp;
string sPropInfo;
///////////////////////////////////////////////////////////////////
//
oItem=GetFirstItemInInventory(OBJECT_SELF);
//item while check
while( GetIsObjectValid (oItem)==TRUE )
{
// set first item to DB
iItemNumber++;
sItemResRef= GetResRef(oItem);
SetCampaignString(sDBName,"Item_"+IntToString( iItemNumber )+"",sItemResRef,oObject);
    iItemProp=GetFirstItemProperty(oItem);
    //item property while check
    while( GetIsItemPropertyValid (iItemProp)==TRUE )
    {
    iItemNumProp++;
    sPropInfo=ItemPropToString (iItemProp);
    PrintString("item ResRef="+sItemResRef+" funtion string="+sPropInfo+"");
    SendMessageToPC( GetLastUsedBy(),"item ResRef="+sItemResRef+" funtion string="+sPropInfo+"" );
    // Set items_properties to DB                                                                         //item prop to string GW
    SetCampaignString(sDBName,"Item_"+IntToString( iItemNumber )+"_ItemProp_"+IntToString( iItemNumProp )+"",sPropInfo,oObject);
    iItemProp=GetNextItemProperty(oItem);
    }//END of item property while check
    SetCampaignInt(sDBName,"Item_"+IntToString( iItemNumber )+"_MaxItemProps",iItemNumProp,oObject);
    //GetItemPropertyParam1Value
oItem=GetNextItemInInventory(OBJECT_SELF);
}//END of item while check
SetCampaignInt(sDBName,"NumItems", iItemNumber,oObject);

// need to destroy item in object produces
// dubble Items
INVY_destroyALL_Items(OBJECT_SELF);

////////////////
}// end of script

// include file with functions

///////////////////////////////////////
//
// grey_item_func
//
//
//
////////////////////////////////////////////////

#include "x2_inc_itemprop"
#include "x0_i0_stringlib"
#include "x2_i0_spells"
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//::
//:: Turns Itemproperty to string
//::
string ItemPropToString(itemproperty ipProp);

//---Function ItemPropToString(itemproperty ipProp);
string ItemPropToString(itemproperty ipProp)
{

  object oItem;
  // to turn the iproptery into a string.
  itemproperty  ipProperty=ipProp;// =  GetFirstItemProperty (oItem);
  string sIprop = IntToString (GetItemPropertyType(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyCostTable(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyCostTableValue(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyDurationType (ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertyParam1(ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertyParam1Value(ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertySubType(ipProperty));

  return sIprop;
}

//::
//:: Turns string from ItemPropToString(itemproperty ipProp) fuction
//:: into Itemproperty
//::
itemproperty StringToItemProp(string sIprop);

//---Function StringToItemProp(string sIprop);
//StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType);
itemproperty StringToItemProp(string sIprop)
//itemproperty StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType);
{
string sIprop;
  // To turn the string  back to an Iproperty is going to be harder.
  int nPropType =StringToInt( GetTokenByPosition(sIprop,"|",0));
  int nPropTabl =StringToInt( GetTokenByPosition(sIprop,"|",1));
  int nPropValue=StringToInt( GetTokenByPosition(sIprop,"|",2));
  int nDuration =StringToInt( GetTokenByPosition(sIprop,"|",3));
  int nPram1    =StringToInt( GetTokenByPosition(sIprop,"|",4));
  int nPram1Val =StringToInt( GetTokenByPosition(sIprop,"|",5));
  int nSubType  =StringToInt( GetTokenByPosition(sIprop,"|",6));

  object oNewItem;
  itemproperty ipRemadeProp;
  switch (nPropType)
  {
     case ITEM_PROPERTY_ABILITY_BONUS:
       ipRemadeProp= ItemPropertyAbilityBonus( nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS:
       ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyACBonusVsAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyACBonusVsDmgType( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyACBonusVsRace( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyACBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ADDITIONAL:
       ipRemadeProp = ItemPropertyAdditional( nPropValue);
       break;
     case ITEM_PROPERTY_ARCANE_SPELL_FAILURE:
       ipRemadeProp = ItemPropertyArcaneSpellFailure( nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS:
       ipRemadeProp = ItemPropertyAttackBonus( nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyAttackBonusVsAlign(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyAttackBonusVsRace( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyAttackBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION:
       ipRemadeProp = ItemPropertyWeightReduction( nPropValue);
       break;
     case ITEM_PROPERTY_BONUS_FEAT:
       ipRemadeProp = ItemPropertyBonusFeat( nPropValue);
       break;
     case ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N:
       ipRemadeProp = ItemPropertyBonusLevelSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_CAST_SPELL:
       ipRemadeProp = ItemPropertyCastSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS:
       ipRemadeProp = ItemPropertyDamageBonus( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyDamageBonusVsAlign( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyDamageBonusVsRace( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyDamageBonusVsSAlign( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_REDUCTION:
       ipRemadeProp = ItemPropertyDamageReduction( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_RESISTANCE:
       ipRemadeProp = ItemPropertyDamageResistance( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_VULNERABILITY:
       ipRemadeProp = ItemPropertyDamageVulnerability( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DARKVISION:
       ipRemadeProp = ItemPropertyDarkvision();
       break;
     case ITEM_PROPERTY_DECREASED_ABILITY_SCORE:
       ipRemadeProp = ItemPropertyDecreaseAbility( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_AC:
       ipRemadeProp = ItemPropertyDecreaseAC( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER:
       ipRemadeProp = ItemPropertyAttackPenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_DAMAGE:
       ipRemadeProp = ItemPropertyDamagePenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER:
       ipRemadeProp = ItemPropertyEnhancementPenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SAVING_THROWS:
       ipRemadeProp = ItemPropertyReducedSavingThrow(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC:
       ipRemadeProp = ItemPropertyReducedSavingThrowVsX(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SKILL_MODIFIER:
       ipRemadeProp = ItemPropertyDecreaseSkill( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT:
       ipRemadeProp = ItemPropertyContainerReducedWeight( nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS:
       ipRemadeProp = ItemPropertyEnhancementBonus( nPram1);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyEnhancementBonusVsAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyEnhancementBonusVsRace(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT:
       ipRemadeProp = ItemPropertyEnhancementBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyExtraMeleeDamageType( nPropValue);
       break;
     case ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyExtraRangeDamageType( nPropValue);
       break;
     case ITEM_PROPERTY_FREEDOM_OF_MOVEMENT:
       ipRemadeProp = ItemPropertyFreeAction();
       break;
     case ITEM_PROPERTY_HASTE:
       ipRemadeProp = ItemPropertyHaste();
       break;
     case ITEM_PROPERTY_HEALERS_KIT:
       ipRemadeProp = ItemPropertyHealersKit( nPropValue);
       break;
     case ITEM_PROPERTY_HOLY_AVENGER:
       ipRemadeProp = ItemPropertyHolyAvenger();
       break;
     case ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyDamageImmunity(nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS:
       ipRemadeProp = ItemPropertyImmunityMisc( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL:
       ipRemadeProp = ItemPropertySpellImmunitySpecific( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL:
       ipRemadeProp = ItemPropertySpellImmunitySchool( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL:
       ipRemadeProp = ItemPropertyImmunityToSpellLevel( nPropValue);
       break;
     case ITEM_PROPERTY_IMPROVED_EVASION:
       ipRemadeProp = ItemPropertyImprovedEvasion();
       break;
     case ITEM_PROPERTY_KEEN:
       ipRemadeProp = ItemPropertyKeen();
       break;
     case ITEM_PROPERTY_LIGHT:
       ipRemadeProp = ItemPropertyLight( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_MASSIVE_CRITICALS:
       ipRemadeProp = ItemPropertyMassiveCritical( nPropValue);
       break;
     case ITEM_PROPERTY_MATERIAL:
       ipRemadeProp = ItemPropertyMaterial( nPropValue);
       break;
     case ITEM_PROPERTY_MIGHTY:
       ipRemadeProp = ItemPropertyMaxRangeStrengthMod( nPropValue);
       break;
     case ITEM_PROPERTY_MIND_BLANK: //missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_MONSTER_DAMAGE:
       ipRemadeProp = ItemPropertyMonsterDamage( nPropValue);
       break;
     case ITEM_PROPERTY_NO_DAMAGE:
       ipRemadeProp = ItemPropertyNoDamage();
       break;
     case ITEM_PROPERTY_ON_HIT_PROPERTIES:
       ipRemadeProp = ItemPropertyOnHitProps( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_ON_MONSTER_HIT:
       ipRemadeProp = ItemPropertyOnMonsterHitProperties( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ONHITCASTSPELL:
       ipRemadeProp = ItemPropertyOnHitCastSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_POISON://missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_QUALITY:
       ipRemadeProp = ItemPropertyQuality( nPropValue);
       break;
     case ITEM_PROPERTY_REGENERATION:
       ipRemadeProp = ItemPropertyRegeneration( nPropValue);
       break;
     case ITEM_PROPERTY_REGENERATION_VAMPIRIC:
       ipRemadeProp = ItemPropertyVampiricRegeneration( nPropValue);
       break;
     case ITEM_PROPERTY_SAVING_THROW_BONUS:
       ipRemadeProp = ItemPropertyBonusSavingThrow( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC:
       ipRemadeProp = ItemPropertyBonusSavingThrowVsX( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_SKILL_BONUS:
       ipRemadeProp = ItemPropertySkillBonus(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_SPECIAL_WALK:
       ipRemadeProp = ItemPropertySpecialWalk( nPropValue);
       break;
     case ITEM_PROPERTY_SPELL_RESISTANCE:
       ipRemadeProp = ItemPropertyBonusSpellResistance( nPropValue);
       break;
     case ITEM_PROPERTY_THIEVES_TOOLS:
       ipRemadeProp = ItemPropertyThievesTools( nPropValue);
       break;
     case ITEM_PROPERTY_TRAP:
       ipRemadeProp = ItemPropertyTrap( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_TRUE_SEEING:
       ipRemadeProp = ItemPropertyTrueSeeing();
       break;
     case ITEM_PROPERTY_TURN_RESISTANCE:
       ipRemadeProp = ItemPropertyTurnResistance( nPropValue);
       break;
     case ITEM_PROPERTY_UNLIMITED_AMMUNITION:
       ipRemadeProp = ItemPropertyUnlimitedAmmo( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyLimitUseByAlign( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_class:
       ipRemadeProp = ItemPropertyLimitUseByclass( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE:
       ipRemadeProp = ItemPropertyLimitUseByRace( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyLimitUseBySAlign( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_TILESET:// missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_VISUALEFFECT:
       ipRemadeProp = ItemPropertyVisualEffect( nPropValue);
       break;
     case ITEM_PROPERTY_WEIGHT_INCREASE:
       ipRemadeProp = ItemPropertyWeightIncrease( nPropValue);
       break;
     /// ect. making a case for each of the 48 or so item properties.

  }
/*
  int nPropType =StringToInt( GetTokenByPosition(sIprop,"|",0));
  int nPropTabl =StringToInt( GetTokenByPosition(sIprop,"|",1));
  int nPropValue=StringToInt( GetTokenByPosition(sIprop,"|",2));
  int nDuration =StringToInt( GetTokenByPosition(sIprop,"|",3));
  int nPram1    =StringToInt( GetTokenByPosition(sIprop,"|",4));
  int nPram1Val =StringToInt( GetTokenByPosition(sIprop,"|",5));
  int nSubType  =StringToInt( GetTokenByPosition(sIprop,"|",6));
  //StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType)
*/
  return ipRemadeProp;
  //return StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType);
}
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


//:://////////////////////////////////////////////////////////
// ids and strips item of props
void ip_ID_StripItemProps(object oItem);

void ip_ID_StripItemProps(object oItem)
{
object oItem;
if(!GetIdentified(oItem) )
{
SetIdentified(oItem,TRUE);
}
//Get the first itemproperty on oItem
itemproperty ipLoop=GetFirstItemProperty(oItem);

//Loop for as long as the ipLoop variable is valid
while (GetIsItemPropertyValid(ipLoop))
   {
   //remove all props before newones
   RemoveItemProperty(oItem, ipLoop);
   //Next itemproperty on the list...
   ipLoop=GetNextItemProperty(oItem);
   }
}

//
//  Destroys all item in object oTarget inventory
void INVY_destroyALL_Items(object oTarget);

void INVY_destroyALL_Items(object oTarget)
{
object oTarget;
object oItem;
oItem =GetFirstItemInInventory(oTarget);
while( GetIsObjectValid(oItem) )
    {
    DestroyObject(oItem);
    oItem =GetNextItemInInventory(oTarget);
    }
}

//------------------------------------------------------------------------------

these are the scripts used, on a chest the set is used in the on_closed and the get used on open.  My issue seems to be getting my string to the proper int for item property perhaps im converting it wrong as you can see I tried a few things with no luck.
               
               

               


                     Modifié par Greyfort, 10 février 2011 - 11:17 .
                     
                  


            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Item Properties
« Reply #6 on: February 19, 2011, 11:58:45 pm »


               ok I need a bit more help not sure why its not retriving data from db

my set item db script:

// itm_exam_set
//
// examines item sets item properties into db
//
///////////////////////////////////////////////////////////////////
#include "grey_item_func"
///////////////////////////////////////////////// //
// these includes are in above include
//#include "nwnx_funcs" this include in grey_item_func
//#include "x2_inc_itemprop" this include in grey_item_func
////////////////////////////////////////////
void main()
{
object oObject= OBJECT_SELF;
object oPC=GetLocalObject(oObject,"Player");
string sDBName="DB_"+GetTag(OBJECT_SELF)+"";
string sNumItems="NumItems";
//item info vars
object oItem;
int iItemNumber=0;//item number  //  ////   //
string sItemResRef;
int iItemNumProp=0;//item property number
itemproperty iItemProp;
string sPropInfo;
///////////////////////////////////////////////////////////////////
//
oItem=GetFirstItemInInventory(OBJECT_SELF);
//item while check
while( GetIsObjectValid (oItem)==TRUE )
{
// set first item to DB
iItemNumber++;
sItemResRef= GetResRef(oItem);
SetCampaignString(sDBName,"Item_"+IntToString( iItemNumber )+"",sItemResRef,oObject);
    iItemProp=GetFirstItemProperty(oItem);
    //item property while check
    while( GetIsItemPropertyValid (iItemProp)==TRUE )
    {
    iItemNumProp++;
    sPropInfo=ItemPropToString (iItemProp);
    PrintString("item ResRef="+sItemResRef+" SET funtion string="+sPropInfo+"");
    SendMessageToPC( oPC,"item numprop="+IntToString(iItemNumProp)+"" );
    SendMessageToPC( oPC,"item ResRef="+sItemResRef+" SET funtion string="+sPropInfo+"" );
    // Set items_properties to DB                                                                         //item prop to string GW
    SetCampaignString(sDBName,"Item_"+IntToString( iItemNumber )+"_ItemProp_"+IntToString( iItemNumProp )+"",sPropInfo,oObject);
    iItemProp=GetNextItemProperty(oItem);
    }//END of item property while check
    SetCampaignInt(sDBName,"Item_"+IntToString( iItemNumber )+"_MaxItemProps",iItemNumProp,oObject);
    //GetItemPropertyParam1Value
oItem=GetNextItemInInventory(OBJECT_SELF);
}//END of item while check
SetCampaignInt(sDBName,"NumItems", iItemNumber,oObject);

// need to destroy item in object produces
// dubble Items                     //
INVY_destroyALL_Items(OBJECT_SELF);

////////////////
}// end of script

my get item DB script:

// itm_exam_get
// Gets item data from db
// gets data and creates new item by resref then using DB adds properties to
// new item.  Thus allowing retrieving of custom items.
// **NOTE**
// so far will only store item that is in toolset pallet
///////////////////////////////////////////////////////////////////
#include "grey_item_func"
///////////////////////////////////////////////////
// these includes are in above include

//////////////////////////////////////////// //
void main()
{
object oObject= OBJECT_SELF;
object oPC=GetLocalObject(oObject,"Player");
string sDBName="DB_"+GetTag(OBJECT_SELF)+"";
string sNumItems="NumItems";
//item info vars
object oItem;
int iItemNumber=0;//item number
string sItemResRef;
int iItemNumProp=0;//item property number
itemproperty iItemProp;
string sPropInfo;
itemproperty iPropFix;
string ipString;
string sItmCreate;                                 //
itemproperty ipProperty;
///////////////////////////////////////////////////////////////////

int nMaxIndex= GetCampaignInt(sDBName,"NumItems",oObject);
int nIndex;

for (nIndex = 1; nIndex <= nMaxIndex; nIndex++)
{
sItmCreate=GetCampaignString(sDBName,"Item_"+IntToString( nIndex )+"",oObject);
object oItem=CreateItemOnObject(sItmCreate,OBJECT_SELF);
if( GetIsObjectValid (oItem)==TRUE ){
    //id and strip item props
    //ip_ID_StripItemProps(oItem);
    }

    if( GetIsObjectValid (oItem)==TRUE )
    {

        int nMaxIndexProp= GetCampaignInt(sDBName,"Item_"+IntToString( nIndex )+"_MaxItemProps",oObject);
        int nIndexProp;
        for (nIndexProp = 1; nIndexProp <= nMaxIndex; nIndexProp++)
        {

     ipString= GetCampaignString(sDBName,"Item_"+IntToString( nIndex )+"_ItemProp_"+IntToString( nIndexProp )+"",oObject );
//debug
    PrintString("item ResRef="+sItmCreate+" GET funtion string="+ipString+"");
    SendMessageToPC( oPC,"item ResRef="+sItmCreate+" GET funtion string="+ipString+"" );
//debug end
     iPropFix= StringToItemProp( ipString );     //
     ipProperty = iPropFix;
        // add the item props from db
        //AddItemProperty( DURATION_TYPE_PERMANENT,ipProperty,oItem);
        IPSafeAddItemProperty(oItem,ipProperty,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
        }//end of for item props
    }//end of if oItem valid
}//end of for number of items

//////////////// //
}// end of script

Please any help would be great, I'm not able to find my errors..
Oh here is the include needed.

///////////////////////////////////////
//
// grey_item_func
//
//
//
////////////////////////////////////////////////

#include "x2_inc_itemprop"
#include "x0_i0_stringlib"
#include "x2_i0_spells"
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
//::
//:: Turns Itemproperty to string
//::
string ItemPropToString(itemproperty ipProp);

//---Function ItemPropToString(itemproperty ipProp);
string ItemPropToString(itemproperty ipProp)
{

  object oItem;
  // to turn the iproptery into a string.
  itemproperty  ipProperty=ipProp;// =  GetFirstItemProperty (oItem);
  string sIprop = IntToString (GetItemPropertyType(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyCostTable(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyCostTableValue(ipProperty));
  sIprop +=       "|"+ IntToString(GetItemPropertyDurationType (ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertyParam1(ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertyParam1Value(ipProperty));
  sIprop +=       "|"+ IntToString( GetItemPropertySubType(ipProperty));

  return sIprop;
}

//::
//:: Turns string from ItemPropToString(itemproperty ipProp) fuction
//:: into Itemproperty
//::
itemproperty StringToItemProp(string sIprop);
//itemproperty StringToItemProp(int ipRemadeProp,int nPropTabl,int nPropValue,int nDuration,int nPram1,int nPram1Val,int nSubType);
//itemproperty StringToItemProp(int ipRemadeProp);

//---Function StringToItemProp(string sIprop);
itemproperty StringToItemProp(string sIprop)
//itemproperty StringToItemProp(int ipRemadeProp,int nPropTabl,int nPropValue,int nDuration,int nPram1,int nPram1Val,int nSubType)
//itemproperty StringToItemProp(int ipRemadeProp)
{
string sIprop;
  // To turn the string  back to an Iproperty is going to be harder.
  int nPropType =StringToInt( GetTokenByPosition(sIprop,"|",0));
  int nPropTabl =StringToInt( GetTokenByPosition(sIprop,"|",1));
  int nPropValue=StringToInt( GetTokenByPosition(sIprop,"|",2));
  int nDuration =StringToInt( GetTokenByPosition(sIprop,"|",3));
  int nPram1    =StringToInt( GetTokenByPosition(sIprop,"|",4));
  int nPram1Val =StringToInt( GetTokenByPosition(sIprop,"|",5));
  int nSubType  =StringToInt( GetTokenByPosition(sIprop,"|",6));

  object oNewItem;
  itemproperty ipRemadeProp;
  switch (nPropType)
  {
     case ITEM_PROPERTY_ABILITY_BONUS:
       ipRemadeProp= ItemPropertyAbilityBonus( nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS:
       ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyACBonusVsAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyACBonusVsDmgType( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyACBonusVsRace( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyACBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ADDITIONAL:
       ipRemadeProp = ItemPropertyAdditional( nPropValue);
       break;
     case ITEM_PROPERTY_ARCANE_SPELL_FAILURE:
       ipRemadeProp = ItemPropertyArcaneSpellFailure( nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS:
       ipRemadeProp = ItemPropertyAttackBonus( nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyAttackBonusVsAlign(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyAttackBonusVsRace( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyAttackBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION:
       ipRemadeProp = ItemPropertyWeightReduction( nPropValue);
       break;
     case ITEM_PROPERTY_BONUS_FEAT:
       ipRemadeProp = ItemPropertyBonusFeat( nPropValue);
       break;
     case ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N:
       ipRemadeProp = ItemPropertyBonusLevelSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_CAST_SPELL:
       ipRemadeProp = ItemPropertyCastSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS:
       ipRemadeProp = ItemPropertyDamageBonus( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyDamageBonusVsAlign( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyDamageBonusVsRace( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyDamageBonusVsSAlign( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_DAMAGE_REDUCTION:
       ipRemadeProp = ItemPropertyDamageReduction( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_RESISTANCE:
       ipRemadeProp = ItemPropertyDamageResistance( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DAMAGE_VULNERABILITY:
       ipRemadeProp = ItemPropertyDamageVulnerability( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DARKVISION:
       ipRemadeProp = ItemPropertyDarkvision();
       break;
     case ITEM_PROPERTY_DECREASED_ABILITY_SCORE:
       ipRemadeProp = ItemPropertyDecreaseAbility( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_AC:
       ipRemadeProp = ItemPropertyDecreaseAC( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER:
       ipRemadeProp = ItemPropertyAttackPenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_DAMAGE:
       ipRemadeProp = ItemPropertyDamagePenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER:
       ipRemadeProp = ItemPropertyEnhancementPenalty( nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SAVING_THROWS:
       ipRemadeProp = ItemPropertyReducedSavingThrow(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC:
       ipRemadeProp = ItemPropertyReducedSavingThrowVsX(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_DECREASED_SKILL_MODIFIER:
       ipRemadeProp = ItemPropertyDecreaseSkill( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT:
       ipRemadeProp = ItemPropertyContainerReducedWeight( nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS:
       ipRemadeProp = ItemPropertyEnhancementBonus( nPram1);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyEnhancementBonusVsAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP:
       ipRemadeProp = ItemPropertyEnhancementBonusVsRace(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT:
       ipRemadeProp = ItemPropertyEnhancementBonusVsSAlign( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyExtraMeleeDamageType( nPropValue);
       break;
     case ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyExtraRangeDamageType( nPropValue);
       break;
     case ITEM_PROPERTY_FREEDOM_OF_MOVEMENT:
       ipRemadeProp = ItemPropertyFreeAction();
       break;
     case ITEM_PROPERTY_HASTE:
       ipRemadeProp = ItemPropertyHaste();
       break;
     case ITEM_PROPERTY_HEALERS_KIT:
       ipRemadeProp = ItemPropertyHealersKit( nPropValue);
       break;
     case ITEM_PROPERTY_HOLY_AVENGER:
       ipRemadeProp = ItemPropertyHolyAvenger();
       break;
     case ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE:
       ipRemadeProp = ItemPropertyDamageImmunity(nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS:
       ipRemadeProp = ItemPropertyImmunityMisc( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL:
       ipRemadeProp = ItemPropertySpellImmunitySpecific( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL:
       ipRemadeProp = ItemPropertySpellImmunitySchool( nPropValue);
       break;
     case ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL:
       ipRemadeProp = ItemPropertyImmunityToSpellLevel( nPropValue);
       break;
     case ITEM_PROPERTY_IMPROVED_EVASION:
       ipRemadeProp = ItemPropertyImprovedEvasion();
       break;
     case ITEM_PROPERTY_KEEN:
       ipRemadeProp = ItemPropertyKeen();
       break;
     case ITEM_PROPERTY_LIGHT:
       ipRemadeProp = ItemPropertyLight( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_MASSIVE_CRITICALS:
       ipRemadeProp = ItemPropertyMassiveCritical( nPropValue);
       break;
     case ITEM_PROPERTY_MATERIAL:
       ipRemadeProp = ItemPropertyMaterial( nPropValue);
       break;
     case ITEM_PROPERTY_MIGHTY:
       ipRemadeProp = ItemPropertyMaxRangeStrengthMod( nPropValue);
       break;
     case ITEM_PROPERTY_MIND_BLANK: //missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_MONSTER_DAMAGE:
       ipRemadeProp = ItemPropertyMonsterDamage( nPropValue);
       break;
     case ITEM_PROPERTY_NO_DAMAGE:
       ipRemadeProp = ItemPropertyNoDamage();
       break;
     case ITEM_PROPERTY_ON_HIT_PROPERTIES:
       ipRemadeProp = ItemPropertyOnHitProps( nSubType,nPropValue,nPram1Val);
       break;
     case ITEM_PROPERTY_ON_MONSTER_HIT:
       ipRemadeProp = ItemPropertyOnMonsterHitProperties( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_ONHITCASTSPELL:
       ipRemadeProp = ItemPropertyOnHitCastSpell( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_POISON://missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_QUALITY:
       ipRemadeProp = ItemPropertyQuality( nPropValue);
       break;
     case ITEM_PROPERTY_REGENERATION:
       ipRemadeProp = ItemPropertyRegeneration( nPropValue);
       break;
     case ITEM_PROPERTY_REGENERATION_VAMPIRIC:
       ipRemadeProp = ItemPropertyVampiricRegeneration( nPropValue);
       break;
     case ITEM_PROPERTY_SAVING_THROW_BONUS:
       ipRemadeProp = ItemPropertyBonusSavingThrow( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC:
       ipRemadeProp = ItemPropertyBonusSavingThrowVsX( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_SKILL_BONUS:
       ipRemadeProp = ItemPropertySkillBonus(nSubType, nPropValue);
       break;
     case ITEM_PROPERTY_SPECIAL_WALK:
       ipRemadeProp = ItemPropertySpecialWalk( nPropValue);
       break;
     case ITEM_PROPERTY_SPELL_RESISTANCE:
       ipRemadeProp = ItemPropertyBonusSpellResistance( nPropValue);
       break;
     case ITEM_PROPERTY_THIEVES_TOOLS:
       ipRemadeProp = ItemPropertyThievesTools( nPropValue);
       break;
     case ITEM_PROPERTY_TRAP:
       ipRemadeProp = ItemPropertyTrap( nSubType,nPropValue);
       break;
     case ITEM_PROPERTY_TRUE_SEEING:
       ipRemadeProp = ItemPropertyTrueSeeing();
       break;
     case ITEM_PROPERTY_TURN_RESISTANCE:
       ipRemadeProp = ItemPropertyTurnResistance( nPropValue);
       break;
     case ITEM_PROPERTY_UNLIMITED_AMMUNITION:
       ipRemadeProp = ItemPropertyUnlimitedAmmo( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP:
       ipRemadeProp = ItemPropertyLimitUseByAlign( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_class:
       ipRemadeProp = ItemPropertyLimitUseByclass( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE:
       ipRemadeProp = ItemPropertyLimitUseByRace( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT:
       ipRemadeProp = ItemPropertyLimitUseBySAlign( nPropValue);
       break;
     case ITEM_PROPERTY_USE_LIMITATION_TILESET:// missing
       //ipRemadeProp = ItemPropertyACBonus( nPropValue);
       break;
     case ITEM_PROPERTY_VISUALEFFECT:
       ipRemadeProp = ItemPropertyVisualEffect( nPropValue);
       break;
     case ITEM_PROPERTY_WEIGHT_INCREASE:
       ipRemadeProp = ItemPropertyWeightIncrease( nPropValue);
       break;
     /// ect. making a case for each of the 48 or so item properties.

  }
/*
  int nPropType =StringToInt( GetTokenByPosition(sIprop,"|",0));
  int nPropTabl =StringToInt( GetTokenByPosition(sIprop,"|",1));
  int nPropValue=StringToInt( GetTokenByPosition(sIprop,"|",2));
  int nDuration =StringToInt( GetTokenByPosition(sIprop,"|",3));
  int nPram1    =StringToInt( GetTokenByPosition(sIprop,"|",4));
  int nPram1Val =StringToInt( GetTokenByPosition(sIprop,"|",5));
  int nSubType  =StringToInt( GetTokenByPosition(sIprop,"|",6));
  //StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType)
*/

  //return StringToItemProp(ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType);
  //return ipRemadeProp,nPropTabl,nPropValue,nDuration,nPram1,nPram1Val,nSubType;
  return ipRemadeProp;
}
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////


//:://////////////////////////////////////////////////////////
// ids and strips item of props
void ip_ID_StripItemProps(object oItem);

void ip_ID_StripItemProps(object oItem)
{
object oItem;
if(!GetIdentified(oItem) )
{
SetIdentified(oItem,TRUE);
}
//Get the first itemproperty on oItem
itemproperty ipLoop=GetFirstItemProperty(oItem);

//Loop for as long as the ipLoop variable is valid
while (GetIsItemPropertyValid(ipLoop))
   {
   //remove all props before newones
   RemoveItemProperty(oItem, ipLoop);
   //Next itemproperty on the list...
   ipLoop=GetNextItemProperty(oItem);
   }
}

//
//  Destroys all item in object oTarget inventory
void INVY_destroyALL_Items(object oTarget);

void INVY_destroyALL_Items(object oTarget)
{
object oTarget;
object oItem;
oItem =GetFirstItemInInventory(oTarget);
while( GetIsObjectValid(oItem) )
    {
    DestroyObject(oItem);
    oItem =GetNextItemInInventory(oTarget);
    }
}

//------------------------------------------------------------------------------

thankyou all in advance
               
               

               


                     Modifié par Greyfort, 20 février 2011 - 12:04 .
                     
                  


            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Item Properties
« Reply #7 on: April 14, 2011, 08:43:27 pm »


               Anyone see a mistake I made in the script, I have kinda put this on hold but would like to continue work on it.