587 lines
23 KiB
Plaintext
587 lines
23 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name Forge System Handler
|
|
//:: FileName ld_forge.nss
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
|
|
This is the main file for the forge system.
|
|
The system now uses tokens to cover the cost
|
|
of enhancements. This is to allow the DM
|
|
more control over forge access. The tokens
|
|
are under Plot Items, they stack to a maximum
|
|
stack size of 99, however the forge will count
|
|
all tokens in the possession of the player
|
|
regardless of how many are in each stack.
|
|
The system has two configurable settings,
|
|
for max mods per item, and token value.
|
|
These settings are below.
|
|
|
|
Lord Delekhan
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Lord Delekhan
|
|
//:: Created On: 11/16/2004
|
|
//:://////////////////////////////////////////////
|
|
#include "prc_x2_itemprop"
|
|
|
|
//:://////////////////////////////////////////////
|
|
//:: Set the value below to your desired maximum
|
|
//:: enhancements on any given item, default is 8
|
|
//:://////////////////////////////////////////////
|
|
const int FORGE_MAX_ENHANCEMENTS = 6;
|
|
|
|
//:://////////////////////////////////////////////
|
|
//:: Set the value below to your desired forge
|
|
//:: token value, default is 15000gp per token
|
|
//:: *note* at default value it takes 90
|
|
//:: tokens to add +9 to a plain item
|
|
//:://////////////////////////////////////////////
|
|
const int FORGE_TOKEN_VALUE = 4000;
|
|
|
|
//:://////////////////////////////////////////////
|
|
//:: Do not alter below this line
|
|
//:://////////////////////////////////////////////
|
|
|
|
void DoEnhancements(object oTarget,string sTag);
|
|
|
|
itemproperty Enhancement(int Token, int Parm1=0,int Parm2=0)
|
|
{
|
|
itemproperty ipNew;
|
|
switch(Token){
|
|
case 1:ipNew = ItemPropertyEnhancementBonus(Parm1);break;
|
|
case 2:ipNew = ItemPropertyACBonus(Parm1);break;
|
|
case 3:ipNew = ItemPropertyDamageBonus(Parm1,Parm2);break;
|
|
case 4:ipNew = ItemPropertyDamageResistance(Parm1,Parm2);break;
|
|
case 5:ipNew = ItemPropertyAttackBonus(Parm1);break;
|
|
case 6:ipNew = ItemPropertyMaxRangeStrengthMod(Parm1);break;
|
|
case 10:ipNew = ItemPropertyHaste();break;
|
|
case 11:ipNew = ItemPropertyKeen();break;
|
|
case 12:ipNew = ItemPropertyUnlimitedAmmo(Parm1);break;
|
|
case 13:ipNew = ItemPropertyMassiveCritical(Parm1);break;
|
|
case 14:ipNew = ItemPropertyVampiricRegeneration(Parm1);break;
|
|
case 20:ipNew = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING,
|
|
IPGetDamageBonusConstantFromNumber(Parm1));break;
|
|
case 21:ipNew = ItemPropertyImmunityMisc(Parm1);break;
|
|
case 22:ipNew = ItemPropertyAbilityBonus(Parm1, Parm2);break;
|
|
case 23:ipNew = ItemPropertyFreeAction();break;
|
|
case 24:ipNew = ItemPropertySkillBonus(Parm1, Parm2);break;
|
|
case 25:ipNew = ItemPropertyTrueSeeing();break;
|
|
case 26:ipNew = ItemPropertyDamageReduction(Parm1,Parm2);break;
|
|
case 27:ipNew = ItemPropertyBonusSavingThrow(Parm1,Parm2);break;
|
|
case 28:ipNew = ItemPropertyBonusFeat(Parm1);break;
|
|
case 29:ipNew = ItemPropertyBonusSavingThrowVsX(IP_CONST_SAVEVS_UNIVERSAL,Parm1);break;
|
|
case 30:ipNew = ItemPropertyHolyAvenger();break;
|
|
case 31:ipNew = ItemPropertyBonusSpellResistance(Parm1);break;
|
|
case 32:ipNew = ItemPropertyBonusLevelSpell(Parm1,Parm2);break;
|
|
case 33:ipNew = ItemPropertyImprovedEvasion();break;
|
|
case 34:ipNew = ItemPropertyDamageImmunity(Parm1,Parm2);break;
|
|
case 35:ipNew = ItemPropertyVisualEffect(Parm1);break;
|
|
}
|
|
return ipNew;
|
|
}
|
|
|
|
string TagEncode(int Token)
|
|
{
|
|
string sBase = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
|
|
string sToken = GetSubString(sBase,Token,1);
|
|
return sToken;
|
|
}
|
|
|
|
int TagDecode(string sTag)
|
|
{
|
|
string sBase = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
|
|
int iValue = FindSubString(sBase,sTag);
|
|
return iValue;
|
|
}
|
|
|
|
int BaseItemValid(object oItem)
|
|
{
|
|
int rValue = 0;
|
|
if(IPGetIsRangedWeapon(oItem) || IPGetIsMeleeWeapon(oItem))
|
|
rValue = 1;
|
|
int iItem = GetBaseItemType(oItem);
|
|
switch(iItem){
|
|
case BASE_ITEM_AMULET:rValue = 1;break;
|
|
case BASE_ITEM_ARMOR:rValue = 1;break;
|
|
case BASE_ITEM_BELT:rValue = 1;break;
|
|
case BASE_ITEM_BRACER:rValue = 1;break;
|
|
case BASE_ITEM_CLOAK:rValue = 1;break;
|
|
case BASE_ITEM_GLOVES:rValue = 1;break;
|
|
case BASE_ITEM_HELMET:rValue = 1;break;
|
|
case BASE_ITEM_LARGESHIELD:rValue = 1;break;
|
|
case BASE_ITEM_MAGICSTAFF:rValue = 1;break;
|
|
case BASE_ITEM_BOOTS:rValue = 1;break;
|
|
case BASE_ITEM_RING:rValue = 1;break;
|
|
case BASE_ITEM_SMALLSHIELD:rValue = 1;break;
|
|
case BASE_ITEM_TOWERSHIELD:rValue = 1;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int IsModMax(object oTarget)
|
|
{
|
|
int Mods = IPGetNumberOfItemProperties(oTarget);
|
|
itemproperty ip = GetFirstItemProperty(oTarget);
|
|
while(GetIsItemPropertyValid(ip)){
|
|
if(GetItemPropertyType(ip) == ITEM_PROPERTY_VISUALEFFECT){Mods -= 1;}
|
|
ip = GetNextItemProperty(oTarget);
|
|
}
|
|
return (Mods >= FORGE_MAX_ENHANCEMENTS);
|
|
}
|
|
|
|
int DmgType(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 2:rValue = IP_CONST_DAMAGETYPE_FIRE;break;
|
|
case 3:rValue = IP_CONST_DAMAGETYPE_COLD;break;
|
|
case 4:rValue = IP_CONST_DAMAGETYPE_ELECTRICAL;break;
|
|
case 5:rValue = IP_CONST_DAMAGETYPE_ACID;break;
|
|
case 6:rValue = IP_CONST_DAMAGETYPE_SONIC;break;
|
|
case 7:rValue = IP_CONST_DAMAGETYPE_BLUDGEONING;break;
|
|
case 8:rValue = IP_CONST_DAMAGETYPE_SLASHING;break;
|
|
case 9:rValue = IP_CONST_DAMAGETYPE_PIERCING;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int EnhValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = 1;break;
|
|
case 2:rValue = 2;break;
|
|
case 3:rValue = 3;break;
|
|
case 4:rValue = 4;break;
|
|
case 5:rValue = 5;break;
|
|
case 6:rValue = 6;break;
|
|
case 7:rValue = 7;break;
|
|
case 8:rValue = 8;break;
|
|
case 9:rValue = 9;break;
|
|
case 10:rValue = 10;break;
|
|
case 11:rValue = IP_CONST_DAMAGEBONUS_1d4;break;
|
|
case 12:rValue = IP_CONST_DAMAGEBONUS_2d4;break;
|
|
case 13:rValue = IP_CONST_DAMAGEBONUS_2d6;break;
|
|
case 14:rValue = IP_CONST_DAMAGEBONUS_2d8;break;
|
|
case 15:rValue = IP_CONST_DAMAGEBONUS_1d6;break;
|
|
case 16:rValue = IP_CONST_DAMAGEBONUS_1d8;break;
|
|
case 17:rValue = IP_CONST_DAMAGEBONUS_1d10;break;
|
|
case 18:rValue = IP_CONST_DAMAGEBONUS_1d12;break;
|
|
case 19:rValue = IP_CONST_DAMAGEBONUS_2d10;break;
|
|
case 20:rValue = IP_CONST_DAMAGEBONUS_2d12;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int FeatValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_FEAT_ALERTNESS;break;
|
|
case 2:rValue = IP_CONST_FEAT_AMBIDEXTROUS;break;
|
|
case 3:rValue = IP_CONST_FEAT_ARMOR_PROF_HEAVY;break;
|
|
case 4:rValue = IP_CONST_FEAT_ARMOR_PROF_LIGHT;break;
|
|
case 5:rValue = IP_CONST_FEAT_ARMOR_PROF_MEDIUM;break;
|
|
case 6:rValue = IP_CONST_FEAT_CLEAVE;break;
|
|
case 7:rValue = IP_CONST_FEAT_COMBAT_CASTING;break;
|
|
case 8:rValue = IP_CONST_FEAT_DODGE;break;
|
|
case 9:rValue = IP_CONST_FEAT_EXTRA_TURNING;break;
|
|
case 10:rValue = IP_CONST_FEAT_IMPCRITUNARM;break;
|
|
case 11:rValue = IP_CONST_FEAT_KNOCKDOWN;break;
|
|
case 12:rValue = IP_CONST_FEAT_POINTBLANK;break;
|
|
case 13:rValue = IP_CONST_FEAT_POWERATTACK;break;
|
|
case 14:rValue = IP_CONST_FEAT_SPELLFOCUSABJ;break;
|
|
case 15:rValue = IP_CONST_FEAT_SPELLFOCUSCON;break;
|
|
case 16:rValue = IP_CONST_FEAT_SPELLFOCUSDIV;break;
|
|
case 17:rValue = IP_CONST_FEAT_SPELLFOCUSENC;break;
|
|
case 18:rValue = IP_CONST_FEAT_SPELLFOCUSEVO;break;
|
|
case 19:rValue = IP_CONST_FEAT_SPELLFOCUSILL;break;
|
|
case 20:rValue = IP_CONST_FEAT_SPELLFOCUSNEC;break;
|
|
case 21:rValue = IP_CONST_FEAT_SPELLPENETRATION;break;
|
|
case 22:rValue = IP_CONST_FEAT_TWO_WEAPON_FIGHTING;break;
|
|
case 23:rValue = IP_CONST_FEAT_WEAPFINESSE;break;
|
|
case 24:rValue = IP_CONST_FEAT_WEAPON_PROF_EXOTIC;break;
|
|
case 25:rValue = IP_CONST_FEAT_WEAPON_PROF_MARTIAL;break;
|
|
case 26:rValue = IP_CONST_FEAT_WEAPON_PROF_SIMPLE;break;
|
|
case 27:rValue = IP_CONST_FEAT_WEAPSPEUNARM;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SoakValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_DAMAGEREDUCTION_1;break;
|
|
case 2:rValue = IP_CONST_DAMAGEREDUCTION_2;break;
|
|
case 3:rValue = IP_CONST_DAMAGEREDUCTION_3;break;
|
|
case 4:rValue = IP_CONST_DAMAGEREDUCTION_4;break;
|
|
case 5:rValue = IP_CONST_DAMAGEREDUCTION_5;break;
|
|
case 6:rValue = IP_CONST_DAMAGEREDUCTION_6;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SoakAmount(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_DAMAGESOAK_5_HP;break;
|
|
case 2:rValue = IP_CONST_DAMAGESOAK_10_HP;break;
|
|
case 3:rValue = IP_CONST_DAMAGESOAK_15_HP;break;
|
|
case 4:rValue = IP_CONST_DAMAGESOAK_20_HP;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SaveValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_SAVEBASETYPE_FORTITUDE;break;
|
|
case 2:rValue = IP_CONST_SAVEBASETYPE_REFLEX;break;
|
|
case 3:rValue = IP_CONST_SAVEBASETYPE_WILL;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int AbilityValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_ABILITY_CHA;break;
|
|
case 2:rValue = IP_CONST_ABILITY_CON;break;
|
|
case 3:rValue = IP_CONST_ABILITY_DEX;break;
|
|
case 4:rValue = IP_CONST_ABILITY_INT;break;
|
|
case 5:rValue = IP_CONST_ABILITY_STR;break;
|
|
case 6:rValue = IP_CONST_ABILITY_WIS;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SkillValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = SKILL_ANIMAL_EMPATHY;break;
|
|
case 2:rValue = SKILL_APPRAISE;break;
|
|
case 3:rValue = SKILL_BLUFF;break;
|
|
case 4:rValue = SKILL_CONCENTRATION;break;
|
|
case 5:rValue = SKILL_CRAFT_ARMOR;break;
|
|
case 6:rValue = SKILL_CRAFT_TRAP;break;
|
|
case 7:rValue = SKILL_CRAFT_WEAPON;break;
|
|
case 8:rValue = SKILL_DISABLE_TRAP;break;
|
|
case 9:rValue = SKILL_DISCIPLINE;break;
|
|
case 10:rValue = SKILL_HEAL;break;
|
|
case 11:rValue = SKILL_HIDE;break;
|
|
case 12:rValue = SKILL_INTIMIDATE;break;
|
|
case 13:rValue = SKILL_LISTEN;break;
|
|
case 14:rValue = SKILL_LORE;break;
|
|
case 15:rValue = SKILL_MOVE_SILENTLY;break;
|
|
case 16:rValue = SKILL_OPEN_LOCK;break;
|
|
case 17:rValue = SKILL_PARRY;break;
|
|
case 18:rValue = SKILL_PERFORM;break;
|
|
case 19:rValue = SKILL_PERSUADE;break;
|
|
case 20:rValue = SKILL_PICK_POCKET;break;
|
|
case 21:rValue = SKILL_SEARCH;break;
|
|
case 22:rValue = SKILL_SET_TRAP;break;
|
|
case 23:rValue = SKILL_SPELLCRAFT;break;
|
|
case 24:rValue = SKILL_SPOT;break;
|
|
case 25:rValue = SKILL_TAUNT;break;
|
|
case 26:rValue = SKILL_TUMBLE;break;
|
|
case 27:rValue = SKILL_USE_MAGIC_DEVICE;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SpellResValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_SPELLRESISTANCEBONUS_10;break;
|
|
case 2:rValue = IP_CONST_SPELLRESISTANCEBONUS_12;break;
|
|
case 3:rValue = IP_CONST_SPELLRESISTANCEBONUS_14;break;
|
|
case 4:rValue = IP_CONST_SPELLRESISTANCEBONUS_16;break;
|
|
case 5:rValue = IP_CONST_SPELLRESISTANCEBONUS_18;break;
|
|
case 6:rValue = IP_CONST_SPELLRESISTANCEBONUS_20;break;
|
|
case 7:rValue = IP_CONST_SPELLRESISTANCEBONUS_22;break;
|
|
case 8:rValue = IP_CONST_SPELLRESISTANCEBONUS_24;break;
|
|
case 9:rValue = IP_CONST_SPELLRESISTANCEBONUS_26;break;
|
|
case 10:rValue = IP_CONST_SPELLRESISTANCEBONUS_28;break;
|
|
case 11:rValue = IP_CONST_SPELLRESISTANCEBONUS_30;break;
|
|
case 12:rValue = IP_CONST_SPELLRESISTANCEBONUS_32;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int AmmoType(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_UNLIMITEDAMMO_BASIC;break;
|
|
case 2:rValue = IP_CONST_UNLIMITEDAMMO_1D6COLD;break;
|
|
case 3:rValue = IP_CONST_UNLIMITEDAMMO_1D6FIRE;break;
|
|
case 4:rValue = IP_CONST_UNLIMITEDAMMO_1D6LIGHT;break;
|
|
case 5:rValue = IP_CONST_UNLIMITEDAMMO_PLUS1;break;
|
|
case 6:rValue = IP_CONST_UNLIMITEDAMMO_PLUS2;break;
|
|
case 7:rValue = IP_CONST_UNLIMITEDAMMO_PLUS3;break;
|
|
case 8:rValue = IP_CONST_UNLIMITEDAMMO_PLUS4;break;
|
|
case 9:rValue = IP_CONST_UNLIMITEDAMMO_PLUS5;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int VisualType(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = ITEM_VISUAL_ACID;break;
|
|
case 2:rValue = ITEM_VISUAL_COLD;break;
|
|
case 3:rValue = ITEM_VISUAL_ELECTRICAL;break;
|
|
case 4:rValue = ITEM_VISUAL_EVIL;break;
|
|
case 5:rValue = ITEM_VISUAL_FIRE;break;
|
|
case 6:rValue = ITEM_VISUAL_HOLY;break;
|
|
case 7:rValue = ITEM_VISUAL_SONIC;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int SpellClass(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_CLASS_BARD;break;
|
|
case 2:rValue = IP_CONST_CLASS_CLERIC;break;
|
|
case 3:rValue = IP_CONST_CLASS_DRUID;break;
|
|
case 4:rValue = IP_CONST_CLASS_PALADIN;break;
|
|
case 5:rValue = IP_CONST_CLASS_RANGER;break;
|
|
case 6:rValue = IP_CONST_CLASS_SORCERER;break;
|
|
case 7:rValue = IP_CONST_CLASS_WIZARD;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int ImmunityPercent(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_DAMAGEIMMUNITY_5_PERCENT;break;
|
|
case 2:rValue = IP_CONST_DAMAGEIMMUNITY_10_PERCENT;break;
|
|
case 3:rValue = IP_CONST_DAMAGEIMMUNITY_25_PERCENT;break;
|
|
case 4:rValue = IP_CONST_DAMAGEIMMUNITY_50_PERCENT;break;
|
|
case 5:rValue = IP_CONST_DAMAGEIMMUNITY_75_PERCENT;break;
|
|
case 6:rValue = IP_CONST_DAMAGEIMMUNITY_90_PERCENT;break;
|
|
case 7:rValue = IP_CONST_DAMAGEIMMUNITY_100_PERCENT;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int ImmunityValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_IMMUNITYMISC_DEATH_MAGIC;break;
|
|
case 2:rValue = IP_CONST_IMMUNITYMISC_DISEASE;break;
|
|
case 3:rValue = IP_CONST_IMMUNITYMISC_FEAR;break;
|
|
case 4:rValue = IP_CONST_IMMUNITYMISC_KNOCKDOWN;break;
|
|
case 5:rValue = IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN;break;
|
|
case 6:rValue = IP_CONST_IMMUNITYMISC_MINDSPELLS;break;
|
|
case 7:rValue = IP_CONST_IMMUNITYMISC_PARALYSIS;break;
|
|
case 8:rValue = IP_CONST_IMMUNITYMISC_POISON;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int IsEnhanced(int Token)
|
|
{
|
|
if(Token >= 2){return 0;}else{return 1;}
|
|
}
|
|
|
|
int IsSpecial(int Token)
|
|
{
|
|
if(Token < 10){return 0;}else{return 1;}
|
|
}
|
|
|
|
int ResValue(int Token)
|
|
{
|
|
int rValue = 0;
|
|
switch(Token){
|
|
case 1:rValue = IP_CONST_DAMAGERESIST_5;break;
|
|
case 2:rValue = IP_CONST_DAMAGERESIST_10;break;
|
|
case 3:rValue = IP_CONST_DAMAGERESIST_15;break;
|
|
case 4:rValue = IP_CONST_DAMAGERESIST_20;break;
|
|
}
|
|
return rValue;
|
|
}
|
|
|
|
int GetHasTokens(object oPC, int Count)
|
|
{
|
|
int Total = 0;
|
|
object oToken = GetFirstItemInInventory(oPC);
|
|
while(GetIsObjectValid(oToken))
|
|
{
|
|
if(GetTag(oToken) == "ldf_token")
|
|
{
|
|
Total = Total + GetItemStackSize(oToken);
|
|
}
|
|
oToken = GetNextItemInInventory(oPC);
|
|
}
|
|
return Total >= Count;
|
|
}
|
|
|
|
void GetTokens(object oPC, int Count)
|
|
{
|
|
int Done = FALSE;
|
|
object oToken = GetFirstItemInInventory(oPC);
|
|
while(GetIsObjectValid(oToken) && !Done)
|
|
{
|
|
if(GetTag(oToken) == "ldf_token")
|
|
{
|
|
int iStack = GetItemStackSize(oToken);
|
|
if(iStack > Count)
|
|
{
|
|
SetItemStackSize(oToken,(iStack-Count));
|
|
Done = TRUE;
|
|
} else {
|
|
Count = Count - iStack;
|
|
DestroyObject(oToken);
|
|
}
|
|
}
|
|
oToken = GetNextItemInInventory(oPC);
|
|
}
|
|
}
|
|
|
|
void ModGauntlets(object oTarget,string sTag)
|
|
{
|
|
string sToken = GetStringRight(sTag,2);
|
|
string sType = GetStringLeft(sToken,1);
|
|
string sValue = GetStringRight(sToken,1);
|
|
string sSpecial = GetStringLeft(sTag,1);
|
|
if(IsSpecial(TagDecode(sType))){
|
|
switch(TagDecode(sType)){
|
|
case 10:IPSafeAddItemProperty(oTarget,Enhancement(10));break;
|
|
case 21:IPSafeAddItemProperty(oTarget,Enhancement(21,ImmunityValue(TagDecode(sValue))));break;
|
|
case 22:IPSafeAddItemProperty(oTarget,Enhancement(22,AbilityValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 23:IPSafeAddItemProperty(oTarget,Enhancement(23));break;
|
|
case 24:IPSafeAddItemProperty(oTarget,Enhancement(24,SkillValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 25:IPSafeAddItemProperty(oTarget,Enhancement(25));break;
|
|
case 26:IPSafeAddItemProperty(oTarget,Enhancement(26,SoakValue(TagDecode(sSpecial)),SoakAmount(TagDecode(sValue))));break;
|
|
case 27:IPSafeAddItemProperty(oTarget,Enhancement(27,SaveValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 28:IPSafeAddItemProperty(oTarget,Enhancement(28,FeatValue(TagDecode(sValue))));break;
|
|
case 29:IPSafeAddItemProperty(oTarget,Enhancement(29,TagDecode(sValue)));break;
|
|
case 31:IPSafeAddItemProperty(oTarget,Enhancement(31,SpellResValue(TagDecode(sValue))));break;
|
|
case 32:IPSafeAddItemProperty(oTarget,Enhancement(32,SpellClass(TagDecode(sSpecial)),TagDecode(sValue)),0.0,X2_IP_ADDPROP_POLICY_IGNORE_EXISTING);break;
|
|
case 33:IPSafeAddItemProperty(oTarget,Enhancement(33));break;
|
|
case 34:IPSafeAddItemProperty(oTarget,Enhancement(34,DmgType(TagDecode(sSpecial)),ImmunityPercent(TagDecode(sValue))));break;
|
|
}
|
|
} else {
|
|
if(IsEnhanced(TagDecode(sType))){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(5,TagDecode(sValue)));
|
|
IPSafeAddItemProperty(oTarget,Enhancement(20,TagDecode(sValue)));
|
|
} else {
|
|
IPSafeAddItemProperty(oTarget,Enhancement(3,
|
|
DmgType(TagDecode(sType)),
|
|
EnhValue(TagDecode(sValue))));
|
|
}}
|
|
}
|
|
|
|
int GetModCost(object oOriginal,object oForge, object oAnvil, string Mods)
|
|
{
|
|
object oModified;
|
|
int x,y,z;
|
|
oModified = CopyItem(oOriginal,oAnvil);
|
|
DoEnhancements(oModified,Mods);
|
|
x = GetGoldPieceValue(oModified);
|
|
y = GetGoldPieceValue(oOriginal);
|
|
DestroyObject(oModified);
|
|
z = (x-y)/FORGE_TOKEN_VALUE;
|
|
if(z < 1){z = 1;}
|
|
return z;
|
|
}
|
|
|
|
string ForgeSetTag(string sStr, string sValue, int Pos)
|
|
{
|
|
string sTemp = "";
|
|
switch(Pos)
|
|
{
|
|
case 1:{sTemp = sValue+GetStringRight(sStr,2);}break;
|
|
case 2:{sTemp = GetStringLeft(sStr,1)+sValue+GetStringRight(sStr,1);}break;
|
|
case 3:{sTemp = GetStringLeft(sStr,2)+sValue;}break;
|
|
}
|
|
return sTemp;
|
|
}
|
|
|
|
void DoEnhancements(object oTarget,string sTag)
|
|
{
|
|
if(GetBaseItemType(oTarget) == BASE_ITEM_GLOVES){
|
|
ModGauntlets(oTarget,sTag);
|
|
return;}
|
|
string sToken = GetStringRight(sTag,2);
|
|
string sType = GetStringLeft(sToken,1);
|
|
string sValue = GetStringRight(sToken,1);
|
|
string sSpecial = GetStringLeft(sTag,1);
|
|
if(IsSpecial(TagDecode(sType))){
|
|
switch(TagDecode(sType)){
|
|
case 10:IPSafeAddItemProperty(oTarget,Enhancement(10));break;
|
|
case 11:if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(11));
|
|
return;
|
|
}break;
|
|
case 12:if(IPGetIsRangedWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(12,AmmoType(TagDecode(sValue))));
|
|
}break;
|
|
case 13:if(IPGetIsRangedWeapon(oTarget) || IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(13,EnhValue(TagDecode(sValue))));
|
|
}break;
|
|
case 14:if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(14,TagDecode(sValue)));
|
|
}break;
|
|
case 21:IPSafeAddItemProperty(oTarget,Enhancement(21,ImmunityValue(TagDecode(sValue))));break;
|
|
case 22:IPSafeAddItemProperty(oTarget,Enhancement(22,AbilityValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 23:IPSafeAddItemProperty(oTarget,Enhancement(23));break;
|
|
case 24:IPSafeAddItemProperty(oTarget,Enhancement(24,SkillValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 25:IPSafeAddItemProperty(oTarget,Enhancement(25));break;
|
|
case 26:IPSafeAddItemProperty(oTarget,Enhancement(26,SoakValue(TagDecode(sSpecial)),SoakAmount(TagDecode(sValue))));break;
|
|
case 27:IPSafeAddItemProperty(oTarget,Enhancement(27,SaveValue(TagDecode(sSpecial)),TagDecode(sValue)));break;
|
|
case 28:IPSafeAddItemProperty(oTarget,Enhancement(28,FeatValue(TagDecode(sValue))));break;
|
|
case 29:IPSafeAddItemProperty(oTarget,Enhancement(29,TagDecode(sValue)));break;
|
|
case 30:if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(30));
|
|
}break;
|
|
case 31:IPSafeAddItemProperty(oTarget,Enhancement(31,SpellResValue(TagDecode(sValue))));break;
|
|
case 32:IPSafeAddItemProperty(oTarget,Enhancement(32,SpellClass(TagDecode(sSpecial)),TagDecode(sValue)),0.0,X2_IP_ADDPROP_POLICY_IGNORE_EXISTING);break;
|
|
case 33:IPSafeAddItemProperty(oTarget,Enhancement(33));break;
|
|
case 34:IPSafeAddItemProperty(oTarget,Enhancement(34,DmgType(TagDecode(sSpecial)),ImmunityPercent(TagDecode(sValue))));break;
|
|
case 35:if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(35,VisualType(TagDecode(sValue))));break;
|
|
}break;
|
|
}
|
|
} else {
|
|
if(IsEnhanced(TagDecode(sType))){
|
|
if(IPGetIsRangedWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(5,TagDecode(sValue)));
|
|
IPSafeAddItemProperty(oTarget,Enhancement(6,TagDecode(sValue)));
|
|
return;
|
|
}
|
|
if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(1,TagDecode(sValue)));
|
|
} else {
|
|
IPSafeAddItemProperty(oTarget,Enhancement(2,TagDecode(sValue)));
|
|
}
|
|
} else {
|
|
if(IPGetIsMeleeWeapon(oTarget)){
|
|
IPSafeAddItemProperty(oTarget,Enhancement(3,
|
|
DmgType(TagDecode(sType)),
|
|
EnhValue(TagDecode(sValue))));
|
|
} else {
|
|
IPSafeAddItemProperty(oTarget,Enhancement(4,
|
|
DmgType(TagDecode(sType)),
|
|
ResValue(TagDecode(sValue))));
|
|
}
|
|
}}
|
|
return;
|
|
}
|
|
|
|
//void main(){}
|