Initial commit. Updated release archive.
This commit is contained in:
141
_removed/add_spell_dc.nss
Normal file
141
_removed/add_spell_dc.nss
Normal file
@@ -0,0 +1,141 @@
|
||||
#include "prc_dg_inc"
|
||||
#include "strat_prc_inc"
|
||||
#include "discipleinclude"
|
||||
#include "inc_prc_function"
|
||||
#include "lookup_2da_spell"
|
||||
#include "heartward_inc"
|
||||
|
||||
//Added code to correct problems in Hierophant spell-like abilities.
|
||||
//Added code to apply Spell Power bonuses
|
||||
//Aaon Graywolf - Jan 6, 2004
|
||||
|
||||
// * Hierophant spell-like abilities compute DC by using the character's Hierophant
|
||||
// * level in place of spell level. So we'll need to look up the spell level of the
|
||||
// * abiltiy in the 2da tables and fix this problem.
|
||||
int GetHierophantSLAAdjustment(object oCaster)
|
||||
{
|
||||
if(GetWasLastSpellHieroSLA())
|
||||
return StringToInt(lookup_spell_cleric_level(GetSpellId())) - GetLevelByClass(CLASS_TYPE_HIEROPHANT, oCaster);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetHeartWarderDC(object oCaster)
|
||||
{
|
||||
if(GetLevelByClass(CLASS_TYPE_HEARTWARDER,oCaster)<6)
|
||||
return 0;
|
||||
|
||||
string VS=lookup_spell_vs(GetSpellId());
|
||||
if (!(VS=="s" ||VS=="vs"))
|
||||
return 0;
|
||||
|
||||
if ( GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ENCHANTMENT,oCaster) || GetMetaMagicFeat()==METAMAGIC_SILENT || GetHasFeat(FEAT_EPIC_SPELL_FOCUS_ENCHANTMENT,oCaster))
|
||||
return 0;
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR")==SPELL_SCHOOL_ENCHANTMENT)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int add_fire_dc()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nDC = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_FIRE, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nDC += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nDC += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nDC += 1;
|
||||
}
|
||||
|
||||
return nDC;
|
||||
}
|
||||
|
||||
int add_elec_dc()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nDC = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_ELEC, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nDC += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nDC += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nDC += 1;
|
||||
}
|
||||
|
||||
return nDC;
|
||||
}
|
||||
|
||||
int add_cold_dc()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nDC = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_COLD, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nDC += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nDC += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nDC += 1;
|
||||
}
|
||||
|
||||
return nDC;
|
||||
}
|
||||
|
||||
int add_acid_dc()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nDC = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_ACID, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nDC += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nDC += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nDC += 1;
|
||||
}
|
||||
|
||||
return nDC;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
string element = lookup_spell_type(GetSpellId());
|
||||
|
||||
int nDC = 0;
|
||||
|
||||
//Sorry to mess with your scripts, but I needed to make sure
|
||||
//that spell power and hierophant spell-like ability adjustments
|
||||
//didn't get short circuited by these functions. All I did was
|
||||
//change your functions to return ints and add them up at the end
|
||||
//instead of terminating the script.
|
||||
// - Aaon Graywolf
|
||||
if (element == "Fire")
|
||||
nDC += add_fire_dc();
|
||||
else if (element == "Cold")
|
||||
nDC += add_cold_dc();
|
||||
else if (element == "Electricity")
|
||||
nDC += add_elec_dc();
|
||||
else if (element == "Acid")
|
||||
nDC += add_acid_dc();
|
||||
|
||||
nDC += GetSpellPowerBonus(oCaster);
|
||||
nDC += GetHierophantSLAAdjustment(oCaster);
|
||||
nDC += GetHeartWarderDC(oCaster);
|
||||
|
||||
SetLocalInt(oCaster,"X2_L_LAST_RETVAR", nDC);
|
||||
}
|
||||
|
||||
122
_removed/add_spell_penetr.nss
Normal file
122
_removed/add_spell_penetr.nss
Normal file
@@ -0,0 +1,122 @@
|
||||
#include "prc_dg_inc"
|
||||
#include "strat_prc_inc"
|
||||
#include "discipleinclude"
|
||||
#include "inc_prc_function"
|
||||
#include "lookup_2da_spell"
|
||||
|
||||
int add_fire_SP()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nSP = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_FIRE, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nSP += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nSP += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nSP += 1;
|
||||
}
|
||||
|
||||
return nSP;
|
||||
}
|
||||
|
||||
int add_elec_SP()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nSP = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_ELEC, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nSP += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nSP += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nSP += 1;
|
||||
}
|
||||
|
||||
return nSP;
|
||||
}
|
||||
|
||||
int add_cold_SP()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nSP = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_COLD, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nSP += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nSP += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nSP += 1;
|
||||
}
|
||||
|
||||
return nSP;
|
||||
}
|
||||
|
||||
int add_acid_SP()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nSP = 0;
|
||||
|
||||
if ( GetHasFeat( FEAT_ES_ACID, oCaster ))
|
||||
{
|
||||
if ( GetHasFeat ( FEAT_ES_FOCUS_3, oCaster ))
|
||||
nSP += 3;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_2, oCaster ))
|
||||
nSP += 2;
|
||||
else if ( GetHasFeat ( FEAT_ES_FOCUS_1, oCaster ))
|
||||
nSP += 1;
|
||||
}
|
||||
|
||||
return nSP;
|
||||
}
|
||||
|
||||
int GetHeartWarderPene(object oCaster)
|
||||
{
|
||||
if(GetLevelByClass(CLASS_TYPE_HEARTWARDER,oCaster)<6)
|
||||
return 0;
|
||||
|
||||
string VS=lookup_spell_vs(GetSpellId());
|
||||
if (!(VS=="s" ||VS=="vs"))
|
||||
return 0;
|
||||
|
||||
if ( GetHasFeat(FEAT_SPELL_PENETRATION,oCaster) || GetMetaMagicFeat()==METAMAGIC_SILENT || GetHasFeat(FEAT_GREATER_SPELL_PENETRATION,oCaster)|| GetHasFeat(FEAT_EPIC_SPELL_PENETRATION,oCaster))
|
||||
return 0;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = OBJECT_SELF;
|
||||
string element = lookup_spell_type(GetSpellId());
|
||||
|
||||
int nSP = 0;
|
||||
|
||||
//Sorry to mess with your scripts, but I needed to make sure
|
||||
//that spell power and hierophant spell-like ability adjustments
|
||||
//didn't get short circuited by these functions. All I did was
|
||||
//change your functions to return ints and add them up at the end
|
||||
//instead of terminating the script.
|
||||
// - Aaon Graywolf
|
||||
if (element == "Fire")
|
||||
nSP += add_fire_SP();
|
||||
else if (element == "Cold")
|
||||
nSP += add_cold_SP();
|
||||
else if (element == "Electricity")
|
||||
nSP += add_elec_SP();
|
||||
else if (element == "Acid")
|
||||
nSP += add_acid_SP();
|
||||
|
||||
nSP += GetSpellPowerBonus(oCaster);
|
||||
|
||||
nSP += GetHeartWarderPene(oCaster);
|
||||
|
||||
SetLocalInt(oCaster,"X2_L_LAST_RETVAR", nSP);
|
||||
}
|
||||
|
||||
81
_removed/archmage_fire.nss
Normal file
81
_removed/archmage_fire.nss
Normal file
@@ -0,0 +1,81 @@
|
||||
#include "prc_dg_inc"
|
||||
#include "lookup_2da_spell"
|
||||
|
||||
#include "prc_alterations"
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
#include "x2_i0_spells"
|
||||
|
||||
/*
|
||||
* This is the spellhook code, called when the Arcane Fire feat is activated
|
||||
* Turns the spell into an arcane fire
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
//Declare major variables ( fDist / (3.0f * log( fDist ) + 2.0f) )
|
||||
object oTarget = GetLocalObject(OBJECT_SELF, "arcane_fire_target");
|
||||
int nCasterLvl = GetLevelByClass(CLASS_TYPE_ARCHMAGE, OBJECT_SELF);
|
||||
int nDamage = 0;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
int nCnt;
|
||||
effect eMissile = EffectVisualEffect(VFX_IMP_MIRV);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE);
|
||||
float fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
|
||||
float fDelay = fDist/(3.0 * log(fDist) + 2.0);
|
||||
float fDelay2, fTime;
|
||||
string nSpellLevel = lookup_spell_level(GetSpellId());
|
||||
|
||||
/* Whatever happens next we must restore the hook */
|
||||
SetModuleOverrideSpellscript(GetLocalString(GetModule(), "archmage_save_overridespellscript"));
|
||||
|
||||
/* Tell to not execute the original spell */
|
||||
SetModuleOverrideSpellScriptFinished();
|
||||
|
||||
/* Allow to use it once again */
|
||||
SetLocalInt(OBJECT_SELF, "arcane_fire_active", 0);
|
||||
|
||||
/* Paranoia -- should never happen */
|
||||
if (!GetHasFeat(FEAT_ARCANE_FIRE, OBJECT_SELF)) return;
|
||||
|
||||
/* Only wizard/sorc spells */
|
||||
if (nSpellLevel == "")
|
||||
{
|
||||
FloatingTextStringOnCreature("Arcane Fire can only consume arcane spells.", OBJECT_SELF, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* No item casting */
|
||||
if (GetIsObjectValid(GetSpellCastItem()))
|
||||
{
|
||||
FloatingTextStringOnCreature("Arcane Fire may not be used with scrolls.", OBJECT_SELF, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE));
|
||||
|
||||
//Make ranged touch attack check
|
||||
if (TouchAttackRanged(oTarget, TRUE))
|
||||
{
|
||||
//Roll damage
|
||||
int nDam = d6(nCasterLvl + StringToInt(nSpellLevel));
|
||||
|
||||
fTime = fDelay;
|
||||
fDelay2 += 0.1;
|
||||
fTime += fDelay2;
|
||||
|
||||
//Set damage effect
|
||||
effect eDam = EffectDamage(nDam, DAMAGE_TYPE_MAGICAL);
|
||||
//Apply the MIRV and damage effect
|
||||
DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
DelayCommand(fTime, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget));
|
||||
DelayCommand(fDelay2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget));
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
_removed/archmage_spelllk.nss
Normal file
49
_removed/archmage_spelllk.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "prc_dg_inc"
|
||||
|
||||
#include "prc_alterations"
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
#include "x2_i0_spells"
|
||||
|
||||
/*
|
||||
* This is the spellhook code, called when the Spell-Like feat is activated
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
object focus = GetItemPossessedBy(OBJECT_SELF, "ArchmagesFocusofPower");
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
string nSpellLevel = Get2DAString("spells", "Wiz_Sorc", GetSpellId());
|
||||
string nEpicSpell = Get2DAString("spells", "Innate", GetSpellId());
|
||||
|
||||
/* Whatever happens next we must restore the hook */
|
||||
SetModuleOverrideSpellscript(GetLocalString(GetModule(), "spelllike_save_overridespellscript"));
|
||||
|
||||
/* Tell to not execute the original spell */
|
||||
SetModuleOverrideSpellScriptFinished();
|
||||
|
||||
/* Paranoia -- should never happen */
|
||||
if (!GetHasFeat(FEAT_SPELL_LIKE, OBJECT_SELF)) return;
|
||||
|
||||
/* Only wizard/sorc spells */
|
||||
if ((nSpellLevel == "") && (nEpicSpell != "10" ))
|
||||
{
|
||||
FloatingTextStringOnCreature("Spell-Like can only use arcane spells.", OBJECT_SELF, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* No item casting */
|
||||
if (GetIsObjectValid(GetSpellCastItem()))
|
||||
{
|
||||
FloatingTextStringOnCreature("Spell-Like may not be used with scrolls.", OBJECT_SELF, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Setup is done */
|
||||
SetLocalInt(focus, "spell_like_setup", 0);
|
||||
|
||||
/* Store all the info needed */
|
||||
SetLocalInt(focus, "spell_like_spell", GetSpellId());
|
||||
SetLocalInt(focus, "spell_like_meta", nMetaMagic);
|
||||
|
||||
FloatingTextStringOnCreature("Spell-Like ability ready.", OBJECT_SELF, FALSE);
|
||||
}
|
||||
65
_removed/bodyofflame.nss
Normal file
65
_removed/bodyofflame.nss
Normal file
@@ -0,0 +1,65 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Fire Shield
|
||||
//:: NW_S0_FireShld.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Fire Shield for the Disciple of Mephistopheles
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created On: Aug 28, 2003, GZ: Fixed stacking issue
|
||||
|
||||
//Fixed several compile time errors.
|
||||
//Aaon Graywolf - Jan 8, 2004
|
||||
|
||||
#include "x2_inc_spellhook"
|
||||
#include "x0_i0_spells"
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
int nDuration = 600;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
object oTarget = OBJECT_SELF;
|
||||
object oArmour = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF);
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_INFERNO_CHEST);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_INFERNO_CHEST);
|
||||
effect eDR = EffectDamageResistance(10, DAMAGE_POWER_PLUS_ONE, 0);
|
||||
effect eFire = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 100);
|
||||
itemproperty eShield = ItemPropertyOnHitCastSpell( IP_CONST_ONHIT_CASTSPELL_COMBUST, 15);
|
||||
|
||||
//Link effects
|
||||
effect eLink = EffectLinkEffects(eDR, eFire);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eVis);
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic == METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply the VFX impact and effects
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
||||
AddItemProperty(DURATION_TYPE_TEMPORARY, eShield, oArmour, RoundsToSeconds(nDuration));
|
||||
}
|
||||
|
||||
556
_removed/cotw_include.nss
Normal file
556
_removed/cotw_include.nss
Normal file
@@ -0,0 +1,556 @@
|
||||
|
||||
// ****************************************************************************
|
||||
// CONFIGURATION
|
||||
// ****************************************************************************
|
||||
|
||||
// The COTW_INCREASE_* constants specify the rate of player levels per increase.
|
||||
// A value of 4.0 would specify the effect will increase every 4 player levels.
|
||||
// A value of 0.0 would specify the effect will never increase.
|
||||
const float COTW_INCREASE_HEAL_TYPE = 4.0;
|
||||
const float COTW_INCREASE_ATTACK_BONUS = 4.0;
|
||||
const float COTW_INCREASE_ARMOR_CLASS = 1.5;
|
||||
const float COTW_INCREASE_REGEN = 4.0;
|
||||
const float COTW_INCREASE_NUM_ATTACK = 6.0;
|
||||
const float COTW_INCREASE_DAMAGE = 3.0;
|
||||
const float COTW_INCREASE_CON = 3.0;
|
||||
const float COTW_INCREASE_STR = 3.0;
|
||||
const float COTW_INCREASE_LISTEN_SPOT = 1.5;
|
||||
// How much should the movement speed increase per level? (Maximum movement speed is 150)
|
||||
const float COTW_MOVEMENT_SPEED = 2.5;
|
||||
// How many seconds should pass between regenerating HP?
|
||||
const float COTW_REGEN_TIMER = 6.0;
|
||||
|
||||
// While in wolf state the player can have random bad effects.
|
||||
const int COTW_USE_BAD_EFFECTS = TRUE;
|
||||
// Chance that the player will become confused while in the werewolf state and
|
||||
// they are in combat.
|
||||
const int COTW_USE_BLOODLUST = TRUE;
|
||||
// Set how often to time the bloodlust/bad effect checks (increase time to
|
||||
// reduce CPU usage)
|
||||
const float COTW_TIMER = 120.0f;
|
||||
|
||||
// ****************************************************************************
|
||||
// CONSTANTS
|
||||
// ****************************************************************************
|
||||
|
||||
const string COTW_ITEM_STOP_WOLF = "cotw_on_activate_stop";
|
||||
const string COTW_ITEM_START_WOLF = "cotw_on_activate_start";
|
||||
const string COTW_ITEM_STOP_RESREF = "cotw_on_act_stop";
|
||||
const string COTW_ITEM_START_RESREF = "cotw_on_act_star";
|
||||
const string COTW_ITEM_DM_WIDGET = "cotw_on_activate_dm";
|
||||
|
||||
const string COTW_CACHED_ITEM = "cotw_cached_item";
|
||||
const string COTW_STATE_MACHINE = "cotw_state_machine";
|
||||
const string COTW_HEALED = "cotw_healed";
|
||||
const int COTW_STATE_INACTIVE = 0;
|
||||
const int COTW_STATE_WOLF = 1;
|
||||
const int COTW_STATE_NORMAL = 2;
|
||||
|
||||
// ****************************************************************************
|
||||
// FUNCTION DECLARATIONS/PROTOTYPES
|
||||
// ****************************************************************************
|
||||
|
||||
// COTWGetBAB
|
||||
// Calculates the basic attack bonus based on the classes that oTarget possesses.
|
||||
// object oTarget - the target to get the basic attack bonus of.
|
||||
// Returns the basic attack bonus.
|
||||
int COTWGetBAB (object oTarget);
|
||||
|
||||
// COTWRemoveWolfEffects
|
||||
// Removes the werewolf effect from OBJECT_SELF.
|
||||
void COTWRemoveWolfEffect();
|
||||
|
||||
// COTWDebug
|
||||
// Modify this function if you want to enable debugging messages for this script.
|
||||
void COTWDebug(string sMsg);
|
||||
|
||||
// COTWWolfGetDmgBonus
|
||||
// int iDmg - a value between 1 to 7.
|
||||
// Returns a DAMAGE_BONUS_* constant based on the value supplied.
|
||||
int COTWWolfGetDmgBonus (int iDmg);
|
||||
|
||||
// COTWWolfGetHealType
|
||||
// int iHeal - a value between 1 to 6.
|
||||
// Returns a cure wounds SPELL_* constant based on the value supplied.
|
||||
int COTWWolfGetHealType (int iHeal);
|
||||
|
||||
// COTWCreateWolfEffect
|
||||
// Creates the werewolf effect from OBJECT_SELF.
|
||||
// int bInstant - setting this to true will skip the healing and transformation
|
||||
// visuals.
|
||||
void COTWCreateWolfEffect(int bInstant = FALSE);
|
||||
|
||||
// COTWStartWolf
|
||||
// Creates the werewolf effect and changes the activated item.
|
||||
// object oPC - player to make into a werewolf.
|
||||
// object oActivatedItem - item
|
||||
void COTWStartWolf (object oPC, object oActivatedItem);
|
||||
|
||||
// COTWStopWolf
|
||||
// Removes the werewolf effect and changes the activated item.
|
||||
// object oPC - player to make normal.
|
||||
// object oActivatedItem - item
|
||||
void COTWStopWolf (object oPC, object oActivatedItem);
|
||||
|
||||
// COTWTimer
|
||||
// Timer that runs on the player while they are in the werewolf state.
|
||||
void COTWTimer ();
|
||||
|
||||
// COTWOnActivateItem
|
||||
// OnActivateItem event handler. Returns TRUE if it could handle activating
|
||||
// the item.
|
||||
// object oUser - person activating the item
|
||||
// object oTarget - target of the item
|
||||
// object oItem - the activated item
|
||||
int COTWOnActivateItem (object oUser, object oTarget, object oItem);
|
||||
|
||||
// COTWOnUnAcquiredItem
|
||||
// OnUnAcquiredItem event handler. Returns TRUE if it could handle activating
|
||||
// the item.
|
||||
// object oPC - person dropping the item
|
||||
// object oItem - the lost item
|
||||
int COTWOnUnAcquiredItem (object oPC, object oItem);
|
||||
|
||||
// COTWOnPlayerDeath
|
||||
// OnPlayerDeath event handler. Returns TRUE if the player lost the werewolf
|
||||
// effect from death.
|
||||
// object oPC - person who died
|
||||
int COTWOnPlayerDeath (object oPC);
|
||||
|
||||
// COTWOnClientEnter
|
||||
// OnClientEnter event handler. Applies the werewolf effect if the player
|
||||
// has the item that signifies being a werewolf.
|
||||
// object oPC - person who entered the module
|
||||
void COTWOnClientEnter (object oPC);
|
||||
|
||||
// ****************************************************************************
|
||||
// FUNCTIONS
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWGetBAB (object oTarget)
|
||||
{
|
||||
// Original function by Jasperre posted on the bioboards at 19 May 2003
|
||||
// oTarget - the creature to find the BAB for.
|
||||
// Returns: Base Attack Bonus (strictly by class, no ability/item modifiers)
|
||||
|
||||
if (!GetIsObjectValid(oTarget)) return 0;
|
||||
int nBAB1 = GetLevelByClass(CLASS_TYPE_RANGER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_FIGHTER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_PALADIN, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_BARBARIAN, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_DRAGON, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_OUTSIDER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_MONSTROUS, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_BLACKGUARD, oTarget);
|
||||
int nBAB2 = GetLevelByClass(CLASS_TYPE_ABERRATION, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_ANIMAL, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_BARD, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_BEAST, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_CLERIC, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_CONSTRUCT, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_DRUID, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_ELEMENTAL, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_GIANT, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_HUMANOID, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_MAGICAL_BEAST, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_MONK, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_ROGUE, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_SHAPECHANGER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_VERMIN, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_ASSASSIN, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_HARPER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oTarget);
|
||||
int nBAB3 = GetLevelByClass(CLASS_TYPE_COMMONER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_FEY, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_UNDEAD, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_SORCERER, oTarget)
|
||||
+ GetLevelByClass(CLASS_TYPE_WIZARD, oTarget);
|
||||
int nBaseBAB = nBAB1 + (nBAB2 * 3 / 4) + (nBAB3 / 2);
|
||||
return nBaseBAB;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWRemoveWolfEffect()
|
||||
{
|
||||
// We can't just add more spell effects because they will stack.
|
||||
// We have to remove any existing spell effects first.
|
||||
effect eEffect = GetFirstEffect(OBJECT_SELF);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
if (GetEffectType(eEffect) == EFFECT_TYPE_POLYMORPH)
|
||||
{
|
||||
// Is the effect extraordinary?
|
||||
if (GetEffectSubType(eEffect) == SUBTYPE_SUPERNATURAL)
|
||||
{
|
||||
RemoveEffect(OBJECT_SELF, eEffect);
|
||||
}
|
||||
}
|
||||
eEffect = GetNextEffect(OBJECT_SELF);
|
||||
}
|
||||
SetLocalInt(OBJECT_SELF, COTW_STATE_MACHINE, COTW_STATE_NORMAL);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWDebug(string sMsg)
|
||||
{
|
||||
//SendMessageToPC(OBJECT_SELF, sMsg);
|
||||
SendMessageToAllDMs(sMsg);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWWolfGetDmgBonus (int iDmg)
|
||||
{
|
||||
// Return a damage bonus constant.
|
||||
switch (iDmg)
|
||||
{
|
||||
case 1: return DAMAGE_BONUS_2;
|
||||
case 2: return DAMAGE_BONUS_1d4;
|
||||
case 3: return DAMAGE_BONUS_1d6;
|
||||
case 4: return DAMAGE_BONUS_1d8;
|
||||
case 5: return DAMAGE_BONUS_1d10;
|
||||
case 6: return DAMAGE_BONUS_2d6;
|
||||
case 7: return DAMAGE_BONUS_2d6;
|
||||
}
|
||||
return DAMAGE_BONUS_1;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWWolfGetHealType (int iHeal)
|
||||
{
|
||||
// Return a cure wounds spell.
|
||||
switch (iHeal)
|
||||
{
|
||||
case 1: return SPELL_CURE_MINOR_WOUNDS;
|
||||
case 2: return SPELL_CURE_LIGHT_WOUNDS;
|
||||
case 3: return SPELL_CURE_MODERATE_WOUNDS;
|
||||
case 4: return SPELL_CURE_SERIOUS_WOUNDS;
|
||||
case 5: return SPELL_CURE_CRITICAL_WOUNDS;
|
||||
case 6: return SPELL_HEAL;
|
||||
}
|
||||
return SPELL_HEAL;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWCreateWolfEffect(int bInstant = FALSE)
|
||||
{
|
||||
// Create the werewolf effect.
|
||||
|
||||
// Check if they are already under the effect of the timer.
|
||||
if (GetLocalInt(OBJECT_SELF, COTW_STATE_MACHINE) == COTW_STATE_WOLF)
|
||||
{
|
||||
COTWRemoveWolfEffect();
|
||||
} else {
|
||||
if ((COTW_USE_BAD_EFFECTS || COTW_USE_BLOODLUST) && COTW_TIMER > 0.0)
|
||||
DelayCommand(COTW_TIMER, COTWTimer());
|
||||
}
|
||||
|
||||
// Find the character level
|
||||
int iCharLevel = GetHitDice(OBJECT_SELF);
|
||||
// If the effect isn't being instantly created, then creating the wolf effect
|
||||
// heals the character.
|
||||
if (COTW_INCREASE_HEAL_TYPE > 0.0)
|
||||
{
|
||||
if ((!bInstant) && (GetLocalInt(OBJECT_SELF, COTW_HEALED) == 0))
|
||||
{
|
||||
// Prevent the player from repeatedly changing shape for the free heals.
|
||||
DelayCommand(480.0, DeleteLocalInt(OBJECT_SELF, COTW_HEALED));
|
||||
SetLocalInt(OBJECT_SELF, COTW_HEALED, 1);
|
||||
int iSpellID = COTWWolfGetHealType(FloatToInt(iCharLevel / COTW_INCREASE_HEAL_TYPE)+1);
|
||||
ActionCastSpellAtObject(iSpellID, OBJECT_SELF, METAMAGIC_EMPOWER, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
|
||||
}
|
||||
}
|
||||
// Start building up the wolf effect.
|
||||
effect eWolf = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
||||
if (COTW_INCREASE_ATTACK_BONUS > 0.0)
|
||||
{
|
||||
// Increase attack bonus.
|
||||
int iABInc = iCharLevel - COTWGetBAB(OBJECT_SELF) + FloatToInt(iCharLevel / COTW_INCREASE_ATTACK_BONUS);
|
||||
eWolf = EffectLinkEffects (EffectAttackIncrease(iABInc, ATTACK_BONUS_MISC), eWolf);
|
||||
COTWDebug("Wolf: Increasing AB by: "+IntToString(iABInc));
|
||||
}
|
||||
if (COTW_INCREASE_ARMOR_CLASS > 0.0)
|
||||
{
|
||||
// Increase armor class.
|
||||
int iACInc = FloatToInt(iCharLevel / COTW_INCREASE_ARMOR_CLASS);
|
||||
eWolf = EffectLinkEffects (EffectACIncrease(iACInc), eWolf);
|
||||
COTWDebug("Wolf: Increasing AC by: "+IntToString(iACInc));
|
||||
}
|
||||
if (COTW_INCREASE_REGEN > 0.0)
|
||||
{
|
||||
// Increase regeneration.
|
||||
int iRegen = FloatToInt(iCharLevel / COTW_INCREASE_REGEN);
|
||||
eWolf = EffectLinkEffects (EffectRegenerate(iRegen, COTW_REGEN_TIMER), eWolf);
|
||||
COTWDebug("Wolf: Increasing Regen by: "+IntToString(iRegen));
|
||||
}
|
||||
if (COTW_INCREASE_NUM_ATTACK > 0.0)
|
||||
{
|
||||
// Increase number of attacks.
|
||||
int iAttacks = FloatToInt(iCharLevel / COTW_INCREASE_NUM_ATTACK);
|
||||
eWolf = EffectLinkEffects (EffectModifyAttacks(iAttacks), eWolf);
|
||||
COTWDebug("Wolf: Increasing number of attacks by: "+IntToString(iAttacks));
|
||||
}
|
||||
if (COTW_MOVEMENT_SPEED > 0.0)
|
||||
{
|
||||
// Increase movement speed.
|
||||
int iSpeed = FloatToInt(iCharLevel * COTW_MOVEMENT_SPEED);
|
||||
eWolf = EffectLinkEffects (EffectMovementSpeedIncrease(iSpeed), eWolf);
|
||||
COTWDebug("Wolf: movement speed by: "+IntToString(iSpeed));
|
||||
}
|
||||
if (COTW_INCREASE_DAMAGE > 0.0)
|
||||
{
|
||||
// Increase unarmed damage.
|
||||
int iDmg = COTWWolfGetDmgBonus(FloatToInt(iCharLevel / COTW_INCREASE_DAMAGE));
|
||||
eWolf = EffectLinkEffects (EffectDamageIncrease(iDmg), eWolf);
|
||||
COTWDebug("Wolf: Damage by: "+IntToString(iDmg));
|
||||
}
|
||||
if (COTW_INCREASE_CON > 0.0)
|
||||
{
|
||||
// Increase constitution.
|
||||
int iCon = FloatToInt(iCharLevel / COTW_INCREASE_CON);
|
||||
eWolf = EffectLinkEffects (EffectAbilityIncrease(ABILITY_CONSTITUTION, iCon), eWolf);
|
||||
COTWDebug("Wolf: Increase constitution by: "+IntToString(iCon));
|
||||
}
|
||||
if (COTW_INCREASE_STR > 0.0)
|
||||
{
|
||||
// Increase strength.
|
||||
int iStr = FloatToInt(iCharLevel / COTW_INCREASE_STR);
|
||||
eWolf = EffectLinkEffects (EffectAbilityIncrease(ABILITY_STRENGTH, iStr), eWolf);
|
||||
COTWDebug("Wolf: Increase constitution by: "+IntToString(iStr));
|
||||
}
|
||||
if (COTW_INCREASE_LISTEN_SPOT > 0.0)
|
||||
{
|
||||
// Increase Spot and Listen skills
|
||||
int iSkill = FloatToInt(iCharLevel / COTW_INCREASE_LISTEN_SPOT);
|
||||
eWolf = EffectLinkEffects (EffectSkillIncrease(SKILL_LISTEN, iSkill), eWolf);
|
||||
eWolf = EffectLinkEffects (EffectSkillIncrease(SKILL_SPOT, iSkill), eWolf);
|
||||
COTWDebug("Wolf: Increased listen/spot by: "+IntToString(iSkill));
|
||||
}
|
||||
if (!bInstant)
|
||||
{
|
||||
FloatingTextStringOnCreature("You feel as if your bones are shifting under your skin.", OBJECT_SELF, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR), OBJECT_SELF, 7.0);
|
||||
DelayCommand(3.0f, PlaySound ("as_an_wolveshwl1"));
|
||||
DelayCommand(6.0f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_POLYMORPH), OBJECT_SELF, 9.0));
|
||||
DelayCommand(6.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(eWolf), OBJECT_SELF));
|
||||
} else {
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(eWolf), OBJECT_SELF);
|
||||
}
|
||||
SetLocalInt(OBJECT_SELF, COTW_STATE_MACHINE, COTW_STATE_WOLF);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWStartWolf (object oPC, object oActivatedItem)
|
||||
{
|
||||
// Turn them into a wolf.
|
||||
FloatingTextStringOnCreature(GetName(oPC)+" starts to change shape.", oPC);
|
||||
AssignCommand(oPC, COTWCreateWolfEffect());
|
||||
// Destroy the activating item.
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Check where the player's last item went.
|
||||
oActivatedItem = GetLocalObject(oPC, COTW_CACHED_ITEM);
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Check that the player doesn't have additional items through a bug.
|
||||
oActivatedItem = GetItemPossessedBy(oPC, COTW_ITEM_START_WOLF);
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Create a new item.
|
||||
oActivatedItem = CreateItemOnObject(COTW_ITEM_STOP_RESREF, oPC);
|
||||
// Cache the item to prevent duplication.
|
||||
SetLocalObject(oPC, COTW_CACHED_ITEM, oActivatedItem);
|
||||
FloatingTextStringOnCreature("OOC: Drop the 'Stop Werewolf Form' item to regain your true shape.", oPC, FALSE);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWStopWolf (object oTarget, object oActivatedItem)
|
||||
{
|
||||
// Remove the wolf effects.
|
||||
FloatingTextStringOnCreature(GetName(oTarget)+" starts to return to normal.", oTarget);
|
||||
AssignCommand(oTarget, COTWRemoveWolfEffect());
|
||||
// Destroy the activating item.
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Check where the player's last item went.
|
||||
oActivatedItem = GetLocalObject(oTarget, COTW_CACHED_ITEM);
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Check that the player doesn't have additional items through a bug.
|
||||
oActivatedItem = GetItemPossessedBy(oTarget, COTW_ITEM_STOP_WOLF);
|
||||
if (GetIsObjectValid(oActivatedItem)) { SetPlotFlag(oActivatedItem, FALSE); DestroyObject(oActivatedItem); }
|
||||
// Create a new item.
|
||||
oActivatedItem = CreateItemOnObject(COTW_ITEM_START_RESREF, oTarget);
|
||||
// Cache the item to prevent duplication.
|
||||
SetLocalObject(oTarget, COTW_CACHED_ITEM, oActivatedItem);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWTimer ()
|
||||
{
|
||||
if (GetLocalInt(OBJECT_SELF, COTW_STATE_MACHINE) != COTW_STATE_WOLF)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Reassign the timer as the first action so that the timer isn't lost in
|
||||
// a lag situation.
|
||||
AssignCommand(OBJECT_SELF, DelayCommand(COTW_TIMER, COTWTimer()));
|
||||
if (COTW_USE_BLOODLUST && GetIsInCombat())
|
||||
{
|
||||
// The creature is in combat, check if they go into bloodlust.
|
||||
if (Random(10) == 9)
|
||||
{
|
||||
FloatingTextStringOnCreature("The smell of blood is too much...", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectConfused(), OBJECT_SELF, d6()*6.0);
|
||||
}
|
||||
}
|
||||
else if (COTW_USE_BAD_EFFECTS)
|
||||
{
|
||||
switch (Random(36)+1)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
FloatingTextStringOnCreature("You feel hungry.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d4()), OBJECT_SELF);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
FloatingTextStringOnCreature("Your increased hearing overwhelms your ears.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDeaf(), OBJECT_SELF, d4()*6.0);
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
FloatingTextStringOnCreature("Your sight swims with visions of bloody meat.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), OBJECT_SELF, d2()*6.0);
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
FloatingTextStringOnCreature("The need to kill is rising.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMissChance(3*d20()), OBJECT_SELF, d6()*6.0);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
FloatingTextStringOnCreature(GetName(GetNearestObject())+" looks tasty.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d8()), OBJECT_SELF);
|
||||
break;
|
||||
case 14:
|
||||
FloatingTextStringOnCreature("Your increased metabolism needs more food.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSlow(), OBJECT_SELF, d3()*6.0);
|
||||
break;
|
||||
case 15:
|
||||
case 16:
|
||||
FloatingTextStringOnCreature("The hunger is keeping you from doing anything else.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), OBJECT_SELF, d3()*6.0);
|
||||
break;
|
||||
case 17:
|
||||
FloatingTextStringOnCreature("The changes in your body overwhelm you.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), OBJECT_SELF, d2()*6.0);
|
||||
break;
|
||||
case 18:
|
||||
FloatingTextStringOnCreature("You feel the animal within take control.", OBJECT_SELF);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectFrightened(), OBJECT_SELF, d2()*6.0);
|
||||
break;
|
||||
default:
|
||||
// do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWOnActivateItem (object oUser, object oTarget, object oItem)
|
||||
{
|
||||
// OnActivateItem event handler.
|
||||
string sTag = GetTag(oItem);
|
||||
if (sTag == COTW_ITEM_STOP_WOLF)
|
||||
{
|
||||
COTWStopWolf(oTarget, oItem);
|
||||
return TRUE;
|
||||
}
|
||||
if (sTag == COTW_ITEM_START_WOLF)
|
||||
{
|
||||
COTWStartWolf(oTarget, oItem);
|
||||
return TRUE;
|
||||
}
|
||||
if (sTag == COTW_ITEM_DM_WIDGET)
|
||||
{
|
||||
if (!GetIsDM(oUser) && !GetIsDM(GetMaster(oUser)))
|
||||
{
|
||||
FloatingTextStringOnCreature("You cannot use a DM item.", oUser, FALSE);
|
||||
SetPlotFlag(oItem, FALSE);
|
||||
DestroyObject(oItem);
|
||||
return TRUE;
|
||||
}
|
||||
if (GetLocalInt(oTarget, COTW_STATE_MACHINE) == COTW_STATE_WOLF)
|
||||
{
|
||||
AssignCommand(oTarget, COTWRemoveWolfEffect());
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oTarget, COTWCreateWolfEffect());
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWOnUnAcquiredItem (object oPC, object oItem)
|
||||
{
|
||||
// OnUnAcquiredItem event handler.
|
||||
string sTag = GetTag(oItem);
|
||||
// Dropping actives the item. This is because polymorphed
|
||||
// creatures can't use items.
|
||||
if (sTag == COTW_ITEM_STOP_WOLF)
|
||||
{
|
||||
COTWStopWolf(oPC, oItem);
|
||||
return TRUE;
|
||||
}
|
||||
if (sTag == COTW_ITEM_START_WOLF)
|
||||
{
|
||||
COTWStartWolf(oPC, oItem);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
int COTWOnPlayerDeath (object oPC)
|
||||
{
|
||||
// OnPlayerDeath event handler.
|
||||
if (GetLocalInt(oPC, COTW_STATE_MACHINE) == COTW_STATE_WOLF)
|
||||
{
|
||||
object oItem = GetItemPossessedBy(oPC, COTW_ITEM_STOP_WOLF);
|
||||
if (GetIsObjectValid(oItem)) COTWStopWolf(oPC, oItem);
|
||||
else AssignCommand(oPC, COTWRemoveWolfEffect());
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
|
||||
void COTWOnClientEnter (object oPC)
|
||||
{
|
||||
// OnClientEneter event handler.
|
||||
object oItem = GetItemPossessedBy(oPC, COTW_ITEM_STOP_WOLF);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
FloatingTextStringOnCreature("OOC: Reapplying lycanthropy effect.", oPC, FALSE);
|
||||
AssignCommand(oPC, COTWCreateWolfEffect(TRUE));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//void main(){}
|
||||
BIN
_removed/cotw_on_act_dm.uti
Normal file
BIN
_removed/cotw_on_act_dm.uti
Normal file
Binary file not shown.
BIN
_removed/cotw_on_act_star.uti
Normal file
BIN
_removed/cotw_on_act_star.uti
Normal file
Binary file not shown.
BIN
_removed/cotw_on_act_stop.uti
Normal file
BIN
_removed/cotw_on_act_stop.uti
Normal file
Binary file not shown.
12
_removed/cotw_on_activate.nss
Normal file
12
_removed/cotw_on_activate.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
// Curse of the Wolf
|
||||
// by OldManWhistler
|
||||
|
||||
// This script should be used with OnActivateItem systems that use the item
|
||||
// tag as the script to execute.
|
||||
|
||||
//#include "cotw_include"
|
||||
|
||||
void main()
|
||||
{
|
||||
//COTWOnActivateItem (GetItemActivator(), GetItemActivatedTarget(), GetItemActivated());
|
||||
}
|
||||
62
_removed/disciple_of_dark.nss
Normal file
62
_removed/disciple_of_dark.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Truestrike
|
||||
//:: x0_s0_truestrike.nss
|
||||
//:: Copyright (c) 2002 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
+20 attack bonus for 9 seconds.
|
||||
CHANGE: Miss chance still applies, unlike rules.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent Knowles
|
||||
//:: Created On: July 15, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: VFX Pass By:
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oTarget;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||||
|
||||
|
||||
// * determine the damage bonus to apply
|
||||
effect eAttack = EffectAttackIncrease(20);
|
||||
|
||||
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eLink = eAttack;
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
|
||||
|
||||
oTarget = OBJECT_SELF;
|
||||
|
||||
//Fire spell cast at event for target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 415, FALSE));
|
||||
//Apply VFX impact and bonus effects
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 9.0);
|
||||
|
||||
}
|
||||
|
||||
6
_removed/discipleinclude.nss
Normal file
6
_removed/discipleinclude.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
const int FEAT_HELLFIRE_GRASP = 4000;
|
||||
const int FEAT_FIRE_ADEPT = 4001;
|
||||
const int FEAT_FIRE_RESISTANCE_10 = 4002;
|
||||
const int FEAT_FIRE_RESISTANCE_20 = 4007;
|
||||
const int FEAT_IMP_SUMMON_HAMATULA = 4011;
|
||||
const int CLASS_TYPE_DISCIPLE_OF_MEPH = 200;
|
||||
49
_removed/ft_lipsrap.nss
Normal file
49
_removed/ft_lipsrap.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
if (!GetLocalInt(OBJECT_SELF,"FEAT_LIPS_RAPTUR"))
|
||||
return;
|
||||
|
||||
object oTarget=GetSpellTargetObject();
|
||||
if (oTarget==OBJECT_SELF) return;
|
||||
|
||||
SetLocalInt(OBJECT_SELF,"FEAT_LIPS_RAPTUR",GetLocalInt(OBJECT_SELF,"FEAT_LIPS_RAPTUR")-1);
|
||||
SendMessageToPC(OBJECT_SELF," Lips of Rapture : use " +IntToString(GetLocalInt(OBJECT_SELF,"FEAT_LIPS_RAPTUR")));
|
||||
|
||||
|
||||
effect eAtk=EffectAttackIncrease(2);
|
||||
|
||||
effect eDamB=EffectDamageIncrease(DAMAGE_BONUS_2,DAMAGE_TYPE_BLUDGEONING);
|
||||
effect eDamP=EffectDamageIncrease(DAMAGE_BONUS_2,DAMAGE_TYPE_PIERCING);
|
||||
effect eDamS=EffectDamageIncrease(DAMAGE_BONUS_2,DAMAGE_TYPE_SLASHING);
|
||||
effect eSkill=EffectSkillIncrease(SKILL_ALL_SKILLS,2);
|
||||
effect eSave=EffectSavingThrowIncrease(SAVING_THROW_ALL,2);
|
||||
effect eSaveEnch=EffectSavingThrowIncrease(SAVING_THROW_ALL,4,SAVING_THROW_TYPE_MIND_SPELLS);
|
||||
|
||||
effect eLink=EffectLinkEffects(eAtk,eDamB);
|
||||
eLink=EffectLinkEffects(eLink,eDamP);
|
||||
eLink=EffectLinkEffects(eLink,eDamS);
|
||||
eLink=EffectLinkEffects(eLink,eSkill);
|
||||
eLink=EffectLinkEffects(eLink,eSave);
|
||||
eLink=EffectLinkEffects(eLink,eSaveEnch);
|
||||
|
||||
//Make SR check
|
||||
if (!MyPRCResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, (10+GetAbilityModifier(ABILITY_CHARISMA)+ GetChangesToSaveDC(OBJECT_SELF)), SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oTarget, RoundsToSeconds(1));
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DAZED_S), oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(5));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
38
_removed/ft_shockweap.nss
Normal file
38
_removed/ft_shockweap.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "heartward_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
if (GetIsImmune(GetSpellTargetObject(),IMMUNITY_TYPE_CRITICAL_HIT)) return;
|
||||
|
||||
object oWeap=GetSpellCastItem();
|
||||
|
||||
if (GetBaseItemType(oWeap)!=BASE_ITEM_SHORTSPEAR ) return;
|
||||
|
||||
|
||||
int nThreat = 20;
|
||||
|
||||
if (GetItemHasItemProperty(oWeap, ITEM_PROPERTY_KEEN) == TRUE)
|
||||
{
|
||||
nThreat = nThreat - 1;
|
||||
}
|
||||
|
||||
if (GetHasFeat(FEAT_IMPROVED_CRITICAL_SPEAR) == TRUE)
|
||||
{
|
||||
nThreat = nThreat - 1;
|
||||
}
|
||||
|
||||
int dice=d20();
|
||||
|
||||
|
||||
|
||||
if (dice>=nThreat)
|
||||
{
|
||||
FloatingTextStringOnCreature("Critical Hit", OBJECT_SELF);
|
||||
|
||||
if (GetHasFeat( FEAT_SHOCKING_WEAPON,OBJECT_SELF))
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(d10(2),DAMAGE_TYPE_ELECTRICAL,DAMAGE_POWER_NORMAL),GetSpellTargetObject());
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(d8(2),DAMAGE_TYPE_SONIC,DAMAGE_POWER_NORMAL),GetSpellTargetObject());
|
||||
|
||||
}
|
||||
}
|
||||
19
_removed/ft_tears_ever.nss
Normal file
19
_removed/ft_tears_ever.nss
Normal file
@@ -0,0 +1,19 @@
|
||||
void main()
|
||||
{
|
||||
|
||||
int nHD = GetHitDice(OBJECT_SELF);
|
||||
int nMinXPForLevel = ((nHD * (nHD - 1)) / 2) * 1000;
|
||||
int nNewXP =GetXP(OBJECT_SELF)-6;
|
||||
|
||||
if (nMinXPForLevel > nNewXP || nNewXP == 0 )
|
||||
{
|
||||
FloatingTextStrRefOnCreature(3785, OBJECT_SELF); // Item Creation Failed - Not enough XP
|
||||
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
CreateItemOnObject("x1_wmgrenade005", OBJECT_SELF, 1);
|
||||
SetXP(OBJECT_SELF,nNewXP);
|
||||
}
|
||||
21
_removed/hellblast.nss
Normal file
21
_removed/hellblast.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//Hellfire Blast by Sir Attilla
|
||||
|
||||
//Fixed some run-time errors that caused spell to do nothing
|
||||
//Aaon Graywolf - Jan 9, 2004
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
int nDamage = d6(4);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
//Main Spell Body
|
||||
int iHit = TouchAttackMelee(oTarget);
|
||||
if (iHit > 0)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
|
||||
}
|
||||
97
_removed/hellfire.nss
Normal file
97
_removed/hellfire.nss
Normal file
@@ -0,0 +1,97 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: HellFire
|
||||
//::
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: Oct 18 , 2000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
|
||||
//:: Last Updated By: AidanScanlan, On: April 11, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: May 25, 2001
|
||||
//:: Last Modified By: Sir Attilla
|
||||
|
||||
//Fixed a missing VFX constant bug.
|
||||
//Aaon Graywolf - Jan 8, 2004
|
||||
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLvl = 15;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eExplode = EffectVisualEffect(513);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
//Get the spell target location as opposed to the spell target.
|
||||
location lTarget = GetSpellTargetLocation();
|
||||
//Limit Caster level for the purposes of damage
|
||||
if (nCasterLvl > 10)
|
||||
{
|
||||
nCasterLvl = 10;
|
||||
}
|
||||
//Apply the fireball explosion at the location captured above.
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
||||
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
|
||||
{
|
||||
//Roll damage for each target
|
||||
nDamage = d6(3);
|
||||
//Resolve metamagic
|
||||
if (nMetaMagic == METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDamage = 6 * nCasterLvl;
|
||||
}
|
||||
else if (nMetaMagic == METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDamage = nDamage + nDamage / 2;
|
||||
}
|
||||
//Set the damage effect
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
//This visual effect is applied to the target object not the location as above. This visual effect
|
||||
//represents the flame that erupts on the target not on the ground.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
}
|
||||
|
||||
100
_removed/hellfire_storm.nss
Normal file
100
_removed/hellfire_storm.nss
Normal file
@@ -0,0 +1,100 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: HellFire
|
||||
//::
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Noel Borstad
|
||||
//:: Created On: Oct 18 , 2000
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001
|
||||
//:: Last Updated By: AidanScanlan, On: April 11, 2001
|
||||
//:: Last Updated By: Preston Watamaniuk, On: May 25, 2001
|
||||
//:: Last Modified By: Sir Attilla
|
||||
|
||||
//Fixed a missing VFX constant bug.
|
||||
//Aaon Graywolf - Jan 8, 2004
|
||||
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
object oCaster = OBJECT_SELF;
|
||||
int nCasterLvl = 15;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
int nDamage;
|
||||
float fDelay;
|
||||
effect eExplode = EffectVisualEffect(514);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
effect eDam;
|
||||
//Get the spell target location as opposed to the spell target.
|
||||
location lTarget = GetSpellTargetLocation();
|
||||
//Limit Caster level for the purposes of damage
|
||||
if (nCasterLvl > 10)
|
||||
{
|
||||
nCasterLvl = 10;
|
||||
}
|
||||
//Apply the fireball explosion at the location captured above.
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget);
|
||||
//Declare the spell shape, size and the location. Capture the first target object in the shape.
|
||||
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||||
while (GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
|
||||
{
|
||||
//if((GetSpellId() == 341) || GetSpellId() == 58)
|
||||
//{
|
||||
//Get the distance between the explosion and the target to calculate delay
|
||||
fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
||||
if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
|
||||
{
|
||||
//Roll damage for each target
|
||||
nDamage = d6(5);
|
||||
//Resolve metamagic
|
||||
if (nMetaMagic == METAMAGIC_MAXIMIZE)
|
||||
{
|
||||
nDamage = 6 * nCasterLvl;
|
||||
}
|
||||
else if (nMetaMagic == METAMAGIC_EMPOWER)
|
||||
{
|
||||
nDamage = nDamage + nDamage / 2;
|
||||
}
|
||||
//Set the damage effect
|
||||
eDam = EffectDamage(nDamage, DAMAGE_TYPE_DIVINE);
|
||||
if(nDamage > 0)
|
||||
{
|
||||
// Apply effects to the currently selected target.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
||||
//This visual effect is applied to the target object not the location as above. This visual effect
|
||||
//represents the flame that erupts on the target not on the ground.
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
//Select the next target within the spell shape.
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
||||
}
|
||||
}
|
||||
|
||||
69
_removed/hellfireshield.nss
Normal file
69
_removed/hellfireshield.nss
Normal file
@@ -0,0 +1,69 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Fire Shield
|
||||
//:: NW_S0_FireShld.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Fire Shield for the Disciple of Mephistopheles
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Jan 7, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created On: Aug 28, 2003, GZ: Fixed stacking issue
|
||||
#include "x2_inc_spellhook"
|
||||
#include "x0_i0_spells"
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-23 by GeorgZ
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
|
||||
//Declare major variables
|
||||
effect eVis = EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD);
|
||||
int nDuration = 15;
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
object oTarget = OBJECT_SELF;
|
||||
effect eShield = EffectDamageShield(nDuration, DAMAGE_BONUS_1d6, DAMAGE_TYPE_FIRE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
effect eCold = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 50);
|
||||
effect eFire = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50);
|
||||
|
||||
//Link effects
|
||||
effect eLink = EffectLinkEffects(eShield, eCold);
|
||||
eLink = EffectLinkEffects(eLink, eFire);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eVis);
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ELEMENTAL_SHIELD, FALSE));
|
||||
|
||||
// *GZ: No longer stack this spell
|
||||
if (GetHasSpellEffect(GetSpellId(),oTarget))
|
||||
{
|
||||
RemoveSpellEffects(GetSpellId(), OBJECT_SELF, oTarget);
|
||||
}
|
||||
|
||||
//Enter Metamagic conditions
|
||||
if (nMetaMagic == METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration *2; //Duration is +100%
|
||||
}
|
||||
//Apply the VFX impact and effects
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
||||
}
|
||||
|
||||
70
_removed/hellflare.nss
Normal file
70
_removed/hellflare.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Flare
|
||||
//:: [X0_S0_Flare.nss]
|
||||
//:: Copyright (c) 2002 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creature hit by ray loses 1 to attack rolls.
|
||||
|
||||
DURATION: 10 rounds.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: July 17 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Sir Attilla
|
||||
//:: Modified On: January 3 2004
|
||||
//:://///////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-06-20 by Georg
|
||||
If you want to make changes to all spells,
|
||||
check x2_inc_spellhook.nss to find out more
|
||||
|
||||
*/
|
||||
|
||||
if (!X2PreSpellCastCode())
|
||||
{
|
||||
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
||||
return;
|
||||
}
|
||||
|
||||
// End of Spell Cast Hook
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
int nCasterLevel = 15;
|
||||
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
|
||||
if(!GetIsReactionTypeFriendly(oTarget))
|
||||
{
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 416));
|
||||
|
||||
// * Apply the hit effect so player knows something happened
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
|
||||
|
||||
//Make SR Check
|
||||
if ((!MyResistSpell(OBJECT_SELF, oTarget)) && (MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC()) == FALSE) )
|
||||
{
|
||||
//Set damage effect
|
||||
effect eBad = EffectAttackDecrease(1);
|
||||
//Apply the VFX impact and damage effect
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
20
_removed/hellgrasp.nss
Normal file
20
_removed/hellgrasp.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Hellfire Grasp by Sir Attilla
|
||||
|
||||
//Fixed some run-time errors that caused spell to do nothing
|
||||
//Aaon Graywolf - Jan 9, 2004
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
int nDamage = d6(1);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
|
||||
//Main Spell Body
|
||||
int iHit = TouchAttackMelee(oTarget);
|
||||
if (iHit > 0)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
|
||||
}
|
||||
612
_removed/inc_combat.nss
Normal file
612
_removed/inc_combat.nss
Normal file
@@ -0,0 +1,612 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Item Property Function]
|
||||
//:: [inc_item_props.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: This file defines several functions used to
|
||||
//:: simulate melee combat through scripting.
|
||||
//:: This is useful for creating spells or feats
|
||||
//:: which work in combat, such as the Smite Feats.
|
||||
//:: The only problem at the moment is that the functions
|
||||
//:: cannot determine bonuses derieved from Magical
|
||||
//:: effects on creatures. Other than that, these
|
||||
//:: will behave exactly like normal combat.
|
||||
//::
|
||||
//:: Example: Creating a Smite Neutral feat
|
||||
//:: In the spell script attached to the feat, check
|
||||
//:: the alignment of the target, and run DoMeleeAttack
|
||||
//:: entering the appropriate Smite bonus into iMod
|
||||
//:: On a hit, call GetMeleeWeaponDamage and add the
|
||||
//:: bonus damage from the feat.
|
||||
//::
|
||||
//:: Finally, simulate the rest of the combat round
|
||||
//:: by calling DoMeleeAttack/GetMeleeWeaponDamage
|
||||
//:: once for each remaining attack that the player
|
||||
//:: should get. Adding a -5 to iMod for each consecutive
|
||||
//:: attack.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 19, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update: Jan 4 2002
|
||||
//:: - Extended Composite bonus function to handle pretty much
|
||||
//:: every property that can possibly be composited.
|
||||
|
||||
// * Returns an integer amount of damage from a constant
|
||||
// * iDamageConst = DAMAGE_BONUS_* or IP_CONST_DAMAGEBONUS_*
|
||||
int GetDamageByConstant(int iDamageConst, int iItemProp);
|
||||
|
||||
// * Returns the appropriate weapon feat given a weapon type
|
||||
// * iType = BASE_ITEM_*
|
||||
// * sFeat = "Focus", "Specialization", EpicFocus", "EpicSpecialization", "ImprovedCrit"
|
||||
int GetFeatByWeaponType(int iType, string sFeat);
|
||||
|
||||
// * Returns the low end of oWeap's critical threat range
|
||||
// * Accounts for Keen and Improved Critical bonuses
|
||||
int GetMeleeWeaponCriticalRange(object oPC, object oWeap);
|
||||
|
||||
// * Performs a melee attack roll by oPC against oTarget.
|
||||
// * Begins with BAB; to simulate multiple attacks in one round,
|
||||
// * use iMod to add a -5 modifier for each consecutive attack.
|
||||
// * If bShowFeedback is TRUE, display the attack roll in oPC's
|
||||
// * message window after a delay of fDelay seconds.
|
||||
// * Caveat: Cannot account for ATTACK_BONUS effects on oPC
|
||||
int DoMeleeAttack(object oPC, object oWeap, object oTarget, int iMod = 0, int bShowFeedback = TRUE, float fDelay = 0.0);
|
||||
|
||||
// * Returns an integer amount of damage done by oPC with oWeap
|
||||
// * Caveat: Cannot account for DAMAGE_BONUS effects on oPC
|
||||
int GetMeleeWeaponDamage(object oPC, object oWeap, int bCrit = FALSE,int iDamage = 0);
|
||||
|
||||
// * Returns the Enhancement Bonus of oWeap as DAMAGE_POWER_*
|
||||
int GetWeaponEnhancement(object oWeap);
|
||||
|
||||
// * Oddly enough, Damage Types by weapon don't seem to appear in baseitems.2da
|
||||
// * This funciton runs a switch that returns the appropriate damage type.
|
||||
int GetWeaponDamageType(object oWeap);
|
||||
|
||||
int GetDamageByConstant(int iDamageConst, int iItemProp)
|
||||
{
|
||||
if(iItemProp)
|
||||
{
|
||||
switch(iDamageConst)
|
||||
{
|
||||
case IP_CONST_DAMAGEBONUS_1:
|
||||
return 1;
|
||||
case IP_CONST_DAMAGEBONUS_2:
|
||||
return 2;
|
||||
case IP_CONST_DAMAGEBONUS_3:
|
||||
return 3;
|
||||
case IP_CONST_DAMAGEBONUS_4:
|
||||
return 4;
|
||||
case IP_CONST_DAMAGEBONUS_5:
|
||||
return 5;
|
||||
case IP_CONST_DAMAGEBONUS_6:
|
||||
return 6;
|
||||
case IP_CONST_DAMAGEBONUS_7:
|
||||
return 7;
|
||||
case IP_CONST_DAMAGEBONUS_8:
|
||||
return 8;
|
||||
case IP_CONST_DAMAGEBONUS_9:
|
||||
return 9;
|
||||
case IP_CONST_DAMAGEBONUS_10:
|
||||
return 10;
|
||||
case IP_CONST_DAMAGEBONUS_1d4:
|
||||
return d4(1);
|
||||
case IP_CONST_DAMAGEBONUS_1d6:
|
||||
return d6(1);
|
||||
case IP_CONST_DAMAGEBONUS_1d8:
|
||||
return d8(1);
|
||||
case IP_CONST_DAMAGEBONUS_1d10:
|
||||
return d10(1);
|
||||
case IP_CONST_DAMAGEBONUS_1d12:
|
||||
return d12(1);
|
||||
case IP_CONST_DAMAGEBONUS_2d4:
|
||||
return d4(2);
|
||||
case IP_CONST_DAMAGEBONUS_2d6:
|
||||
return d6(2);
|
||||
case IP_CONST_DAMAGEBONUS_2d8:
|
||||
return d8(2);
|
||||
case IP_CONST_DAMAGEBONUS_2d10:
|
||||
return d10(2);
|
||||
case IP_CONST_DAMAGEBONUS_2d12:
|
||||
return d12(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(iDamageConst)
|
||||
{
|
||||
case DAMAGE_BONUS_1:
|
||||
return 1;
|
||||
case DAMAGE_BONUS_2:
|
||||
return 2;
|
||||
case DAMAGE_BONUS_3:
|
||||
return 3;
|
||||
case DAMAGE_BONUS_4:
|
||||
return 4;
|
||||
case DAMAGE_BONUS_5:
|
||||
return 5;
|
||||
case DAMAGE_BONUS_6:
|
||||
return 6;
|
||||
case DAMAGE_BONUS_7:
|
||||
return 7;
|
||||
case DAMAGE_BONUS_8:
|
||||
return 8;
|
||||
case DAMAGE_BONUS_9:
|
||||
return 9;
|
||||
case DAMAGE_BONUS_10:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_11:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_12:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_13:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_14:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_15:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_16:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_17:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_18:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_19:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_20:
|
||||
return 10;
|
||||
case DAMAGE_BONUS_1d4:
|
||||
return d4(1);
|
||||
case DAMAGE_BONUS_1d6:
|
||||
return d6(1);
|
||||
case DAMAGE_BONUS_1d8:
|
||||
return d8(1);
|
||||
case DAMAGE_BONUS_1d10:
|
||||
return d10(1);
|
||||
case DAMAGE_BONUS_1d12:
|
||||
return d12(1);
|
||||
case DAMAGE_BONUS_2d4:
|
||||
return d4(2);
|
||||
case DAMAGE_BONUS_2d6:
|
||||
return d6(2);
|
||||
case DAMAGE_BONUS_2d8:
|
||||
return d8(2);
|
||||
case DAMAGE_BONUS_2d10:
|
||||
return d10(2);
|
||||
case DAMAGE_BONUS_2d12:
|
||||
return d12(2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetFeatByWeaponType(int iType, string sFeat)
|
||||
{
|
||||
if(sFeat == "Focus")
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD: return FEAT_WEAPON_FOCUS_BASTARD_SWORD;
|
||||
case BASE_ITEM_BATTLEAXE: return FEAT_WEAPON_FOCUS_BATTLE_AXE;
|
||||
case BASE_ITEM_CLUB: return FEAT_WEAPON_FOCUS_CLUB;
|
||||
case BASE_ITEM_DAGGER: return FEAT_WEAPON_FOCUS_DAGGER;
|
||||
case BASE_ITEM_DART: return FEAT_WEAPON_FOCUS_DART;
|
||||
case BASE_ITEM_DIREMACE: return FEAT_WEAPON_FOCUS_DIRE_MACE;
|
||||
case BASE_ITEM_DOUBLEAXE: return FEAT_WEAPON_FOCUS_DOUBLE_AXE;
|
||||
case BASE_ITEM_DWARVENWARAXE: return FEAT_WEAPON_FOCUS_DWAXE;
|
||||
case BASE_ITEM_GREATAXE: return FEAT_WEAPON_FOCUS_GREAT_AXE;
|
||||
case BASE_ITEM_GREATSWORD: return FEAT_WEAPON_FOCUS_GREAT_SWORD;
|
||||
case BASE_ITEM_HALBERD: return FEAT_WEAPON_FOCUS_HALBERD;
|
||||
case BASE_ITEM_HANDAXE: return FEAT_WEAPON_FOCUS_HAND_AXE;
|
||||
case BASE_ITEM_HEAVYCROSSBOW: return FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW;
|
||||
case BASE_ITEM_HEAVYFLAIL: return FEAT_WEAPON_FOCUS_HEAVY_FLAIL;
|
||||
case BASE_ITEM_KAMA: return FEAT_WEAPON_FOCUS_KAMA;
|
||||
case BASE_ITEM_KATANA: return FEAT_WEAPON_FOCUS_KATANA;
|
||||
case BASE_ITEM_KUKRI: return FEAT_WEAPON_FOCUS_KUKRI;
|
||||
case BASE_ITEM_LIGHTCROSSBOW: return FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW;
|
||||
case BASE_ITEM_LIGHTFLAIL: return FEAT_WEAPON_FOCUS_LIGHT_FLAIL;
|
||||
case BASE_ITEM_LIGHTHAMMER: return FEAT_WEAPON_FOCUS_LIGHT_HAMMER;
|
||||
case BASE_ITEM_LIGHTMACE: return FEAT_WEAPON_FOCUS_LIGHT_MACE;
|
||||
case BASE_ITEM_LONGBOW: return FEAT_WEAPON_FOCUS_LONG_SWORD;
|
||||
case BASE_ITEM_LONGSWORD: return FEAT_WEAPON_FOCUS_LONGBOW;
|
||||
case BASE_ITEM_MORNINGSTAR: return FEAT_WEAPON_FOCUS_MORNING_STAR;
|
||||
case BASE_ITEM_QUARTERSTAFF: return FEAT_WEAPON_FOCUS_STAFF;
|
||||
case BASE_ITEM_RAPIER: return FEAT_WEAPON_FOCUS_RAPIER;
|
||||
case BASE_ITEM_SCIMITAR: return FEAT_WEAPON_FOCUS_SCIMITAR;
|
||||
case BASE_ITEM_SCYTHE: return FEAT_WEAPON_FOCUS_SCYTHE;
|
||||
case BASE_ITEM_SHORTBOW: return FEAT_WEAPON_FOCUS_SHORTBOW;
|
||||
case BASE_ITEM_SHORTSPEAR: return FEAT_WEAPON_FOCUS_SPEAR;
|
||||
case BASE_ITEM_SHORTSWORD: return FEAT_WEAPON_FOCUS_SHORT_SWORD;
|
||||
case BASE_ITEM_SHURIKEN: return FEAT_WEAPON_FOCUS_SHURIKEN;
|
||||
case BASE_ITEM_SICKLE: return FEAT_WEAPON_FOCUS_SICKLE;
|
||||
case BASE_ITEM_SLING: return FEAT_WEAPON_FOCUS_SLING;
|
||||
case BASE_ITEM_THROWINGAXE: return FEAT_WEAPON_FOCUS_THROWING_AXE;
|
||||
case BASE_ITEM_TWOBLADEDSWORD: return FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD;
|
||||
case BASE_ITEM_WARHAMMER: return FEAT_WEAPON_FOCUS_WAR_HAMMER;
|
||||
case BASE_ITEM_WHIP: return -1; //No constant (?)
|
||||
}
|
||||
|
||||
else if(sFeat == "Specialization")
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD: return FEAT_WEAPON_SPECIALIZATION_BASTARD_SWORD;
|
||||
case BASE_ITEM_BATTLEAXE: return FEAT_WEAPON_SPECIALIZATION_BATTLE_AXE;
|
||||
case BASE_ITEM_CLUB: return FEAT_WEAPON_SPECIALIZATION_CLUB;
|
||||
case BASE_ITEM_DAGGER: return FEAT_WEAPON_SPECIALIZATION_DAGGER;
|
||||
case BASE_ITEM_DART: return FEAT_WEAPON_SPECIALIZATION_DART;
|
||||
case BASE_ITEM_DIREMACE: return FEAT_WEAPON_SPECIALIZATION_DIRE_MACE;
|
||||
case BASE_ITEM_DOUBLEAXE: return FEAT_WEAPON_SPECIALIZATION_DOUBLE_AXE;
|
||||
case BASE_ITEM_DWARVENWARAXE: return FEAT_WEAPON_SPECIALIZATION_DWAXE ;
|
||||
case BASE_ITEM_GREATAXE: return FEAT_WEAPON_SPECIALIZATION_GREAT_AXE;
|
||||
case BASE_ITEM_GREATSWORD: return FEAT_WEAPON_SPECIALIZATION_GREAT_SWORD;
|
||||
case BASE_ITEM_HALBERD: return FEAT_WEAPON_SPECIALIZATION_HALBERD;
|
||||
case BASE_ITEM_HANDAXE: return FEAT_WEAPON_SPECIALIZATION_HAND_AXE;
|
||||
case BASE_ITEM_HEAVYCROSSBOW: return FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW;
|
||||
case BASE_ITEM_HEAVYFLAIL: return FEAT_WEAPON_SPECIALIZATION_HEAVY_FLAIL;
|
||||
case BASE_ITEM_KAMA: return FEAT_WEAPON_SPECIALIZATION_KAMA;
|
||||
case BASE_ITEM_KATANA: return FEAT_WEAPON_SPECIALIZATION_KATANA;
|
||||
case BASE_ITEM_KUKRI: return FEAT_WEAPON_SPECIALIZATION_KUKRI;
|
||||
case BASE_ITEM_LIGHTCROSSBOW: return FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW;
|
||||
case BASE_ITEM_LIGHTFLAIL: return FEAT_WEAPON_SPECIALIZATION_LIGHT_FLAIL;
|
||||
case BASE_ITEM_LIGHTHAMMER: return FEAT_WEAPON_SPECIALIZATION_LIGHT_HAMMER;
|
||||
case BASE_ITEM_LIGHTMACE: return FEAT_WEAPON_SPECIALIZATION_LIGHT_MACE;
|
||||
case BASE_ITEM_LONGBOW: return FEAT_WEAPON_SPECIALIZATION_LONG_SWORD;
|
||||
case BASE_ITEM_LONGSWORD: return FEAT_WEAPON_SPECIALIZATION_LONGBOW;
|
||||
case BASE_ITEM_MORNINGSTAR: return FEAT_WEAPON_SPECIALIZATION_MORNING_STAR;
|
||||
case BASE_ITEM_QUARTERSTAFF: return FEAT_WEAPON_SPECIALIZATION_STAFF;
|
||||
case BASE_ITEM_RAPIER: return FEAT_WEAPON_SPECIALIZATION_RAPIER;
|
||||
case BASE_ITEM_SCIMITAR: return FEAT_WEAPON_SPECIALIZATION_SCIMITAR;
|
||||
case BASE_ITEM_SCYTHE: return FEAT_WEAPON_SPECIALIZATION_SCYTHE;
|
||||
case BASE_ITEM_SHORTBOW: return FEAT_WEAPON_SPECIALIZATION_SHORTBOW;
|
||||
case BASE_ITEM_SHORTSPEAR: return FEAT_WEAPON_SPECIALIZATION_SPEAR;
|
||||
case BASE_ITEM_SHORTSWORD: return FEAT_WEAPON_SPECIALIZATION_SHORT_SWORD;
|
||||
case BASE_ITEM_SHURIKEN: return FEAT_WEAPON_SPECIALIZATION_SHURIKEN;
|
||||
case BASE_ITEM_SICKLE: return FEAT_WEAPON_SPECIALIZATION_SICKLE;
|
||||
case BASE_ITEM_SLING: return FEAT_WEAPON_SPECIALIZATION_SLING;
|
||||
case BASE_ITEM_THROWINGAXE: return FEAT_WEAPON_SPECIALIZATION_THROWING_AXE;
|
||||
case BASE_ITEM_TWOBLADEDSWORD: return FEAT_WEAPON_SPECIALIZATION_TWO_BLADED_SWORD;
|
||||
case BASE_ITEM_WARHAMMER: return FEAT_WEAPON_SPECIALIZATION_WAR_HAMMER;
|
||||
}
|
||||
|
||||
else if(sFeat == "EpicFocus")
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD: return FEAT_EPIC_WEAPON_FOCUS_BASTARDSWORD;
|
||||
case BASE_ITEM_BATTLEAXE: return FEAT_EPIC_WEAPON_FOCUS_BATTLEAXE;
|
||||
case BASE_ITEM_CLUB: return FEAT_EPIC_WEAPON_FOCUS_CLUB;
|
||||
case BASE_ITEM_DAGGER: return FEAT_EPIC_WEAPON_FOCUS_DAGGER;
|
||||
case BASE_ITEM_DART: return FEAT_EPIC_WEAPON_FOCUS_DART;
|
||||
case BASE_ITEM_DIREMACE: return FEAT_EPIC_WEAPON_FOCUS_DIREMACE;
|
||||
case BASE_ITEM_DOUBLEAXE: return FEAT_EPIC_WEAPON_FOCUS_DOUBLEAXE;
|
||||
case BASE_ITEM_DWARVENWARAXE: return FEAT_EPIC_WEAPON_FOCUS_DWAXE;
|
||||
case BASE_ITEM_GREATAXE: return FEAT_EPIC_WEAPON_FOCUS_GREATAXE;
|
||||
case BASE_ITEM_GREATSWORD: return FEAT_EPIC_WEAPON_FOCUS_GREATSWORD;
|
||||
case BASE_ITEM_HALBERD: return FEAT_EPIC_WEAPON_FOCUS_HALBERD;
|
||||
case BASE_ITEM_HANDAXE: return FEAT_EPIC_WEAPON_FOCUS_HANDAXE;
|
||||
case BASE_ITEM_HEAVYCROSSBOW: return FEAT_EPIC_WEAPON_FOCUS_HEAVYCROSSBOW;
|
||||
case BASE_ITEM_HEAVYFLAIL: return FEAT_EPIC_WEAPON_FOCUS_HEAVYFLAIL;
|
||||
case BASE_ITEM_KAMA: return FEAT_EPIC_WEAPON_FOCUS_KAMA;
|
||||
case BASE_ITEM_KATANA: return FEAT_EPIC_WEAPON_FOCUS_KATANA;
|
||||
case BASE_ITEM_KUKRI: return FEAT_EPIC_WEAPON_FOCUS_KUKRI;
|
||||
case BASE_ITEM_LIGHTCROSSBOW: return FEAT_EPIC_WEAPON_FOCUS_LIGHTCROSSBOW;
|
||||
case BASE_ITEM_LIGHTFLAIL: return FEAT_EPIC_WEAPON_FOCUS_LIGHTFLAIL;
|
||||
case BASE_ITEM_LIGHTHAMMER: return FEAT_EPIC_WEAPON_FOCUS_LIGHTHAMMER;
|
||||
case BASE_ITEM_LIGHTMACE: return FEAT_EPIC_WEAPON_FOCUS_LIGHTMACE;
|
||||
case BASE_ITEM_LONGBOW: return FEAT_EPIC_WEAPON_FOCUS_LONGSWORD;
|
||||
case BASE_ITEM_LONGSWORD: return FEAT_EPIC_WEAPON_FOCUS_LONGBOW;
|
||||
case BASE_ITEM_MORNINGSTAR: return FEAT_EPIC_WEAPON_FOCUS_MORNINGSTAR;
|
||||
case BASE_ITEM_QUARTERSTAFF: return FEAT_EPIC_WEAPON_FOCUS_QUARTERSTAFF;
|
||||
case BASE_ITEM_RAPIER: return FEAT_EPIC_WEAPON_FOCUS_RAPIER;
|
||||
case BASE_ITEM_SCIMITAR: return FEAT_EPIC_WEAPON_FOCUS_SCIMITAR;
|
||||
case BASE_ITEM_SCYTHE: return FEAT_EPIC_WEAPON_FOCUS_SCYTHE;
|
||||
case BASE_ITEM_SHORTBOW: return FEAT_EPIC_WEAPON_FOCUS_SHORTBOW;
|
||||
case BASE_ITEM_SHORTSPEAR: return FEAT_EPIC_WEAPON_FOCUS_SHORTSPEAR;
|
||||
case BASE_ITEM_SHORTSWORD: return FEAT_EPIC_WEAPON_FOCUS_SHORTSWORD;
|
||||
case BASE_ITEM_SHURIKEN: return FEAT_EPIC_WEAPON_FOCUS_SHURIKEN;
|
||||
case BASE_ITEM_SICKLE: return FEAT_EPIC_WEAPON_FOCUS_SICKLE;
|
||||
case BASE_ITEM_SLING: return FEAT_EPIC_WEAPON_FOCUS_SLING;
|
||||
case BASE_ITEM_THROWINGAXE: return FEAT_EPIC_WEAPON_FOCUS_THROWINGAXE;
|
||||
case BASE_ITEM_TWOBLADEDSWORD: return FEAT_EPIC_WEAPON_FOCUS_TWOBLADEDSWORD;
|
||||
case BASE_ITEM_WARHAMMER: return FEAT_EPIC_WEAPON_FOCUS_WARHAMMER;
|
||||
case BASE_ITEM_WHIP: return -1; //No constant (?)
|
||||
}
|
||||
|
||||
else if(sFeat == "EpicSpecialization")
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD: return FEAT_EPIC_WEAPON_SPECIALIZATION_BASTARDSWORD;
|
||||
case BASE_ITEM_BATTLEAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_BATTLEAXE;
|
||||
case BASE_ITEM_CLUB: return FEAT_EPIC_WEAPON_SPECIALIZATION_CLUB;
|
||||
case BASE_ITEM_DAGGER: return FEAT_EPIC_WEAPON_SPECIALIZATION_DAGGER;
|
||||
case BASE_ITEM_DART: return FEAT_EPIC_WEAPON_SPECIALIZATION_DART;
|
||||
case BASE_ITEM_DIREMACE: return FEAT_EPIC_WEAPON_SPECIALIZATION_DIREMACE;
|
||||
case BASE_ITEM_DOUBLEAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_DOUBLEAXE;
|
||||
case BASE_ITEM_DWARVENWARAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_DWAXE;
|
||||
case BASE_ITEM_GREATAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_GREATAXE;
|
||||
case BASE_ITEM_GREATSWORD: return FEAT_EPIC_WEAPON_SPECIALIZATION_GREATSWORD;
|
||||
case BASE_ITEM_HALBERD: return FEAT_EPIC_WEAPON_SPECIALIZATION_HALBERD;
|
||||
case BASE_ITEM_HANDAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_HANDAXE;
|
||||
case BASE_ITEM_HEAVYCROSSBOW: return FEAT_EPIC_WEAPON_SPECIALIZATION_HEAVYCROSSBOW;
|
||||
case BASE_ITEM_HEAVYFLAIL: return FEAT_EPIC_WEAPON_SPECIALIZATION_HEAVYFLAIL;
|
||||
case BASE_ITEM_KAMA: return FEAT_EPIC_WEAPON_SPECIALIZATION_KAMA;
|
||||
case BASE_ITEM_KATANA: return FEAT_EPIC_WEAPON_SPECIALIZATION_KATANA;
|
||||
case BASE_ITEM_KUKRI: return FEAT_EPIC_WEAPON_SPECIALIZATION_KUKRI;
|
||||
case BASE_ITEM_LIGHTCROSSBOW: return FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTCROSSBOW;
|
||||
case BASE_ITEM_LIGHTFLAIL: return FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTFLAIL;
|
||||
case BASE_ITEM_LIGHTHAMMER: return FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTHAMMER;
|
||||
case BASE_ITEM_LIGHTMACE: return FEAT_EPIC_WEAPON_SPECIALIZATION_LIGHTMACE;
|
||||
case BASE_ITEM_LONGBOW: return FEAT_EPIC_WEAPON_SPECIALIZATION_LONGSWORD;
|
||||
case BASE_ITEM_LONGSWORD: return FEAT_EPIC_WEAPON_SPECIALIZATION_LONGBOW;
|
||||
case BASE_ITEM_MORNINGSTAR: return FEAT_EPIC_WEAPON_SPECIALIZATION_MORNINGSTAR;
|
||||
case BASE_ITEM_QUARTERSTAFF: return FEAT_EPIC_WEAPON_SPECIALIZATION_QUARTERSTAFF;
|
||||
case BASE_ITEM_RAPIER: return FEAT_EPIC_WEAPON_SPECIALIZATION_RAPIER;
|
||||
case BASE_ITEM_SCIMITAR: return FEAT_EPIC_WEAPON_SPECIALIZATION_SCIMITAR;
|
||||
case BASE_ITEM_SCYTHE: return FEAT_EPIC_WEAPON_SPECIALIZATION_SCYTHE;
|
||||
case BASE_ITEM_SHORTBOW: return FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTBOW;
|
||||
case BASE_ITEM_SHORTSPEAR: return FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTSPEAR;
|
||||
case BASE_ITEM_SHORTSWORD: return FEAT_EPIC_WEAPON_SPECIALIZATION_SHORTSWORD;
|
||||
case BASE_ITEM_SHURIKEN: return FEAT_EPIC_WEAPON_SPECIALIZATION_SHURIKEN;
|
||||
case BASE_ITEM_SICKLE: return FEAT_EPIC_WEAPON_SPECIALIZATION_SICKLE;
|
||||
case BASE_ITEM_SLING: return FEAT_EPIC_WEAPON_SPECIALIZATION_SLING;
|
||||
case BASE_ITEM_THROWINGAXE: return FEAT_EPIC_WEAPON_SPECIALIZATION_THROWINGAXE;
|
||||
case BASE_ITEM_TWOBLADEDSWORD: return FEAT_EPIC_WEAPON_SPECIALIZATION_TWOBLADEDSWORD;
|
||||
case BASE_ITEM_WARHAMMER: return FEAT_EPIC_WEAPON_SPECIALIZATION_WARHAMMER;
|
||||
case BASE_ITEM_WHIP: return -1; //No constant (?)
|
||||
}
|
||||
|
||||
else if(sFeat == "ImprovedCrit")
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD: return FEAT_IMPROVED_CRITICAL_BASTARD_SWORD;
|
||||
case BASE_ITEM_BATTLEAXE: return FEAT_IMPROVED_CRITICAL_BATTLE_AXE;
|
||||
case BASE_ITEM_CLUB: return FEAT_IMPROVED_CRITICAL_CLUB;
|
||||
case BASE_ITEM_DAGGER: return FEAT_IMPROVED_CRITICAL_DAGGER;
|
||||
case BASE_ITEM_DART: return FEAT_IMPROVED_CRITICAL_DART;
|
||||
case BASE_ITEM_DIREMACE: return FEAT_IMPROVED_CRITICAL_DIRE_MACE;
|
||||
case BASE_ITEM_DOUBLEAXE: return FEAT_IMPROVED_CRITICAL_DOUBLE_AXE;
|
||||
case BASE_ITEM_DWARVENWARAXE: return FEAT_IMPROVED_CRITICAL_DWAXE ;
|
||||
case BASE_ITEM_GREATAXE: return FEAT_IMPROVED_CRITICAL_GREAT_AXE;
|
||||
case BASE_ITEM_GREATSWORD: return FEAT_IMPROVED_CRITICAL_GREAT_SWORD;
|
||||
case BASE_ITEM_HALBERD: return FEAT_IMPROVED_CRITICAL_HALBERD;
|
||||
case BASE_ITEM_HANDAXE: return FEAT_IMPROVED_CRITICAL_HAND_AXE;
|
||||
case BASE_ITEM_HEAVYCROSSBOW: return FEAT_IMPROVED_CRITICAL_HEAVY_CROSSBOW;
|
||||
case BASE_ITEM_HEAVYFLAIL: return FEAT_IMPROVED_CRITICAL_HEAVY_FLAIL;
|
||||
case BASE_ITEM_KAMA: return FEAT_IMPROVED_CRITICAL_KAMA;
|
||||
case BASE_ITEM_KATANA: return FEAT_IMPROVED_CRITICAL_KATANA;
|
||||
case BASE_ITEM_KUKRI: return FEAT_IMPROVED_CRITICAL_KUKRI;
|
||||
case BASE_ITEM_LIGHTCROSSBOW: return FEAT_IMPROVED_CRITICAL_LIGHT_CROSSBOW;
|
||||
case BASE_ITEM_LIGHTFLAIL: return FEAT_IMPROVED_CRITICAL_LIGHT_FLAIL;
|
||||
case BASE_ITEM_LIGHTHAMMER: return FEAT_IMPROVED_CRITICAL_LIGHT_HAMMER;
|
||||
case BASE_ITEM_LIGHTMACE: return FEAT_IMPROVED_CRITICAL_LIGHT_MACE;
|
||||
case BASE_ITEM_LONGBOW: return FEAT_IMPROVED_CRITICAL_LONG_SWORD;
|
||||
case BASE_ITEM_LONGSWORD: return FEAT_IMPROVED_CRITICAL_LONGBOW;
|
||||
case BASE_ITEM_MORNINGSTAR: return FEAT_IMPROVED_CRITICAL_MORNING_STAR;
|
||||
case BASE_ITEM_QUARTERSTAFF: return FEAT_IMPROVED_CRITICAL_STAFF;
|
||||
case BASE_ITEM_RAPIER: return FEAT_IMPROVED_CRITICAL_RAPIER;
|
||||
case BASE_ITEM_SCIMITAR: return FEAT_IMPROVED_CRITICAL_SCIMITAR;
|
||||
case BASE_ITEM_SCYTHE: return FEAT_IMPROVED_CRITICAL_SCYTHE;
|
||||
case BASE_ITEM_SHORTBOW: return FEAT_IMPROVED_CRITICAL_SHORTBOW;
|
||||
case BASE_ITEM_SHORTSPEAR: return FEAT_IMPROVED_CRITICAL_SPEAR;
|
||||
case BASE_ITEM_SHORTSWORD: return FEAT_IMPROVED_CRITICAL_SHORT_SWORD;
|
||||
case BASE_ITEM_SHURIKEN: return FEAT_IMPROVED_CRITICAL_SHURIKEN;
|
||||
case BASE_ITEM_SICKLE: return FEAT_IMPROVED_CRITICAL_SICKLE;
|
||||
case BASE_ITEM_SLING: return FEAT_IMPROVED_CRITICAL_SLING;
|
||||
case BASE_ITEM_THROWINGAXE: return FEAT_IMPROVED_CRITICAL_THROWING_AXE;
|
||||
case BASE_ITEM_TWOBLADEDSWORD: return FEAT_IMPROVED_CRITICAL_TWO_BLADED_SWORD;
|
||||
case BASE_ITEM_WARHAMMER: return FEAT_IMPROVED_CRITICAL_WAR_HAMMER;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GetMeleeWeaponCriticalRange(object oPC, object oWeap)
|
||||
{
|
||||
int iType = GetBaseItemType(oWeap);
|
||||
int nThreat = StringToInt(Get2DAString("baseitems", "CritThreat", iType));
|
||||
int bKeen = GetItemHasItemProperty(oWeap, ITEM_PROPERTY_KEEN);
|
||||
int bImpCrit = GetHasFeat(GetFeatByWeaponType(iType, "ImprovedCrit"), oPC);
|
||||
|
||||
nThreat *= bKeen ? 2 : 1;
|
||||
nThreat *= bImpCrit ? 2 : 1;
|
||||
|
||||
return 21 - nThreat;
|
||||
}
|
||||
|
||||
int DoMeleeAttack(object oPC, object oWeap, object oTarget, int iMod = 0, int bShowFeedback = TRUE, float fDelay = 0.0)
|
||||
{
|
||||
//Declare in instantiate major variables
|
||||
int iDiceRoll = d20();
|
||||
int iBAB = GetBaseAttackBonus(oPC);
|
||||
int iAC = GetAC(oTarget);
|
||||
int iType = GetBaseItemType(oWeap);
|
||||
int iCritThreat = GetMeleeWeaponCriticalRange(oPC, oWeap);
|
||||
int bFinesse = GetHasFeat(FEAT_WEAPON_FINESSE, oPC);
|
||||
int bLight = StringToInt(Get2DAString("baseitems", "WeaponSize", iType)) <= 2 || iType == BASE_ITEM_RAPIER;
|
||||
int iEnhancement = GetWeaponEnhancement(oWeap);
|
||||
iEnhancement = iEnhancement < 0 ? 0 : iEnhancement;
|
||||
int bFocus = GetHasFeat(GetFeatByWeaponType(iType, "Focus"), oPC);
|
||||
int bEFocus = GetHasFeat(GetFeatByWeaponType(iType, "EpicFocus"), oPC);
|
||||
int bProwess = GetHasFeat(FEAT_EPIC_PROWESS, oPC);
|
||||
int iStr = GetAbilityModifier(ABILITY_STRENGTH, oPC);
|
||||
iStr = iStr < 0 ? 0 : iStr;
|
||||
int iDex = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
|
||||
iDex = iStr < 0 ? 0 : iDex;
|
||||
string sFeedback = GetName(oPC) + " attacks " + GetName(oTarget) + ": ";
|
||||
int iReturn = 0;
|
||||
|
||||
//Add up total attack bonus
|
||||
int iAttackBonus = iBAB;
|
||||
iAttackBonus += bFinesse && bLight ? iDex : iStr;
|
||||
iAttackBonus += bFocus ? 1 : 0;
|
||||
iAttackBonus += bEFocus ? 2 : 0;
|
||||
iAttackBonus += bProwess ? 1 : 0;
|
||||
iAttackBonus += iEnhancement;
|
||||
iAttackBonus += iMod;
|
||||
|
||||
//Include ATTACK_BONUS properties from the weapon
|
||||
itemproperty ip = GetFirstItemProperty(oWeap);
|
||||
while(GetIsItemPropertyValid(ip))
|
||||
{
|
||||
if(GetItemPropertyType(ip) == ITEM_PROPERTY_ATTACK_BONUS)
|
||||
iAttackBonus += GetItemPropertyCostTableValue(ip);
|
||||
ip = GetNextItemProperty(oWeap);
|
||||
}
|
||||
|
||||
//Check for a critical threat
|
||||
if(iDiceRoll >= iCritThreat && iDiceRoll + iAttackBonus > iAC)
|
||||
{
|
||||
sFeedback += "*critical hit*: (" + IntToString(iDiceRoll) + " + " + IntToString(iAttackBonus) + " = " + IntToString(iDiceRoll + iAttackBonus) + "): ";
|
||||
//Roll again to see if we scored a critical hit
|
||||
iDiceRoll = d20();
|
||||
|
||||
sFeedback += "*threat roll*: (" + IntToString(iDiceRoll) + " + " + IntToString(iAttackBonus) + " = " + IntToString(iDiceRoll + iAttackBonus) + ")";
|
||||
if(iDiceRoll + iAttackBonus > iAC)
|
||||
iReturn = 2;
|
||||
else
|
||||
iReturn = 1;
|
||||
}
|
||||
|
||||
//Just a regular hit
|
||||
else if(iDiceRoll + iAttackBonus > iAC)
|
||||
{
|
||||
sFeedback += "*hit*: (" + IntToString(iDiceRoll) + " + " + IntToString(iAttackBonus) + " = " + IntToString(iDiceRoll + iAttackBonus) + ")";
|
||||
iReturn = 1;
|
||||
}
|
||||
|
||||
//Missed
|
||||
else
|
||||
{
|
||||
sFeedback += "*miss*: (" + IntToString(iDiceRoll) + " + " + IntToString(iAttackBonus) + " = " + IntToString(iDiceRoll + iAttackBonus) + ")";
|
||||
iReturn = 0;
|
||||
}
|
||||
|
||||
if(bShowFeedback) DelayCommand(fDelay, SendMessageToPC(oPC, sFeedback));
|
||||
return iReturn;
|
||||
}
|
||||
|
||||
int GetMeleeWeaponDamage(object oPC, object oWeap, int bCrit = FALSE,int iDamage = 0)
|
||||
{
|
||||
//Declare in instantiate major variables
|
||||
int iType = GetBaseItemType(oWeap);
|
||||
int nSides = StringToInt(Get2DAString("baseitems", "DieToRoll", iType));
|
||||
int nDice = StringToInt(Get2DAString("baseitems", "NumDice", iType));
|
||||
int nCritMult = StringToInt(Get2DAString("baseitems", "CritHitMult", iType));
|
||||
int nMassiveCrit;
|
||||
int iStr = GetAbilityModifier(ABILITY_STRENGTH, oPC);
|
||||
iStr = iStr < 0 ? 0 : iStr;
|
||||
int bSpec = GetHasFeat(GetFeatByWeaponType(iType, "Specialization"), oPC);
|
||||
int bESpec = GetHasFeat(GetFeatByWeaponType(iType, "EpicSpecialization"), oPC);
|
||||
// int iDamage = 0;
|
||||
int iBonus = 0;
|
||||
int iEnhancement = GetWeaponEnhancement(oWeap);
|
||||
iEnhancement = iEnhancement < 0 ? 0 : iEnhancement;
|
||||
|
||||
//Get Damage Bonus and Massive Critical Properties from oWeap
|
||||
itemproperty ip = GetFirstItemProperty(oWeap);
|
||||
while(GetIsItemPropertyValid(ip))
|
||||
{
|
||||
int tempConst = -1;
|
||||
int iCostVal = GetItemPropertyCostTableValue(ip);
|
||||
|
||||
if(GetItemPropertyType(ip) == ITEM_PROPERTY_MASSIVE_CRITICALS){
|
||||
if(iCostVal > tempConst){
|
||||
nMassiveCrit = GetDamageByConstant(iCostVal, TRUE);
|
||||
tempConst = iCostVal;
|
||||
}
|
||||
}
|
||||
|
||||
if(GetItemPropertyType(ip) == ITEM_PROPERTY_DAMAGE_BONUS){
|
||||
iBonus += GetDamageByConstant(iCostVal, TRUE);
|
||||
}
|
||||
ip = GetNextItemProperty(oWeap);
|
||||
}
|
||||
|
||||
//Roll the base damage dice.
|
||||
if(nSides == 2) iDamage += d2(nDice);
|
||||
if(nSides == 4) iDamage += d4(nDice);
|
||||
if(nSides == 6) iDamage += d6(nDice);
|
||||
if(nSides == 8) iDamage += d8(nDice);
|
||||
if(nSides == 10) iDamage += d10(nDice);
|
||||
if(nSides == 12) iDamage += d12(nDice);
|
||||
|
||||
//Add any applicable bonuses
|
||||
if(bSpec) iDamage += 2;
|
||||
if(bESpec) iDamage += 4;
|
||||
iDamage += iStr;
|
||||
iDamage += iEnhancement;
|
||||
iDamage += iBonus;
|
||||
|
||||
//Add critical bonuses
|
||||
if(bCrit){
|
||||
iDamage *= nCritMult;
|
||||
iDamage += nMassiveCrit;
|
||||
}
|
||||
|
||||
return iDamage;
|
||||
}
|
||||
|
||||
int GetWeaponEnhancement(object oWeap)
|
||||
{
|
||||
int iBonus = -1;
|
||||
int iTemp;
|
||||
|
||||
itemproperty ip = GetFirstItemProperty(oWeap);
|
||||
while(GetIsItemPropertyValid(ip))
|
||||
{
|
||||
if(GetItemPropertyType(ip) == ITEM_PROPERTY_ENHANCEMENT_BONUS)
|
||||
iTemp += GetDamageByConstant(GetItemPropertyCostTableValue(ip), TRUE);
|
||||
iBonus = iTemp > iBonus ? iBonus : iTemp;
|
||||
ip = GetNextItemProperty(oWeap);
|
||||
}
|
||||
return iBonus;
|
||||
}
|
||||
|
||||
int GetWeaponDamageType(object oWeap)
|
||||
{
|
||||
int iType = GetBaseItemType(oWeap);
|
||||
|
||||
switch(iType)
|
||||
{
|
||||
case BASE_ITEM_BASTARDSWORD:
|
||||
case BASE_ITEM_BATTLEAXE:
|
||||
case BASE_ITEM_DOUBLEAXE:
|
||||
case BASE_ITEM_DWARVENWARAXE:
|
||||
case BASE_ITEM_GREATAXE:
|
||||
case BASE_ITEM_GREATSWORD:
|
||||
case BASE_ITEM_HALBERD:
|
||||
case BASE_ITEM_HANDAXE:
|
||||
case BASE_ITEM_KAMA:
|
||||
case BASE_ITEM_KATANA:
|
||||
case BASE_ITEM_KUKRI:
|
||||
case BASE_ITEM_LONGSWORD:
|
||||
case BASE_ITEM_SCIMITAR:
|
||||
case BASE_ITEM_SHORTSWORD:
|
||||
case BASE_ITEM_SHURIKEN:
|
||||
case BASE_ITEM_SICKLE:
|
||||
case BASE_ITEM_THROWINGAXE:
|
||||
case BASE_ITEM_TWOBLADEDSWORD:
|
||||
case BASE_ITEM_WHIP:
|
||||
return DAMAGE_TYPE_SLASHING;
|
||||
|
||||
case BASE_ITEM_DAGGER:
|
||||
case BASE_ITEM_DART:
|
||||
case BASE_ITEM_SHORTSPEAR:
|
||||
case BASE_ITEM_RAPIER:
|
||||
case BASE_ITEM_LONGBOW:
|
||||
case BASE_ITEM_SHORTBOW:
|
||||
case BASE_ITEM_LIGHTCROSSBOW:
|
||||
case BASE_ITEM_HEAVYCROSSBOW:
|
||||
return DAMAGE_TYPE_PIERCING;
|
||||
|
||||
case BASE_ITEM_WARHAMMER:
|
||||
case BASE_ITEM_MORNINGSTAR:
|
||||
case BASE_ITEM_QUARTERSTAFF:
|
||||
case BASE_ITEM_LIGHTFLAIL:
|
||||
case BASE_ITEM_LIGHTHAMMER:
|
||||
case BASE_ITEM_LIGHTMACE:
|
||||
case BASE_ITEM_HEAVYFLAIL:
|
||||
case BASE_ITEM_DIREMACE:
|
||||
return DAMAGE_TYPE_BLUDGEONING;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
421
_removed/inc_item_props.nss
Normal file
421
_removed/inc_item_props.nss
Normal file
@@ -0,0 +1,421 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Item Property Function]
|
||||
//:: [inc_item_props.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: This file defines several functions used to
|
||||
//:: manipulate item properties. In particular,
|
||||
//:: It defines functions used in the prc_* files
|
||||
//:: to apply passive feat bonuses.
|
||||
//::
|
||||
//:: Take special note of SetCompositeBonus. This
|
||||
//:: function is crucial for allowing bonuses of the
|
||||
//:: same type from different PRCs to stack.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 19, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Update: Jan 4 2002
|
||||
//:: - Extended Composite bonus function to handle pretty much
|
||||
//:: every property that can possibly be composited.
|
||||
|
||||
// * Checks to see if oPC has an item created by sRes in his/her inventory
|
||||
int GetHasItem(object oPC, string sRes);
|
||||
|
||||
// * Sets up the pcskin object on oPC
|
||||
// * If it already exists, simply return it
|
||||
// * Otherwise, create and equip it
|
||||
object GetPCSkin(object oPC);
|
||||
|
||||
// * Checks oItem for all properties matching iType and iSubType
|
||||
// * Removes all these properties and returns their total CostTableVal.
|
||||
// * This function should only be used for Item Properties that have
|
||||
// * simple integer CostTableVals, such as AC, Save/Skill Bonuses, etc.
|
||||
// * iType = ITEM_PROPERTY_* of bonus
|
||||
// * iSubType = IP_CONST_* of bonus SubType if applicable
|
||||
int TotalAndRemoveProperty(object oItem, int iType, int iSubType = -1);
|
||||
|
||||
// * Used to roll bonuses from multiple sources into a single property
|
||||
// * Only supports properties which have simple integer CostTableVals.
|
||||
// * See the switch for a list of supported types. Some important properties
|
||||
// * that CANNOT be composited are SpellResistance, DamageBonus, DamageReduction
|
||||
// * DamageResistance and MassiveCritical, as these use constants instead of
|
||||
// * integers for CostTableVals.
|
||||
// *
|
||||
// * oPC = Object wearing / using the item
|
||||
// * oItem = Object to apply bonus to
|
||||
// * sBonus = String name of the source for this bonus
|
||||
// * iVal = Integer value to set this bonus to
|
||||
// * iType: ITEM_PROPERTY_* of bonus
|
||||
// * iSubType: IP_CONST_* of bonus SubType if applicable
|
||||
void SetCompositeBonus(object oItem, string sBonus, int iVal, int iType, int iSubType = -1);
|
||||
|
||||
// * Returns the total Bonus AC of oItem
|
||||
int GetACBonus(object oItem);
|
||||
|
||||
// * Returns the Base AC (i.e. AC without bonuses) of oItem
|
||||
int GetBaseAC(object oItem);
|
||||
|
||||
// * Removes a Presice Strike bonus from oWeap.
|
||||
// * Existing bonuses are determined by reading LocalInt "PStrkBonus" on oWeap
|
||||
void DuelistRemovePreciseStrike(object oWeap);
|
||||
|
||||
// * Returns the opposite element from iElem or -1 if iElem is not valid
|
||||
// * Can be useful for determining elemental strengths and weaknesses
|
||||
// * iElem = IP_CONST_DAMAGETYPE_*
|
||||
int GetOppositeElement(int iElem);
|
||||
|
||||
int GetHasItem(object oPC, string sRes)
|
||||
{
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
|
||||
while(GetIsObjectValid(oItem) && GetResRef(oItem) != sRes)
|
||||
oItem = GetNextItemInInventory(oPC);
|
||||
|
||||
return GetResRef(oItem) == sRes;
|
||||
}
|
||||
|
||||
object GetPCSkin(object oPC)
|
||||
{
|
||||
object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC);
|
||||
|
||||
//Added GetHasItem check to prevent creation of extra skins on module entry
|
||||
if(!GetIsObjectValid(oSkin) && !GetHasItem(oPC, "base_prc_skin")){
|
||||
oSkin = CreateItemOnObject("base_prc_skin", oPC);
|
||||
AssignCommand(oPC, ActionEquipItem(oSkin, INVENTORY_SLOT_CARMOUR));
|
||||
}
|
||||
return oSkin;
|
||||
}
|
||||
|
||||
int TotalAndRemoveProperty(object oItem, int iType, int iSubType = -1)
|
||||
{
|
||||
itemproperty ip = GetFirstItemProperty(oItem);
|
||||
int total = 0;
|
||||
|
||||
while(GetIsItemPropertyValid(ip)){
|
||||
if(GetItemPropertyType(ip) == iType && (GetItemPropertySubType(ip) == iSubType || iSubType == -1)){
|
||||
total += GetItemPropertyCostTableValue(ip);
|
||||
RemoveItemProperty(oItem, ip);
|
||||
}
|
||||
ip = GetNextItemProperty(oItem);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
void RemoveSpecificProperty(object oItem, int iType, int iSubType = -1, int iCostVal = -1, int iNum = 1, string sFlag = "")
|
||||
{
|
||||
int iRemoved = 0;
|
||||
itemproperty ip = GetFirstItemProperty(oItem);
|
||||
while(GetIsItemPropertyValid(ip) && iRemoved < iNum){
|
||||
if(GetItemPropertyType(ip) == iType && GetItemPropertySubType(ip) == iSubType && GetItemPropertyCostTableValue(ip) == iCostVal){
|
||||
RemoveItemProperty(oItem, ip);
|
||||
iRemoved++;
|
||||
}
|
||||
ip = GetNextItemProperty(oItem);
|
||||
}
|
||||
SetLocalInt(oItem, sFlag, 0);
|
||||
}
|
||||
|
||||
void SetCompositeBonus(object oItem, string sBonus, int iVal, int iType, int iSubType = -1)
|
||||
{
|
||||
int iOldVal = GetLocalInt(oItem, sBonus);
|
||||
int iChange = iVal - iOldVal;
|
||||
int iCurVal = 0;
|
||||
|
||||
if(iChange == 0) return;
|
||||
|
||||
//Moved TotalAndRemoveProperty into switch to prevent
|
||||
//accidental deletion of unsupported property types
|
||||
switch(iType)
|
||||
{
|
||||
case ITEM_PROPERTY_ABILITY_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 12)
|
||||
{
|
||||
iCurVal = 12;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_AC_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonus(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonusVsAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonusVsDmgType(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonusVsRace(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyACBonusVsSAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ATTACK_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonus(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonusVsAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonusVsRace(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonusVsSAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_ABILITY_SCORE:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseAbility(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_AC:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 5)
|
||||
{
|
||||
iCurVal = 5;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseAC(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 5)
|
||||
{
|
||||
iCurVal = 5;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackPenalty(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 5)
|
||||
{
|
||||
iCurVal = 5;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyEnhancementPenalty(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_SAVING_THROWS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyReducedSavingThrowVsX(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyReducedSavingThrow(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_DECREASED_SKILL_MODIFIER:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 10)
|
||||
{
|
||||
iCurVal = 10;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseSkill(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ENHANCEMENT_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyEnhancementBonus(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyEnhancementBonusVsAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyEnhancementBonusVsRace(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyEnhancementBonusVsSAlign(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_MIGHTY:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyMaxRangeStrengthMod(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_REGENERATION:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyRegeneration(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_REGENERATION_VAMPIRIC:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyVampiricRegeneration(iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_SAVING_THROW_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusSavingThrowVsX(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 20)
|
||||
{
|
||||
iCurVal = 20;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusSavingThrow(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
case ITEM_PROPERTY_SKILL_BONUS:
|
||||
iCurVal = TotalAndRemoveProperty(oItem, iType, iSubType);
|
||||
if ((iCurVal + iChange) > 50)
|
||||
{
|
||||
iCurVal = 50;
|
||||
iChange = 0;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertySkillBonus(iSubType, iCurVal + iChange), oItem);
|
||||
break;
|
||||
}
|
||||
SetLocalInt(oItem, sBonus, iVal);
|
||||
}
|
||||
|
||||
int GetACBonus(object oItem)
|
||||
{
|
||||
if(!GetIsObjectValid(oItem)) return 0;
|
||||
|
||||
itemproperty ip = GetFirstItemProperty(oItem);
|
||||
int iTotal = 0;
|
||||
|
||||
while(GetIsItemPropertyValid(ip)){
|
||||
if(GetItemPropertyType(ip) == ITEM_PROPERTY_AC_BONUS)
|
||||
iTotal += GetItemPropertyCostTableValue(ip);
|
||||
ip = GetNextItemProperty(oItem);
|
||||
}
|
||||
return iTotal;
|
||||
}
|
||||
|
||||
int GetBaseAC(object oItem){ return GetItemACValue(oItem) - GetACBonus(oItem); }
|
||||
|
||||
//Added a flag to make sure bonus is only removed once
|
||||
void DuelistRemovePreciseStrike(object oWeap)
|
||||
{
|
||||
int iPStrkBonus = GetLocalInt(oWeap, "PStrkBonus");
|
||||
if(iPStrkBonus != 0)
|
||||
RemoveSpecificProperty(oWeap, ITEM_PROPERTY_DAMAGE_BONUS, IP_CONST_DAMAGETYPE_SLASHING, iPStrkBonus, 1, "PStrkBonus");
|
||||
}
|
||||
|
||||
int GetOppositeElement(int iElem)
|
||||
{
|
||||
switch(iElem){
|
||||
case IP_CONST_DAMAGETYPE_ACID:
|
||||
return DAMAGE_TYPE_ELECTRICAL;
|
||||
case IP_CONST_DAMAGETYPE_COLD:
|
||||
return IP_CONST_DAMAGETYPE_FIRE;
|
||||
case IP_CONST_DAMAGETYPE_DIVINE:
|
||||
return IP_CONST_DAMAGETYPE_NEGATIVE;
|
||||
case IP_CONST_DAMAGETYPE_ELECTRICAL:
|
||||
return IP_CONST_DAMAGETYPE_ACID;
|
||||
case IP_CONST_DAMAGETYPE_FIRE:
|
||||
return IP_CONST_DAMAGETYPE_COLD;
|
||||
case IP_CONST_DAMAGETYPE_NEGATIVE:
|
||||
return IP_CONST_DAMAGETYPE_POSITIVE;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
336
_removed/inc_prc_function.nss
Normal file
336
_removed/inc_prc_function.nss
Normal file
@@ -0,0 +1,336 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [PRC Feat Router]
|
||||
//:: [inc_prc_function.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: This file serves as a hub for the various
|
||||
//:: PRC passive feat functions. If you need to
|
||||
//:: add passive feats for a new PRC, link them here.
|
||||
//::
|
||||
//:: This file also contains a few multi-purpose
|
||||
//:: PRC functions that need to be included in several
|
||||
//:: places.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 19, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// This is the "event" that is called to re-evalutate PRC bonuses. Currently
|
||||
// it is fired by OnEquip, OnUnequip and OnLevel. If you want to move any
|
||||
// classes into this event, just copy the format below. Basically, this function
|
||||
// is meant to keep the code looking nice and clean by routing each class's
|
||||
// feats to their own self-contained script
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
#include "prc_dg_inc"
|
||||
#include "discipleinclude"
|
||||
#include "strat_prc_inc"
|
||||
#include "heartward_inc"
|
||||
// Gets the racial type (RACIAL_TYPE_*) of oCreature
|
||||
// * Return value if oCreature is not a valid creature: RACIAL_TYPE_INVALID
|
||||
// This function includes changes via levels of classes (like the lich)
|
||||
// If you want to set a race dynamicaly set a local called "RACIAL_TYPE"
|
||||
// NOTE "RACIAL_TYPE" must be RACIAL_TYPE_* + 1, because we use 0 as meaning it
|
||||
// is not set but a zero == RACIAL_TYPE_DWARF
|
||||
int MyPRCGetRacialType(object oCreature);
|
||||
|
||||
// * Check to see which custom PRCs oPC has and apply the proper feat bonuses
|
||||
void EvalPRCFeats(object oPC);
|
||||
|
||||
void EvalPRCFeats(object oPC)
|
||||
{
|
||||
//Elemental savant is sort of four classes in one, so we'll take care
|
||||
//of them all at once.
|
||||
int iElemSavant = GetLevelByClass(CLASS_TYPE_ES_FIRE, oPC);
|
||||
iElemSavant += GetLevelByClass(CLASS_TYPE_ES_COLD, oPC);
|
||||
iElemSavant += GetLevelByClass(CLASS_TYPE_ES_ELEC, oPC);
|
||||
iElemSavant += GetLevelByClass(CLASS_TYPE_ES_ACID, oPC);
|
||||
|
||||
//Route the event to the appropriate class specific scripts
|
||||
if(GetLevelByClass(CLASS_TYPE_DUELIST, oPC) > 0) ExecuteScript("prc_duelist", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_ACOLYTE, oPC) > 0) ExecuteScript("prc_acolyte", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_SPELLSWORD, oPC) > 0) ExecuteScript("prc_spellswd", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_MAGEKILLER, oPC) > 0) ExecuteScript("prc_magekill", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_OOZEMASTER, oPC) > 0) ExecuteScript("prc_oozemstr", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_DISCIPLE_OF_MEPH, oPC) > 0) ExecuteScript("prc_discmeph", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_LICH, oPC) > 0) ExecuteScript("pnp_lich_level", oPC);
|
||||
if(iElemSavant > 0) ExecuteScript("prc_elemsavant", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_HEARTWARDER,oPC) > 0) ExecuteScript("prc_heartwarder", oPC);
|
||||
if(GetLevelByClass(CLASS_TYPE_STORMLORD,oPC) > 0) ExecuteScript("prc_stormlord", oPC);
|
||||
}
|
||||
|
||||
// This is required if you want your skin effects to work with the shifter
|
||||
// The shifter skin is wiped when it returns to normal form
|
||||
// Any locals you use for your skin should be added to this list
|
||||
void DeletePRCLocalInts(object oSkin);
|
||||
void DeletePRCLocalInts(object oSkin)
|
||||
{
|
||||
// In order to work with the PRC system we need to delete some locals for each
|
||||
// PRC that has a hide
|
||||
// Duelist
|
||||
DeleteLocalInt(oSkin,"DiscMephResist");
|
||||
DeleteLocalInt(oSkin,"GraceBonus");
|
||||
DeleteLocalInt(oSkin,"ElaborateParryBonus");
|
||||
DeleteLocalInt(oSkin,"CannyDefenseBonus");
|
||||
// Elemental Savants
|
||||
DeleteLocalInt(oSkin,"ElemSavantResist");
|
||||
DeleteLocalInt(oSkin,"ElemSavantPerfection");
|
||||
DeleteLocalInt(oSkin,"ElemSavantImmMind");
|
||||
DeleteLocalInt(oSkin,"ElemSavantImmParal");
|
||||
DeleteLocalInt(oSkin,"ElemSavantImmSleep");
|
||||
// heartWarder
|
||||
DeleteLocalInt(oSkin,"HeartPassion");
|
||||
DeleteLocalInt(oSkin,"FeyType");
|
||||
// MageKiller
|
||||
DeleteLocalInt(oSkin,"MKFortBonus");
|
||||
DeleteLocalInt(oSkin,"MKRefBonus");
|
||||
// Master Harper
|
||||
DeleteLocalInt(oSkin,"MHLycanbane");
|
||||
DeleteLocalInt(oSkin,"MHMililEar");
|
||||
DeleteLocalInt(oSkin,"MHDeneirsOrel");
|
||||
// OozeMaster
|
||||
DeleteLocalInt(oSkin,"OozeChaPen");
|
||||
DeleteLocalInt(oSkin,"IndiscernibleCrit");
|
||||
DeleteLocalInt(oSkin,"IndiscernibleBS");
|
||||
DeleteLocalInt(oSkin,"OneOozeMind");
|
||||
DeleteLocalInt(oSkin,"OneOozePoison");
|
||||
// Storm lord
|
||||
DeleteLocalInt(oSkin,"StormLResElec");
|
||||
// Spell sword
|
||||
DeleteLocalInt(oSkin,"SpellswordSFBonusNormal");
|
||||
DeleteLocalInt(oSkin,"SpellswordSFBonusEpic");
|
||||
// Acolyte of the skin
|
||||
DeleteLocalInt(oSkin,"AcolyteSkinBonus");
|
||||
DeleteLocalInt(oSkin,"AcolyteSymbBonus");
|
||||
DeleteLocalInt(oSkin,"AcolyteStatBonusCon");
|
||||
DeleteLocalInt(oSkin,"AcolyteStatBonusDex");
|
||||
DeleteLocalInt(oSkin,"AcolyteStatBonusInt");
|
||||
DeleteLocalInt(oSkin,"AcolyteResistanceCold");
|
||||
DeleteLocalInt(oSkin,"AcolyteResistanceFire");
|
||||
DeleteLocalInt(oSkin,"AcolyteResistanceAcid");
|
||||
DeleteLocalInt(oSkin,"AcolyteResistanceElectric");
|
||||
DeleteLocalInt(oSkin,"AcolyteStatBonusDex");
|
||||
// future PRCs Go below here
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
//Miscellaneous PRC Functions
|
||||
//--------------------------------------------------------
|
||||
|
||||
// * Hierophant Spell-Like abilities have some problems that need to be corrected
|
||||
// * during spell casting. This function checks to see if the spell that triggered
|
||||
// * a particular script was a Hierophant SLA.
|
||||
int GetWasLastSpellHieroSLA();
|
||||
|
||||
// * Adjust DC and Spell Pen for spell power feats. Hierophants and Archmages get these.
|
||||
int GetSpellPowerBonus(object oCaster);
|
||||
|
||||
// * Finds the difference between alignment of oSource and oTarget
|
||||
// * returns the number of steps between the two
|
||||
// * i.e. Good compared to Evil = 2 steps
|
||||
int CompareAlignment(object oSource, object oTarget);
|
||||
|
||||
// * This function will check to see if a spell should be maximized by
|
||||
// * the Hierophant's Faith Healing or Blast Infidel feats.
|
||||
// * oCaster = Object casting the spell
|
||||
// * oTarget = Object being targetted
|
||||
// * iEnergyType = DAMAGE_TYPE_* (POSITIVE for healing, or NEGATIVE for Neg Energy spells
|
||||
// * iDisplay = TRUE/FALSE (Whether or not to show feedback)
|
||||
int BlastInfidelOrFaithHeal(object oCaster, object oTarget, int iEnergyType, int iDisplayFeedback);
|
||||
|
||||
//Check that the character has Hierophant levels, that the last
|
||||
//spell cast was an ability (i.e. accessed from class abilities), and
|
||||
//that the spell was on the list of Hierophant SLAs. It's not a perfect
|
||||
//test, but it should work 99.9% of the time.
|
||||
int GetWasLastSpellHieroSLA()
|
||||
{
|
||||
int iAbility = GetLastSpellCastClass() == CLASS_TYPE_INVALID;
|
||||
int iClass = GetLevelByClass(CLASS_TYPE_HIEROPHANT, OBJECT_SELF) > 0;
|
||||
int iSpell = GetSpellId() == SPELL_HOLY_AURA ||
|
||||
GetSpellId() == SPELL_UNHOLY_AURA ||
|
||||
GetSpellId() == SPELL_BANISHMENT ||
|
||||
GetSpellId() == SPELL_BATTLETIDE ||
|
||||
GetSpellId() == SPELL_BLADE_BARRIER ||
|
||||
GetSpellId() == SPELL_CIRCLE_OF_DOOM ||
|
||||
GetSpellId() == SPELL_CONTROL_UNDEAD ||
|
||||
GetSpellId() == SPELL_CREATE_GREATER_UNDEAD ||
|
||||
GetSpellId() == SPELL_CREATE_UNDEAD ||
|
||||
GetSpellId() == SPELL_CURE_CRITICAL_WOUNDS ||
|
||||
GetSpellId() == SPELL_DEATH_WARD ||
|
||||
GetSpellId() == SPELL_DESTRUCTION ||
|
||||
GetSpellId() == SPELL_DISMISSAL ||
|
||||
GetSpellId() == SPELL_DIVINE_POWER ||
|
||||
GetSpellId() == SPELL_EARTHQUAKE ||
|
||||
GetSpellId() == SPELL_ENERGY_DRAIN ||
|
||||
GetSpellId() == SPELL_ETHEREALNESS ||
|
||||
GetSpellId() == SPELL_FIRE_STORM ||
|
||||
GetSpellId() == SPELL_FLAME_STRIKE ||
|
||||
GetSpellId() == SPELL_FREEDOM_OF_MOVEMENT ||
|
||||
GetSpellId() == SPELL_GATE ||
|
||||
GetSpellId() == SPELL_GREATER_DISPELLING ||
|
||||
GetSpellId() == SPELL_GREATER_MAGIC_WEAPON ||
|
||||
GetSpellId() == SPELL_GREATER_RESTORATION ||
|
||||
GetSpellId() == SPELL_HAMMER_OF_THE_GODS ||
|
||||
GetSpellId() == SPELL_HARM ||
|
||||
GetSpellId() == SPELL_HEAL ||
|
||||
GetSpellId() == SPELL_HEALING_CIRCLE ||
|
||||
GetSpellId() == SPELL_IMPLOSION ||
|
||||
GetSpellId() == SPELL_INFLICT_CRITICAL_WOUNDS ||
|
||||
GetSpellId() == SPELL_MASS_HEAL ||
|
||||
GetSpellId() == SPELL_MONSTROUS_REGENERATION ||
|
||||
GetSpellId() == SPELL_NEUTRALIZE_POISON ||
|
||||
GetSpellId() == SPELL_PLANAR_ALLY ||
|
||||
GetSpellId() == SPELL_POISON ||
|
||||
GetSpellId() == SPELL_RAISE_DEAD ||
|
||||
GetSpellId() == SPELL_REGENERATE ||
|
||||
GetSpellId() == SPELL_RESTORATION ||
|
||||
GetSpellId() == SPELL_RESURRECTION ||
|
||||
GetSpellId() == SPELL_SLAY_LIVING ||
|
||||
GetSpellId() == SPELL_SPELL_RESISTANCE ||
|
||||
GetSpellId() == SPELL_STORM_OF_VENGEANCE ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_IV ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_IX ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_V ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_VI ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_VII ||
|
||||
GetSpellId() == SPELL_SUMMON_CREATURE_VIII ||
|
||||
GetSpellId() == SPELL_SUNBEAM ||
|
||||
GetSpellId() == SPELL_TRUE_SEEING ||
|
||||
GetSpellId() == SPELL_UNDEATH_TO_DEATH ||
|
||||
GetSpellId() == SPELL_UNDEATHS_ETERNAL_FOE ||
|
||||
GetSpellId() == SPELL_WORD_OF_FAITH;
|
||||
|
||||
return iClass && iAbility && iSpell;
|
||||
}
|
||||
|
||||
int GetSpellPowerBonus(object oCaster)
|
||||
{
|
||||
int nBonus = 0;
|
||||
|
||||
if(GetHasFeat(FEAT_SPELLPOWER_10, OBJECT_SELF))
|
||||
nBonus += 10;
|
||||
else if(GetHasFeat(FEAT_SPELLPOWER_8, OBJECT_SELF))
|
||||
nBonus += 8;
|
||||
else if(GetHasFeat(FEAT_SPELLPOWER_6, OBJECT_SELF))
|
||||
nBonus += 6;
|
||||
else if(GetHasFeat(FEAT_SPELLPOWER_4, OBJECT_SELF))
|
||||
nBonus += 4;
|
||||
else if(GetHasFeat(FEAT_SPELLPOWER_2, OBJECT_SELF))
|
||||
nBonus += 2;
|
||||
|
||||
return nBonus;
|
||||
}
|
||||
|
||||
//Return the number of steps difference on the alignment
|
||||
//chart between oSource and oTarget
|
||||
int CompareAlignment(object oSource, object oTarget)
|
||||
{
|
||||
int iStepDif;
|
||||
int iGE1 = GetAlignmentGoodEvil(oSource);
|
||||
int iLC1 = GetAlignmentLawChaos(oSource);
|
||||
int iGE2 = GetAlignmentGoodEvil(oTarget);
|
||||
int iLC2 = GetAlignmentLawChaos(oTarget);
|
||||
|
||||
if(iGE1 == ALIGNMENT_GOOD){
|
||||
if(iGE2 == ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
if(iGE2 == ALIGNMENT_EVIL)
|
||||
iStepDif += 2;
|
||||
}
|
||||
if(iGE1 == ALIGNMENT_NEUTRAL){
|
||||
if(iGE2 != ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
}
|
||||
if(iGE1 == ALIGNMENT_EVIL){
|
||||
if(iLC2 == ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
if(iLC2 == ALIGNMENT_GOOD)
|
||||
iStepDif += 2;
|
||||
}
|
||||
if(iLC1 == ALIGNMENT_LAWFUL){
|
||||
if(iLC2 == ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
if(iLC2 == ALIGNMENT_CHAOTIC)
|
||||
iStepDif += 2;
|
||||
}
|
||||
if(iLC1 == ALIGNMENT_NEUTRAL){
|
||||
if(iLC2 != ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
}
|
||||
if(iLC1 == ALIGNMENT_CHAOTIC){
|
||||
if(iLC2 == ALIGNMENT_NEUTRAL)
|
||||
iStepDif += 1;
|
||||
if(iLC2 == ALIGNMENT_LAWFUL)
|
||||
iStepDif += 2;
|
||||
}
|
||||
return iStepDif;
|
||||
}
|
||||
|
||||
//Check to see if oTarget will be healed or hurt by iEnergyType.
|
||||
//Then check to see if oTarget is of an appropriate alignment compared
|
||||
//to oCaster for either Blast Infidel or Faith Healing to work.
|
||||
int BlastInfidelOrFaithHeal(object oCaster, object oTarget, int iEnergyType, int iDisplayFeedback)
|
||||
{
|
||||
//Don't bother doing anything if iEnergyType isn't either positive/negative energy
|
||||
if(iEnergyType != DAMAGE_TYPE_POSITIVE && iEnergyType != DAMAGE_TYPE_NEGATIVE)
|
||||
return FALSE;
|
||||
|
||||
//If the target is undead and damage type is negative
|
||||
//or if the target is living and damage type is positive
|
||||
//then we're healing. Otherwise, we're harming.
|
||||
int iHeal = ( MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD && iEnergyType == DAMAGE_TYPE_NEGATIVE ) ||
|
||||
( MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && iEnergyType == DAMAGE_TYPE_POSITIVE );
|
||||
int iRetVal = FALSE;
|
||||
int iAlignDif = CompareAlignment(oCaster, oTarget);
|
||||
string sFeedback = "";
|
||||
|
||||
if(iHeal){
|
||||
if((GetHasFeat(FEAT_FAITH_HEALING, oCaster) && iAlignDif <= 2)){
|
||||
iRetVal = TRUE;
|
||||
sFeedback = "Faith Healing";
|
||||
}
|
||||
}
|
||||
else{
|
||||
if((GetHasFeat(FEAT_BLAST_INFIDEL, oCaster) && iAlignDif >= 2)){
|
||||
iRetVal = TRUE;
|
||||
sFeedback = "Blast Infidel";
|
||||
}
|
||||
}
|
||||
|
||||
if(iDisplayFeedback) FloatingTextStringOnCreature(sFeedback, oCaster);
|
||||
return iRetVal;
|
||||
}
|
||||
|
||||
int MyPRCGetRacialType(object oCreature)
|
||||
{
|
||||
// Determine if they have a class that makes them another racial type
|
||||
// level 4 lich is undead
|
||||
if (GetLevelByClass(CLASS_TYPE_LICH,oCreature) >= 4)
|
||||
return RACIAL_TYPE_UNDEAD;
|
||||
if (GetLevelByClass(CLASS_TYPE_MONK,oCreature) >= 20)
|
||||
return RACIAL_TYPE_OUTSIDER;
|
||||
if (GetLevelByClass(CLASS_TYPE_OOZEMASTER,oCreature) >= 10)
|
||||
return RACIAL_TYPE_OOZE;
|
||||
if (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE,oCreature) >= 10)
|
||||
return RACIAL_TYPE_DRAGON;
|
||||
if (GetLevelByClass(CLASS_TYPE_ACOLYTE,oCreature) >= 10)
|
||||
return RACIAL_TYPE_OUTSIDER;
|
||||
if (GetLevelByClass(CLASS_TYPE_ES_FIRE,oCreature) >= 10)
|
||||
return RACIAL_TYPE_ELEMENTAL;
|
||||
if (GetLevelByClass(CLASS_TYPE_ES_COLD,oCreature) >= 10)
|
||||
return RACIAL_TYPE_ELEMENTAL;
|
||||
if (GetLevelByClass(CLASS_TYPE_ES_ELEC,oCreature) >= 10)
|
||||
return RACIAL_TYPE_ELEMENTAL;
|
||||
if (GetLevelByClass(CLASS_TYPE_ES_ACID,oCreature) >= 10)
|
||||
return RACIAL_TYPE_ELEMENTAL;
|
||||
if (GetLevelByClass(CLASS_TYPE_HEARTWARDER,oCreature) >= 10)
|
||||
return RACIAL_TYPE_FEY;
|
||||
// check for a local variable that overrides the race
|
||||
// the shifter will use this everytime they change
|
||||
// the racial types are zero based, use 1 based to ensure the variable is set
|
||||
int nRace = GetLocalInt(oCreature,"RACIAL_TYPE");
|
||||
if (nRace)
|
||||
return (nRace-1);
|
||||
return GetRacialType(oCreature);
|
||||
}
|
||||
736
_removed/jx_prestige_inc.nss
Normal file
736
_removed/jx_prestige_inc.nss
Normal file
@@ -0,0 +1,736 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//::// Jyro X's Prestige Inlude
|
||||
//::// JX_PRESTIGE_INC.nss
|
||||
//::// Copyright <20> 2001 Bioware Corp.
|
||||
//::// Copyright <20> 2003 Cory Lindsey
|
||||
//::// Version 1.62 (HotU UPDATED)
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Below is the description and instructions.
|
||||
Just give credit where credit is due please.
|
||||
!!!PLEASE READ INSTRUCTIONS BELOW!!!
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
//////////////////////////////
|
||||
///!!!NOTE TO ALL USERS:!!!///
|
||||
//////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Yes. I know many have used these functions and found many bugs.
|
||||
Luckily, I have implemented new, inline, speed-enhancing
|
||||
scripting methods to make the code work perfectly. There are now
|
||||
NO errors, no unhandled exceptions or anything if the functions
|
||||
are used correctly. Note: This include does not require any
|
||||
haks or overrides. It is built to use the BioWare-implemented
|
||||
2da's. So therefore, you need not to put anything into an
|
||||
override folder on the server for your module. All you need
|
||||
is this file and a decent scripter. If you have any questions
|
||||
or complaints, you may reach me at the following email address:
|
||||
|
||||
cory@skyhop.com
|
||||
|
||||
Thank you,
|
||||
Jyro X
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
This is an include file used for various operations
|
||||
concerning Prestige Classes available with SoU(Shadows
|
||||
of Undrentide, Copyright <20> BioWare Corp.) and HotU(Hordes
|
||||
of the Underdark, Copyright <20> BioWare Corp.). List of
|
||||
available functions:
|
||||
|
||||
JXDestroyPrestige
|
||||
JXRebuildPrestige
|
||||
RestrictAllPrestigeClasses
|
||||
RestrictPrestigeClass
|
||||
GetAbleToLevelPrestigeClass
|
||||
|
||||
In order to use these functions in any script you create,
|
||||
at the top of your script before you type anything else,
|
||||
type:
|
||||
|
||||
#include "jx_prestige_inc"
|
||||
|
||||
and click the little computer symbol in the upper-left
|
||||
hand corner. The custom functions will show up in bold
|
||||
black in the "Functions" list in your editor.
|
||||
In order for the persistency to work!!!:
|
||||
|
||||
Put the following line of code into your OnClientEnter:
|
||||
JXRebuildPrestige(oPC);
|
||||
|
||||
You must first however, define oPC with something like:
|
||||
object oPC = GetEnteringObject();
|
||||
|
||||
Those steps will make the persistency work.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Cory Lindsey (a.k.a. Jyro X)
|
||||
//:: Created On: 9/11/03
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//!!!Custom constants!!! !!!DO NOT EDIT!!!:
|
||||
const string JX_PRES_DB = "JX_PRESTIGE_DATABASE";
|
||||
const string ARCANE_ARCHER = "X1_AllowArcher";
|
||||
const string ASSASSIN = "X1_AllowAsasin";
|
||||
const string BLACKGUARD = "X1_AllowBlkGrd";
|
||||
const string CHAMP_TORM = "X2_AllowDivcha";
|
||||
const string DRAG_DISC = "X1_AllowDrDis";
|
||||
const string DWARF_DEF = "X1_AllowDwDef";
|
||||
const string HARPER_SCOUT = "X1_AllowHarper";
|
||||
const string PALE_MASTER = "X2_AllowPalema";
|
||||
const string SHADOW_DANCER = "X1_AllowShadow";
|
||||
const string SHIFT = "X2_AllowShiftr";
|
||||
const string WPN_MASTER = "X2_AllowWM";
|
||||
//End constants...
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!BEGIN PRESTIGE FUNCTIONS!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//Use this in your OnClientEnter.
|
||||
//It rebuilds the prestige resctrictions on oPC.
|
||||
void JXRebuildPrestige(object oPC);
|
||||
|
||||
//Cleans the JX Database, therefore starting everyone on a clean slate.
|
||||
void JXDestroyPrestige();
|
||||
|
||||
//Ordinary: Use this in the OnEnter event handler of your module.
|
||||
//- oPC: The PC in question.
|
||||
//- bAllow: Allow or disallow.
|
||||
//
|
||||
// TRUE = Restricts the classes.
|
||||
// FALSE = Un-restricts the classes.
|
||||
//
|
||||
//- bPermanent: Saves to database, therefore restricting permanently until removed.
|
||||
//
|
||||
// TRUE = Restricts even through server restart.
|
||||
// FALSE = Restricts only until PC leaves and re-enters.
|
||||
//
|
||||
//- bSendMessage: Sends a message to the PC letting them know all prestige classes have been restricted or un-restricted.
|
||||
//
|
||||
// TRUE = Sends the message.
|
||||
// FALSE = Does NOT send the message
|
||||
//
|
||||
//- bOverride: Whether or not it will be restricted if the PC already has a level in said class.
|
||||
//
|
||||
// TRUE = Overrides even if they have the class.
|
||||
// FALSE = Does not override if the PC has a level in the class.
|
||||
//
|
||||
//Function: Restricts prestige classes until the PC earns it.
|
||||
void RestrictAllPrestigeClasses(object oPC, int bAllow=FALSE, int bPermanent=FALSE, int bSendMessage=TRUE, int bOverride = FALSE);
|
||||
|
||||
//Ordinary: Use this in the OnEnter event handler of your module.
|
||||
//- oPC: The PC in question.
|
||||
//- nClassType: The class you want to restrict(Must be prestige).
|
||||
//- bAllow: Allow or disallow.
|
||||
//
|
||||
// TRUE = Restricts the class.
|
||||
// FALSE = Un-restricts the class.
|
||||
//
|
||||
//- bPermanent: Saves to database, therefore restricting permanently until removed.
|
||||
//
|
||||
// TRUE = Restricts even through server restart.
|
||||
// FALSE = Restricts only until PC leaves and re-enters.
|
||||
//
|
||||
//- bSendMessage: Sends a message to the PC letting them know the class has been restricted or un-restricted.
|
||||
//
|
||||
// TRUE = Sends the message.
|
||||
// FALSE = Does NOT send the message
|
||||
//
|
||||
//- bOverride: Whether or not it will be restricted if the PC already has a level in said class.
|
||||
//
|
||||
// TRUE = Overrides even if they have the class.
|
||||
// FALSE = Does not override if the PC has a level in the class.
|
||||
//
|
||||
//Function: Restricts prestige class until the PC earns it.
|
||||
void RestrictPrestigeClass(object oPC, int nClassType, int bAllow=FALSE, int bPermanent=FALSE, int bSendMessage=TRUE, int bOverride = FALSE);
|
||||
|
||||
//Use this to check if the PC is able to take a level in the supplied
|
||||
//prestigeous class.
|
||||
//-oPC: PC to check.
|
||||
//-nClassType: Class to check for.
|
||||
//Function: Checks to see if the PC can level up as an nClassType(Must be prestige).
|
||||
//Usually used in text appears when situations.
|
||||
//Example Syntax: if(GetAbleToLevelPrestigeClass(oPC, CLASS_TYPE_*) == TRUE){return TRUE;}
|
||||
int GetAbleToLevelPrestigeClass(object oPC, int nClassType);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////METHODs USED WITHIN THE CODE - DISREGARD!////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
string ClassToStringInt(int nClass)
|
||||
{
|
||||
string sResult="";
|
||||
|
||||
switch(nClass)
|
||||
{
|
||||
case CLASS_TYPE_ARCANE_ARCHER:
|
||||
sResult=ARCANE_ARCHER;
|
||||
break;
|
||||
case CLASS_TYPE_ASSASSIN:
|
||||
sResult=ASSASSIN;
|
||||
break;
|
||||
case CLASS_TYPE_BLACKGUARD:
|
||||
sResult=BLACKGUARD;
|
||||
break;
|
||||
case CLASS_TYPE_DIVINECHAMPION:
|
||||
sResult=CHAMP_TORM;
|
||||
break;
|
||||
case CLASS_TYPE_DRAGONDISCIPLE:
|
||||
sResult=DRAG_DISC;
|
||||
break;
|
||||
case CLASS_TYPE_DWARVENDEFENDER:
|
||||
sResult=DWARF_DEF;
|
||||
break;
|
||||
case CLASS_TYPE_HARPER:
|
||||
sResult=HARPER_SCOUT;
|
||||
break;
|
||||
case CLASS_TYPE_PALEMASTER:
|
||||
sResult=PALE_MASTER;
|
||||
break;
|
||||
case CLASS_TYPE_SHIFTER:
|
||||
sResult=SHIFT;
|
||||
break;
|
||||
case CLASS_TYPE_SHADOWDANCER:
|
||||
sResult=SHADOW_DANCER;
|
||||
break;
|
||||
case CLASS_TYPE_WEAPON_MASTER:
|
||||
sResult=WPN_MASTER;
|
||||
break;
|
||||
}
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
string ConvertClassType(int nClassType)
|
||||
{
|
||||
string class="";
|
||||
|
||||
switch(nClassType)
|
||||
{
|
||||
case CLASS_TYPE_ARCANE_ARCHER:
|
||||
class="Arcane Archer";
|
||||
break;
|
||||
case CLASS_TYPE_ASSASSIN:
|
||||
class="Assassin";
|
||||
break;
|
||||
case CLASS_TYPE_BLACKGUARD:
|
||||
class="Blackgaurd";
|
||||
break;
|
||||
case CLASS_TYPE_DIVINECHAMPION:
|
||||
class="Champion of Torm";
|
||||
break;
|
||||
case CLASS_TYPE_DRAGONDISCIPLE:
|
||||
class="Dragon Disciple";
|
||||
break;
|
||||
case CLASS_TYPE_DWARVENDEFENDER:
|
||||
class="Dwarven Defender";
|
||||
break;
|
||||
case CLASS_TYPE_HARPER:
|
||||
class="Harper Scout";
|
||||
break;
|
||||
case CLASS_TYPE_PALEMASTER:
|
||||
class="Pale Master";
|
||||
break;
|
||||
case CLASS_TYPE_SHADOWDANCER:
|
||||
class="Shadow Dancer";
|
||||
break;
|
||||
case CLASS_TYPE_SHIFTER:
|
||||
class="Shifter";
|
||||
break;
|
||||
case CLASS_TYPE_WEAPON_MASTER:
|
||||
class="Weapon Master";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return class;
|
||||
}
|
||||
int GetHasSpellCasting(int nLevel, object oPC)
|
||||
{
|
||||
int nTotal;
|
||||
nTotal = GetLevelByClass(CLASS_TYPE_BARD,oPC)+
|
||||
GetLevelByClass(CLASS_TYPE_WIZARD)+
|
||||
GetLevelByClass(CLASS_TYPE_SORCERER,oPC);
|
||||
if(nTotal>=nLevel)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int GetHasAlternateForm(object oPC)
|
||||
{
|
||||
if(GetHasFeat(FEAT_ELEMENTAL_SHAPE, oPC) ||
|
||||
GetHasFeat(FEAT_EPIC_WILD_SHAPE_DRAGON, oPC) ||
|
||||
GetHasFeat(FEAT_EPIC_WILD_SHAPE_UNDEAD, oPC) ||
|
||||
GetHasFeat(FEAT_GREATER_WILDSHAPE_1, oPC) ||
|
||||
GetHasFeat(FEAT_GREATER_WILDSHAPE_2, oPC) ||
|
||||
GetHasFeat(FEAT_GREATER_WILDSHAPE_3, oPC) ||
|
||||
GetHasFeat(FEAT_GREATER_WILDSHAPE_4, oPC) ||
|
||||
GetHasFeat(FEAT_WILD_SHAPE, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int GetHasMeleeWeaponFocus(object oPC)
|
||||
{
|
||||
if(GetHasFeat(FEAT_WEAPON_FOCUS_BASTARD_SWORD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_BATTLE_AXE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_CLUB, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_DIRE_MACE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_DOUBLE_AXE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_DWAXE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_AXE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_SWORD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_HALBERD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_HAND_AXE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_FLAIL, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_KAMA, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_KATANA, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_KUKRI, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_FLAIL, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_HAMMER, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_MACE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_LONG_SWORD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_MORNING_STAR, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_RAPIER, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SCIMITAR, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SCYTHE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SHORT_SWORD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SICKLE, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SPEAR, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_WAR_HAMMER, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void JXDestroyPrestige()
|
||||
{
|
||||
DestroyCampaignDatabase(JX_PRES_DB);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void JXRebuildPrestige(object oPC)
|
||||
{
|
||||
if(!GetIsObjectValid(oPC))
|
||||
return;
|
||||
|
||||
int nArcane = GetCampaignInt(JX_PRES_DB, ARCANE_ARCHER, oPC);
|
||||
int nAssassin = GetCampaignInt(JX_PRES_DB, ASSASSIN, oPC);
|
||||
int nBlackgaurd = GetCampaignInt(JX_PRES_DB, BLACKGUARD, oPC);
|
||||
int nChampion = GetCampaignInt(JX_PRES_DB, CHAMP_TORM, oPC);
|
||||
int nDrag = GetCampaignInt(JX_PRES_DB, DRAG_DISC, oPC);
|
||||
int nDwarf = GetCampaignInt(JX_PRES_DB, DWARF_DEF, oPC);
|
||||
int nHarper = GetCampaignInt(JX_PRES_DB, HARPER_SCOUT, oPC);
|
||||
int nPale = GetCampaignInt(JX_PRES_DB, PALE_MASTER, oPC);
|
||||
int nShadow = GetCampaignInt(JX_PRES_DB, SHADOW_DANCER, oPC);
|
||||
int nShift = GetCampaignInt(JX_PRES_DB, SHIFT, oPC);
|
||||
int nWpnMstr = GetCampaignInt(JX_PRES_DB, WPN_MASTER, oPC);
|
||||
|
||||
if(nArcane > 0)
|
||||
SetLocalInt(oPC, ARCANE_ARCHER, 1);
|
||||
|
||||
if(nAssassin > 0)
|
||||
SetLocalInt(oPC, ASSASSIN, 1);
|
||||
|
||||
if(nBlackgaurd > 0)
|
||||
SetLocalInt(oPC, BLACKGUARD, 1);
|
||||
|
||||
if(nChampion > 0)
|
||||
SetLocalInt(oPC, CHAMP_TORM, 1);
|
||||
|
||||
if(nDrag > 0)
|
||||
SetLocalInt(oPC, DRAG_DISC, 1);
|
||||
|
||||
if(nDwarf > 0)
|
||||
SetLocalInt(oPC, DWARF_DEF, 1);
|
||||
|
||||
if(nHarper > 0)
|
||||
SetLocalInt(oPC, HARPER_SCOUT, 1);
|
||||
|
||||
if(nPale > 0)
|
||||
SetLocalInt(oPC, PALE_MASTER, 1);
|
||||
|
||||
if(nShadow > 0)
|
||||
SetLocalInt(oPC, SHADOW_DANCER, 1);
|
||||
|
||||
if(nShift > 0)
|
||||
SetLocalInt(oPC, SHIFT, 1);
|
||||
|
||||
if(nWpnMstr > 0)
|
||||
SetLocalInt(oPC, WPN_MASTER, 1);
|
||||
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////RESTRICTALLPRESTIGECLASSES//////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void RestrictAllPrestigeClasses(object oPC, int bAllow=FALSE, int bPermanent=FALSE, int bSendMessage=TRUE, int bOverride=FALSE)
|
||||
{
|
||||
if(GetIsPC(oPC) && !GetIsDM(oPC)) //allow DM's whatever.
|
||||
{
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_ARCANE_ARCHER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_ASSASSIN, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_BLACKGUARD, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_DIVINECHAMPION, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_DRAGONDISCIPLE, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_DWARVENDEFENDER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_HARPER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_PALEMASTER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_SHADOWDANCER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_SHIFTER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
RestrictPrestigeClass(oPC, CLASS_TYPE_WEAPON_MASTER, bAllow, bPermanent, bSendMessage, bOverride);
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////RESTRICTPRESTIGECLASS/////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void RestrictPrestigeClass(object oPC, int nClassType, int bAllow=FALSE, int bPermanent=FALSE, int bSendMessage=TRUE, int bOverride = FALSE)
|
||||
{
|
||||
if(bAllow == FALSE)
|
||||
{
|
||||
SetLocalInt(oPC, ClassToStringInt(nClassType), 1);
|
||||
|
||||
if(bPermanent == TRUE)
|
||||
SetCampaignInt(JX_PRES_DB, ClassToStringInt(nClassType), 1);
|
||||
|
||||
if(bSendMessage == TRUE)
|
||||
SendMessageToPC(oPC, "<c<01><>>Prestige class "+ConvertClassType(nClassType)+"</c> <c<>>restricted</c><c<01><>>.</c>");
|
||||
|
||||
//Override
|
||||
if(bOverride == FALSE)
|
||||
{
|
||||
if(GetLevelByClass(nClassType, oPC) > 0)
|
||||
{
|
||||
DeleteLocalInt(oPC, ClassToStringInt(nClassType));
|
||||
|
||||
if(GetCampaignInt(JX_PRES_DB, ClassToStringInt(nClassType), oPC) > 0 && bPermanent == TRUE)
|
||||
DeleteCampaignVariable(JX_PRES_DB, ClassToStringInt(nClassType), oPC);
|
||||
|
||||
if(bSendMessage == TRUE)
|
||||
SendMessageToPC(oPC, "<c<01><>>Prestige class "+ConvertClassType(nClassType)+"</c> <c<01>>unrestricted</c> <c<01><>>because you already have at least one level in this class.</c>");
|
||||
}
|
||||
}
|
||||
//End override
|
||||
}
|
||||
|
||||
else if(bAllow == TRUE)
|
||||
{
|
||||
if(GetLocalInt(oPC, ClassToStringInt(nClassType)) > 0)
|
||||
DeleteLocalInt(oPC, ClassToStringInt(nClassType));
|
||||
|
||||
if(GetCampaignInt(JX_PRES_DB, ClassToStringInt(nClassType), oPC) > 0 && bPermanent == TRUE)
|
||||
DeleteCampaignVariable(JX_PRES_DB, ClassToStringInt(nClassType), oPC);
|
||||
|
||||
if(bSendMessage == TRUE)
|
||||
SendMessageToPC(oPC, "<c<01><>>Prestige class "+ConvertClassType(nClassType)+"</c> <c<01>>unrestricted</c><c<01><>>.</c>");
|
||||
}
|
||||
|
||||
else
|
||||
return;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////GETABLETOLEVELPRESITGECLASS/////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int GetAbleToLevelPrestigeClass(object oPC, int nClassType)
|
||||
{
|
||||
switch(nClassType)
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------ARCANE ARCHER---------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_ARCANE_ARCHER:
|
||||
//Check to see if the PC has what it takes to be an arcane archer...
|
||||
if(GetRacialType(oPC) == RACIAL_TYPE_ELF || GetRacialType(oPC) == RACIAL_TYPE_HALFELF)
|
||||
{
|
||||
if(GetBaseAttackBonus(oPC) >= 6)
|
||||
{
|
||||
if(GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW, oPC) ||
|
||||
GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW, oPC))
|
||||
{
|
||||
if(GetHasFeat(FEAT_POINT_BLANK_SHOT, oPC))
|
||||
{
|
||||
if(GetHasSpellCasting(1, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------ASSASSIN-----------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_ASSASSIN:
|
||||
//Check to see if the PC has what it takes to be an assassin...
|
||||
if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
|
||||
{
|
||||
int DexMod = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
|
||||
if((GetSkillRank(SKILL_HIDE, oPC)-DexMod) >= 8 && (GetSkillRank(SKILL_MOVE_SILENTLY, oPC)-DexMod) >= 8)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//--------------------------------BLACKGUARD----------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_BLACKGUARD:
|
||||
//Check to see if the PC has what it takes to be a blackgaurd...
|
||||
if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
|
||||
{
|
||||
if(GetBaseAttackBonus(oPC) >= 6)
|
||||
{
|
||||
int DexMod = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
|
||||
if((GetSkillRank(SKILL_HIDE, oPC)-DexMod) >= 5)
|
||||
{
|
||||
if(GetHasFeat(FEAT_CLEAVE, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------CHAMPION OF TORM-----------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_DIVINECHAMPION:
|
||||
if(GetAlignmentGoodEvil(oPC)!=ALIGNMENT_EVIL)
|
||||
{
|
||||
if(GetHasMeleeWeaponFocus(oPC))
|
||||
{
|
||||
if(GetBaseAttackBonus(oPC)>=7)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------DRAGON DISCIPLE------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_DRAGONDISCIPLE:
|
||||
if(GetLevelByClass(CLASS_TYPE_BARD, oPC)>=1 || GetLevelByClass(CLASS_TYPE_SORCERER, oPC)>=1)
|
||||
{
|
||||
int IntMod = GetAbilityModifier(ABILITY_INTELLIGENCE, oPC);
|
||||
if((GetSkillRank(SKILL_LORE, oPC)-IntMod)>=8)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------DWARVEN DEFENDER-----------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_DWARVENDEFENDER:
|
||||
if(GetRacialType(oPC)==RACIAL_TYPE_DWARF)
|
||||
{
|
||||
if(GetBaseAttackBonus(oPC)>=7)
|
||||
{
|
||||
if(GetHasFeat(FEAT_DODGE,oPC) && GetHasFeat(FEAT_TOUGHNESS,oPC))
|
||||
{
|
||||
if(GetAlignmentLawChaos(oPC)==ALIGNMENT_LAWFUL)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------HARPER SCOUT---------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_HARPER:
|
||||
//Check to see if the PC has what it takes to be a Harper Scout...
|
||||
if(GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD ||
|
||||
GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL)
|
||||
{
|
||||
if(GetHasFeat(FEAT_ALERTNESS, oPC) && GetHasFeat(FEAT_IRON_WILL, oPC))
|
||||
{
|
||||
int StrMod = GetAbilityModifier(ABILITY_STRENGTH, oPC);
|
||||
int IntMod = GetAbilityModifier(ABILITY_INTELLIGENCE, oPC);
|
||||
int ChaMod = GetAbilityModifier(ABILITY_CHARISMA, oPC);
|
||||
if((GetSkillRank(SKILL_SEARCH, oPC)-IntMod) >= 4 && (GetSkillRank(SKILL_PERSUADE, oPC)-ChaMod) >= 8 && (GetSkillRank(SKILL_LORE, oPC)-IntMod) >= 6 && (GetSkillRank(SKILL_DISCIPLINE, oPC)-StrMod) >= 4)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//--------------------------------PALE MASTER---------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_PALEMASTER:
|
||||
if(GetAlignmentGoodEvil(oPC)!=ALIGNMENT_GOOD)
|
||||
{
|
||||
if(GetHasSpellCasting(3, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------SHADOW DANCER--------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_SHADOWDANCER:
|
||||
//Check to see if the PC has what it takes to be a shadow dancer...
|
||||
if(GetHasFeat(FEAT_DODGE, oPC) && GetHasFeat(FEAT_MOBILITY, oPC))
|
||||
{
|
||||
int DexMod = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
|
||||
if((GetSkillRank(SKILL_HIDE, oPC)-DexMod) >= 10 && (GetSkillRank(SKILL_MOVE_SILENTLY, oPC)-DexMod) >= 8 && (GetSkillRank(SKILL_TUMBLE, oPC)-DexMod) >= 5)
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------SHIFTER------------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_SHIFTER:
|
||||
if(GetHasFeat(FEAT_ALERTNESS, oPC))
|
||||
{
|
||||
if(GetAbilityScore(oPC, ABILITY_WISDOM)>=13)
|
||||
{
|
||||
if(GetHasAlternateForm(oPC))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------WEAPON MASTER---------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
case CLASS_TYPE_WEAPON_MASTER:
|
||||
if(GetBaseAttackBonus(oPC)>=5)
|
||||
{
|
||||
int ChaMod = GetAbilityModifier(ABILITY_CHARISMA, oPC);
|
||||
if((GetSkillRank(SKILL_INTIMIDATE, oPC)-ChaMod)>=4)
|
||||
{
|
||||
if(GetHasMeleeWeaponFocus(oPC))
|
||||
{
|
||||
if(GetHasFeat(FEAT_DODGE, oPC) &&
|
||||
GetHasFeat(FEAT_MOBILITY, oPC) &&
|
||||
GetHasFeat(FEAT_EXPERTISE, oPC) &&
|
||||
GetHasFeat(FEAT_SPRING_ATTACK, oPC) &&
|
||||
GetHasFeat(FEAT_WHIRLWIND_ATTACK, oPC))
|
||||
return TRUE;
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//----------------------------------------------------------------------------//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
default:
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
//End GetAbleToLevelPrestigeClass
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!!END PRESTIGE FUNCTIONS!!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
21
_removed/mh_art_act1.nss
Normal file
21
_removed/mh_art_act1.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: mh_art_act1
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates the Light Wound Potion.
|
||||
Take the gold and experience.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
CreateItemOnObject("NW_IT_MPOTION001", GetPCSpeaker());
|
||||
TakeGoldFromCreature(10, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 1);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetPCSpeaker());
|
||||
|
||||
}
|
||||
22
_removed/mh_art_act2.nss
Normal file
22
_removed/mh_art_act2.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: mh_art_act2
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates the Antidote.
|
||||
Take the gold and experience.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
CreateItemOnObject("NW_IT_MPOTION006", GetPCSpeaker());
|
||||
TakeGoldFromCreature(150, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 12);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetPCSpeaker());
|
||||
|
||||
}
|
||||
22
_removed/mh_art_act3.nss
Normal file
22
_removed/mh_art_act3.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: mh_art_act3
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creates the Clarity Potion.
|
||||
Take the gold and experience.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
CreateItemOnObject("NW_IT_MPOTION007", GetPCSpeaker());
|
||||
TakeGoldFromCreature(60, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 5);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetPCSpeaker());
|
||||
|
||||
}
|
||||
20
_removed/mh_art_test1.nss
Normal file
20
_removed/mh_art_test1.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: mh_con_test1
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Checks to see if you have enough gold
|
||||
to create the potion (Soin Leger).
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By:
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 10 && plotCanRemoveXP(GetPCSpeaker(), 1) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
20
_removed/mh_art_test2.nss
Normal file
20
_removed/mh_art_test2.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: mh_con_test2
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Checks to see if you have enough gold
|
||||
to create the potion.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By:
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 150 && plotCanRemoveXP(GetPCSpeaker(), 12) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
26
_removed/mh_at_001.nss
Normal file
26
_removed/mh_at_001.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName mh_at_001
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 11/02/2004 15:33:49
|
||||
//:://////////////////////////////////////////////
|
||||
#include "mh_instr_inc"
|
||||
void main()
|
||||
{
|
||||
// Donner les objets <20> la personne qui parle
|
||||
|
||||
object oSpeaker = GetPCSpeaker();
|
||||
object oItem = CreateItemOnObject("mh_it_harp", oSpeaker, 1);
|
||||
SetIdentified(oItem,TRUE);
|
||||
SetLocalObject(oItem, "mh_createur", oSpeaker);
|
||||
SetLocalInt(oItem,"cout_instrument",50000);
|
||||
//ExecuteScript("mh_ins_sp_script", oSpeaker);
|
||||
TakeGoldFromCreature(25000, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 2000);
|
||||
if(!GetLocalInt(oSpeaker,"use_CIMM"))
|
||||
{
|
||||
ActiveModeCIMM(oSpeaker);
|
||||
}
|
||||
|
||||
}
|
||||
24
_removed/mh_at_002.nss
Normal file
24
_removed/mh_at_002.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName mh_at_002
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 11/02/2004 15:33:49
|
||||
//:://////////////////////////////////////////////
|
||||
#include "mh_instr_inc"
|
||||
void main()
|
||||
{
|
||||
// Donner les objets <20> la personne qui parle
|
||||
object oSpeaker = GetPCSpeaker();
|
||||
object oItem = CreateItemOnObject("mh_it_luth", oSpeaker, 1);
|
||||
SetIdentified(oItem,TRUE);
|
||||
SetLocalObject(oItem, "mh_createur", oSpeaker);
|
||||
SetLocalInt(oItem,"cout_instrument",15000);
|
||||
//ExecuteScript("mh_ins_sp_script", oSpeaker);
|
||||
TakeGoldFromCreature(7500, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 600);
|
||||
if(!GetLocalInt(oSpeaker,"use_CIMM"))
|
||||
{
|
||||
ActiveModeCIMM(oSpeaker);
|
||||
}
|
||||
}
|
||||
24
_removed/mh_at_003.nss
Normal file
24
_removed/mh_at_003.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName mh_at_003
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 11/02/2004 15:33:49
|
||||
//:://////////////////////////////////////////////
|
||||
#include "mh_instr_inc"
|
||||
void main()
|
||||
{
|
||||
// Donner les objets <20> la personne qui parle
|
||||
object oSpeaker = GetPCSpeaker();
|
||||
object oItem = CreateItemOnObject("mh_it_flute", oSpeaker, 1);
|
||||
SetIdentified(oItem,TRUE);
|
||||
SetLocalObject(oItem, "mh_createur", oSpeaker);
|
||||
SetLocalInt(oItem,"cout_instrument",5000);
|
||||
//ExecuteScript("mh_ins_sp_script", oSpeaker);
|
||||
TakeGoldFromCreature(2500, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 200);
|
||||
if(!GetLocalInt(oSpeaker,"use_CIMM"))
|
||||
{
|
||||
ActiveModeCIMM(oSpeaker);
|
||||
}
|
||||
}
|
||||
24
_removed/mh_at_004.nss
Normal file
24
_removed/mh_at_004.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName mh_at_004
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 11/02/2004 15:33:49
|
||||
//:://////////////////////////////////////////////
|
||||
#include "mh_instr_inc"
|
||||
void main()
|
||||
{
|
||||
// Donner les objets <20> la personne qui parle
|
||||
object oSpeaker = GetPCSpeaker();
|
||||
object oItem = CreateItemOnObject("mh_it_cor", oSpeaker, 1);
|
||||
SetIdentified(oItem,TRUE);
|
||||
SetLocalObject(oItem, "mh_createur", oSpeaker);
|
||||
SetLocalInt(oItem,"cout_instrument",500);
|
||||
//ExecuteScript("mh_ins_sp_script", oSpeaker);
|
||||
TakeGoldFromCreature(250, GetPCSpeaker(), TRUE);
|
||||
SetXP(GetPCSpeaker(), GetXP(GetPCSpeaker()) - 20);
|
||||
if(!GetLocalInt(oSpeaker,"use_CIMM"))
|
||||
{
|
||||
ActiveModeCIMM(oSpeaker);
|
||||
}
|
||||
}
|
||||
9
_removed/mh_cancreateinst.nss
Normal file
9
_removed/mh_cancreateinst.nss
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "mh_constante"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
int iResult;
|
||||
|
||||
iResult = GetHasFeat(FEAT_INSTRUMENT,GetPCSpeaker());
|
||||
return iResult;
|
||||
}
|
||||
12
_removed/mh_constante.nss
Normal file
12
_removed/mh_constante.nss
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
const int CLASS_TYPE_MASTERH = 111;
|
||||
|
||||
const int SPELLABILITY_AURA_LLIIRA = 1509;
|
||||
const int SPELLABILITY_LYCANBANE = 1507;
|
||||
const int SPELLABILITY_MIELIKKI = 1508;
|
||||
|
||||
const int FEAT_LYCANBANE = 2404 ;
|
||||
const int FEAT_DENEIRS_OREL = 2408 ;
|
||||
const int FEAT_MILILS_EAR = 2406 ;
|
||||
const int FEAT_INSTRUMENT = 2409;
|
||||
const int FEAT_MIELIKKI = 2405;
|
||||
7
_removed/mh_ins_test1.nss
Normal file
7
_removed/mh_ins_test1.nss
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 25000 && plotCanRemoveXP(GetPCSpeaker(), 2000) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
7
_removed/mh_ins_test2.nss
Normal file
7
_removed/mh_ins_test2.nss
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 7500 && plotCanRemoveXP(GetPCSpeaker(), 600) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
7
_removed/mh_ins_test3.nss
Normal file
7
_removed/mh_ins_test3.nss
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 2500 && plotCanRemoveXP(GetPCSpeaker(), 200) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
7
_removed/mh_ins_test4.nss
Normal file
7
_removed/mh_ins_test4.nss
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "nw_i0_plot"
|
||||
int StartingConditional()
|
||||
{
|
||||
if ( GetGold(GetPCSpeaker()) >= 250 && plotCanRemoveXP(GetPCSpeaker(), 20) == TRUE )
|
||||
return TRUE ;
|
||||
return FALSE;
|
||||
}
|
||||
36
_removed/mh_instr_inc.nss
Normal file
36
_removed/mh_instr_inc.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "mh_constante"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
|
||||
void ActiveModeCIMM(object oTarget)
|
||||
{
|
||||
if(!GetLocalInt(oTarget,"use_CIMM") )
|
||||
{
|
||||
string sScript = GetModuleOverrideSpellscript();
|
||||
if (sScript != "mh_spell_at_inst")
|
||||
{
|
||||
SetLocalString(GetModule(),"temp_spell_at_inst",sScript);
|
||||
SetModuleOverrideSpellscript("mh_spell_at_inst");
|
||||
}
|
||||
SetLocalInt(GetModule(),"nb_spell_at_inst",GetLocalInt(GetModule(),"nb_spell_at_inst")+1);
|
||||
FloatingTextStrRefOnCreature(16780240,oTarget);
|
||||
SetLocalInt(oTarget,"use_CIMM",TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void UnactiveModeCIMM(object oTarget)
|
||||
{
|
||||
if(GetLocalInt(oTarget,"use_CIMM") )
|
||||
{
|
||||
string sScript = GetModuleOverrideSpellscript();
|
||||
SetLocalInt(GetModule(),"nb_spell_at_inst",GetLocalInt(GetModule(),"nb_spell_at_inst")-1);
|
||||
if (sScript == "mh_spell_at_inst" && GetLocalInt(GetModule(),"nb_spell_at_inst") == 0)
|
||||
{
|
||||
SetModuleOverrideSpellscript(GetLocalString(GetModule(),"temp_spell_at_inst"));
|
||||
GetLocalString(GetModule(),"temp_spell_at_inst");
|
||||
SetLocalString(GetModule(),"temp_spell_at_inst","");
|
||||
}
|
||||
FloatingTextStrRefOnCreature(16780241,oTarget);
|
||||
SetLocalInt(oTarget,"use_CIMM",FALSE);
|
||||
}
|
||||
}
|
||||
30
_removed/mh_s1_lliira_ent.nss
Normal file
30
_removed/mh_s1_lliira_ent.nss
Normal file
@@ -0,0 +1,30 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Lliira' Aura: On Enter
|
||||
//:: NW_S1_lliira_ent.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
gere l'entr dans la zone d'effet.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On:January 2004
|
||||
//:://////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
//Declare major variables
|
||||
effect eProt = EffectSavingThrowIncrease(SAVING_THROW_ALL,4,SAVING_THROW_TYPE_FEAR);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE);
|
||||
effect eLink = EffectLinkEffects(eProt, eDur);
|
||||
|
||||
object oTarget = GetEnteringObject();
|
||||
//Faction Check
|
||||
if(GetIsFriend(oTarget, GetAreaOfEffectCreator()))
|
||||
{
|
||||
//SetLocalInt(oTarget, "Lliira" , 1);
|
||||
//Apply the VFX impact and effects
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget );
|
||||
}
|
||||
}
|
||||
24
_removed/mh_s1_lliira_sor.nss
Normal file
24
_removed/mh_s1_lliira_sor.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Lliira' Aura: On Exit
|
||||
//:: NW_S1_lliira_sor.ns
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Gere la sortie de la zone d'effet.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On:January , 2004
|
||||
//:://////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "mh_constante"
|
||||
|
||||
void main()
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
object oTarget = GetExitingObject();
|
||||
int test = SPELLABILITY_AURA_LLIIRA;
|
||||
int eRemove = GetEffectSpellId(GetFirstEffect(oTarget));
|
||||
//if (GetLocalInt(oTarget, "Lliira") == 1);
|
||||
//ApplyEffectToObject(DURATION_TYPE_PERMANENT
|
||||
RemoveSpellEffects(SPELLABILITY_AURA_LLIIRA, GetAreaOfEffectCreator(), GetExitingObject());
|
||||
}
|
||||
26
_removed/mh_s1_lliiraaura.nss
Normal file
26
_removed/mh_s1_lliiraaura.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Lliiras' Aura
|
||||
//:: mh_S1_LliiraAura.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Cree une zone d'effet conferant un bonus de +4
|
||||
au jet de sauvegarde contre la peur pour une duree
|
||||
de 5 tours
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On: January, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
//Declare major variables including Area of Effect Object
|
||||
effect eAOE = EffectAreaOfEffect(37,"mh_s1_lliira_ent","","mh_s1_lliira_sor");
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_AURA_HOLY);
|
||||
effect eLink = EffectLinkEffects(eAOE,eVis);
|
||||
int nDuration = 5;
|
||||
//Create an instance of the AOE Object using the Apply Effect function
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, TurnsToSeconds(nDuration));
|
||||
}
|
||||
16
_removed/mh_s2_instrument.nss
Normal file
16
_removed/mh_s2_instrument.nss
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "x2_inc_craft"
|
||||
#include "mh_instr_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oCaster = GetLastSpellCaster();
|
||||
|
||||
if(GetLocalInt(oCaster,"use_CIMM"))
|
||||
{
|
||||
UnactiveModeCIMM(oCaster);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActiveModeCIMM(oCaster);
|
||||
}
|
||||
}
|
||||
27
_removed/mh_s2_lycanbane.nss
Normal file
27
_removed/mh_s2_lycanbane.nss
Normal file
@@ -0,0 +1,27 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Lycanbane
|
||||
//:: NW_S2_Lycanbane.nss
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Le maitre menesrel transmet sa protection contre
|
||||
les metamorphe pendant 1 minute.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On: Jan 23, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "mh_constante"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
effect eVisual = EffectVisualEffect(VFX_IMP_AC_BONUS);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual, oTarget);
|
||||
effect eACBonus = VersusRacialTypeEffect(EffectACIncrease(5), RACIAL_TYPE_SHAPECHANGER);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eACBonus, oTarget, 60.0);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_LYCANBANE, FALSE));
|
||||
}
|
||||
10
_removed/mh_s2_mharpitem.nss
Normal file
10
_removed/mh_s2_mharpitem.nss
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "nw_i0_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, 479, FALSE));
|
||||
ActionStartConversation(OBJECT_SELF, "mh_art_dialog", FALSE, FALSE);
|
||||
|
||||
}
|
||||
158
_removed/mh_s2_mielikki.nss
Normal file
158
_removed/mh_s2_mielikki.nss
Normal file
@@ -0,0 +1,158 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name mh_s2_mielikki
|
||||
//:: FileName mh_s2_mielikki
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Don verite de Mielikki
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On: 23 janvier 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "X0_I0_SPELLS"
|
||||
#include "mh_constante"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
string str;
|
||||
if(GetRacialType(oTarget) != RACIAL_TYPE_ANIMAL)
|
||||
{
|
||||
FloatingTextStrRefOnCreature(16780237,OBJECT_SELF,TRUE);
|
||||
IncrementRemainingFeatUses(OBJECT_SELF,FEAT_MIELIKKI);
|
||||
//FloatingTextStringOnCreature("Vous devez cibler une cible animale",OBJECT_SELF,TRUE);
|
||||
return;
|
||||
}
|
||||
if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF ))
|
||||
{
|
||||
object oMaster = GetMaster(oTarget);
|
||||
if(GetIsObjectValid(oMaster))
|
||||
{
|
||||
if( GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster) == oTarget )
|
||||
{
|
||||
//on revoque ici la creature avec un message
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON);
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_MIELIKKI));
|
||||
//Determine correct save
|
||||
int nSpellDC = 15;
|
||||
//Make SR and will save checks
|
||||
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nSpellDC))
|
||||
{
|
||||
//Apply the VFX and delay the destruction of the summoned monster so
|
||||
//that the script and VFX can play.
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
DestroyObject(oTarget, 0.5);
|
||||
}
|
||||
//str = GetName(oTarget) + " est une creature invoquee par " + GetName(oMaster);
|
||||
//FloatingTextStringOnCreature(str,OBJECT_SELF,TRUE);
|
||||
return ;
|
||||
}
|
||||
/*
|
||||
else if( GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oMaster) == oTarget )
|
||||
{
|
||||
str = GetName(oTarget) + " est le familier de " + GetName(oMaster);
|
||||
FloatingTextStringOnCreature(str,OBJECT_SELF,TRUE);
|
||||
// indique si il s'agit d'un familier ou d'un compagnon animal,
|
||||
// ou eventuellement d'un compagnon
|
||||
}
|
||||
else if( GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oMaster) == oTarget )
|
||||
{
|
||||
str = GetName(oTarget) + " est le compagnion animal de " + GetName(oMaster);
|
||||
FloatingTextStringOnCreature(str,OBJECT_SELF,TRUE);
|
||||
}
|
||||
else if( GetAssociate(ASSOCIATE_TYPE_DOMINATED, oMaster) == oTarget )
|
||||
{
|
||||
str = GetName(oTarget) + " est une creature dominee par " + GetName(oMaster);
|
||||
FloatingTextStringOnCreature(str,OBJECT_SELF,TRUE);
|
||||
}*/
|
||||
}
|
||||
else if(GetHasEffect(EFFECT_TYPE_POLYMORPH,oTarget) )
|
||||
{
|
||||
//on annule l'effet de polymorphie
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON);
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_MIELIKKI));
|
||||
//Determine correct save
|
||||
int nSpellDC = 15;
|
||||
//Make SR and will save checks
|
||||
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nSpellDC))
|
||||
{
|
||||
//Apply the VFX and delay the destruction of the summoned monster so
|
||||
//that the script and VFX can play.
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
effect eTest = GetFirstEffect(oTarget);
|
||||
while(GetEffectType(eTest) != EFFECT_TYPE_POLYMORPH)
|
||||
{
|
||||
eTest = GetNextEffect(oTarget);
|
||||
}
|
||||
RemoveEffect(oTarget,eTest);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//enleve tout les effets positifs
|
||||
effect eVisual = EffectVisualEffect(VFX_IMP_HEAD_ODD);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_MIELIKKI));
|
||||
int nSpellDC = 15;
|
||||
//Make SR and will save checks
|
||||
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nSpellDC))
|
||||
{
|
||||
effect eGood = GetFirstEffect(oTarget);
|
||||
//Search for negative effects
|
||||
while(GetIsEffectValid(eGood))
|
||||
{
|
||||
if (GetEffectType(eGood) == EFFECT_TYPE_ABILITY_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_AC_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_ATTACK_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_DAMAGE_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_SAVING_THROW_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_SPELL_RESISTANCE_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_SKILL_INCREASE ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_CONCEALMENT ||
|
||||
GetEffectType(eGood) == EFFECT_TYPE_DAMAGE_RESISTANCE)
|
||||
{
|
||||
//Remove effect if it is negative.
|
||||
RemoveEffect(oTarget, eGood);
|
||||
}
|
||||
eGood = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
|
||||
int bValid;
|
||||
|
||||
effect eBad = GetFirstEffect(oTarget);
|
||||
//Search for negative effects
|
||||
while(GetIsEffectValid(eBad))
|
||||
{
|
||||
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
|
||||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
|
||||
{
|
||||
//Remove effect if it is negative.
|
||||
RemoveEffect(oTarget, eBad);
|
||||
}
|
||||
eBad = GetNextEffect(oTarget);
|
||||
}
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF,SPELLABILITY_MIELIKKI, FALSE));
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
|
||||
}
|
||||
}
|
||||
146
_removed/mh_spell_at_inst.nss
Normal file
146
_removed/mh_spell_at_inst.nss
Normal file
@@ -0,0 +1,146 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name mh_spell_at_ins
|
||||
//:: FileNameCast a spell to any instrument
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
This script is runned when a player is in
|
||||
Cast Spell at Instrument mod
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On: February 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "x2_inc_craft"
|
||||
#include "mh_instr_inc"
|
||||
|
||||
|
||||
void finish(object oTarget,int iDesactive = FALSE)
|
||||
{
|
||||
string sScript = GetLocalString(GetModule(),"temp_spell_at_inst");
|
||||
if (sScript != "")
|
||||
{
|
||||
ExecuteScript(sScript,OBJECT_SELF);
|
||||
}
|
||||
if(iDesactive)
|
||||
{
|
||||
UnactiveModeCIMM(oTarget);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
//define variable
|
||||
object oItem = GetSpellTargetObject();
|
||||
object oCaster = GetLastSpellCaster();
|
||||
|
||||
//if the target is not a instrument or spell cast from item or the caster is not
|
||||
//the creator of the item, or if the caster is not in add spell mod
|
||||
//cast the spell normaly and exit the add spell mod
|
||||
|
||||
if( (GetObjectType(oItem) != OBJECT_TYPE_ITEM) ||
|
||||
( GetTag(oItem) != "MH_IT_LUTH" &&
|
||||
GetTag(oItem) != "MH_IT_HARP" &&
|
||||
GetTag(oItem) != "MH_IT_FLUTE" &&
|
||||
GetTag(oItem) != "MH_IT_COR" ) ||
|
||||
//GetObjectType(GetSpellCastItem()) != OBJECT_TYPE_INVALID ||
|
||||
oCaster != GetLocalObject(oItem, "mh_createur")
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
finish(oCaster,GetLocalInt(oCaster,"use_CIMM"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int iID = GetSpellId();
|
||||
|
||||
int iIPConst = IPGetIPConstCastSpellFromSpellID(iID);
|
||||
|
||||
if (iID == 0 && iIPConst != 0)
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84544,oCaster);
|
||||
finish(oCaster);
|
||||
return;
|
||||
}
|
||||
itemproperty ipC ;
|
||||
float fCharge1 = 0.0f;
|
||||
float fCharge2;
|
||||
int iCost;
|
||||
int iNewCost;
|
||||
|
||||
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_CAST_SPELL))
|
||||
{
|
||||
//detect if the targe has the spell property
|
||||
itemproperty ipTest = GetFirstItemProperty(oItem);
|
||||
while(GetIsItemPropertyValid(ipTest) && (iIPConst != GetItemPropertySubType(ipTest)))
|
||||
{
|
||||
ipTest = GetNextItemProperty(oItem);
|
||||
}
|
||||
|
||||
|
||||
if (iIPConst == GetItemPropertySubType(ipTest) )
|
||||
{
|
||||
iCost = GetItemPropertyCostTableValue(ipTest);
|
||||
if(iCost == IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY)
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY;
|
||||
if(iCost == IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY)
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY;
|
||||
if(iCost == IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY)
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY;
|
||||
if(iCost == IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY)
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY;
|
||||
if(iCost == IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY)
|
||||
{
|
||||
//if the item has max return
|
||||
FloatingTextStrRefOnCreature(16780242,oCaster);
|
||||
finish(oCaster);
|
||||
SetModuleOverrideSpellScriptFinished();
|
||||
return;
|
||||
}
|
||||
RemoveItemProperty(oItem,ipTest);
|
||||
ipC = ItemPropertyCastSpell(iIPConst,iNewCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
iCost = 0;
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY;
|
||||
ipC = ItemPropertyCastSpell(iIPConst,IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iCost = 0;
|
||||
iNewCost = IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY;
|
||||
ipC = ItemPropertyCastSpell(iIPConst,IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY);
|
||||
}
|
||||
|
||||
|
||||
//get the cost of the property
|
||||
|
||||
if(iCost > 0)
|
||||
fCharge1 = StringToFloat(Get2DAString("iprp_chargecost","Cost",iCost));
|
||||
|
||||
fCharge2 = StringToFloat(Get2DAString("iprp_chargecost","Cost",iNewCost));
|
||||
|
||||
int iTotalCost = FloatToInt( (fCharge2 - fCharge1) * StringToFloat(Get2DAString("iprp_spells","Cost",iIPConst)) );
|
||||
int iCostMax = GetLocalInt(oItem,"cout_instrument");
|
||||
// if the cost is too hight return
|
||||
if(iCostMax < iTotalCost)
|
||||
{
|
||||
FloatingTextStrRefOnCreature(16780243,oCaster);
|
||||
finish(oCaster);
|
||||
SetModuleOverrideSpellScriptFinished();
|
||||
return;
|
||||
}
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ipC, oItem);
|
||||
SetLocalInt(oItem,"cout_instrument",iCostMax - iTotalCost);
|
||||
SetModuleOverrideSpellScriptFinished();
|
||||
}
|
||||
83
_removed/mos_summon.nss
Normal file
83
_removed/mos_summon.nss
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Master of Shrouds: Summon Undead (1-4)
|
||||
* 2004/02/15
|
||||
* Brian Greinke
|
||||
* edited to include epic wraith summons 2004/03/04; also removed unnecessary scripting.
|
||||
* Lockindal Linantal
|
||||
*/
|
||||
|
||||
#include "strat_prc_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
string sSummon;
|
||||
effect eSummonB;
|
||||
object oCreature;
|
||||
int nClass = GetLevelByClass(CLASS_TYPE_MASTER_OF_SHROUDS, OBJECT_SELF);
|
||||
|
||||
|
||||
if ( GetHasFeat(FEAT_MOS_UNDEAD_4) )
|
||||
{
|
||||
if(GetLevelByClass(CLASS_TYPE_MASTER_OF_SHROUDS, OBJECT_SELF) >= 11)
|
||||
{
|
||||
switch (nClass)
|
||||
{
|
||||
case 11:
|
||||
sSummon = "summonedgreaterw";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 14:
|
||||
sSummon = "summonedgreat001";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 17:
|
||||
sSummon = "summonedgreat002";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 20:
|
||||
sSummon = "summonedgreat003";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 23:
|
||||
sSummon = "summonedgreat004";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 26:
|
||||
sSummon = "summonedgreat005";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 29:
|
||||
sSummon = "summonedgreat006";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
case 180: //max level for npc
|
||||
sSummon = "summonedgreat006";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sSummon = "prc_mos_spectre2";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_30 );
|
||||
}
|
||||
}
|
||||
else if ( GetHasFeat(FEAT_MOS_UNDEAD_3) )
|
||||
{
|
||||
sSummon = "prc_mos_spectre1";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_20 );
|
||||
}
|
||||
else if ( GetHasFeat(FEAT_MOS_UNDEAD_2) )
|
||||
{
|
||||
sSummon = "prc_mos_wraith";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_LOS_EVIL_10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
sSummon = "prc_mos_allip";
|
||||
eSummonB = EffectVisualEffect( VFX_FNF_GAS_EXPLOSION_EVIL );
|
||||
}
|
||||
float fDelay = 0.0;
|
||||
effect eSum = EffectSummonCreature(sSummon, VFX_NONE, fDelay);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSum, OBJECT_SELF, fDelay);
|
||||
}
|
||||
48
_removed/pnp_lich_alter.nss
Normal file
48
_removed/pnp_lich_alter.nss
Normal file
@@ -0,0 +1,48 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_alter
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// alter self for the lich
|
||||
|
||||
#include "pnp_shifter"
|
||||
#include "strat_prc_inc"
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
int nCurForm = GetAppearanceType(OBJECT_SELF);
|
||||
int nPCForm = GetTrueForm(OBJECT_SELF);
|
||||
|
||||
// Switch to lich
|
||||
if (nPCForm == nCurForm)
|
||||
{
|
||||
int nLichLevel = GetLevelByClass(CLASS_TYPE_LICH,OBJECT_SELF);
|
||||
if (nLichLevel < 10)
|
||||
{
|
||||
effect eFx = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFx,OBJECT_SELF);
|
||||
|
||||
SetCreatureAppearanceType(OBJECT_SELF,APPEARANCE_TYPE_LICH);
|
||||
}
|
||||
if (nLichLevel == 10)
|
||||
{
|
||||
effect eFx = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFx,OBJECT_SELF);
|
||||
SetCreatureAppearanceType(OBJECT_SELF,430); // DemiLich
|
||||
}
|
||||
}
|
||||
else // Switch to PC
|
||||
{
|
||||
effect eFx = EffectVisualEffect(VFX_IMP_MAGICAL_VISION);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eFx,OBJECT_SELF);
|
||||
SetCreatureAppearanceType(OBJECT_SELF,nPCForm);
|
||||
}
|
||||
}
|
||||
70
_removed/pnp_lich_camulet.nss
Normal file
70
_removed/pnp_lich_camulet.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_lich_camulet
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 1/24/2004 9:58:39 AM
|
||||
//:://////////////////////////////////////////////
|
||||
// Craft the lich amulet (create one or upgrade one)
|
||||
|
||||
#include "pnp_lich_inc"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
// Make sure the PC has enough gold
|
||||
if (GetGold(oPC) < 40000)
|
||||
{
|
||||
FloatingTextStringOnCreature("You do not have enough gold to craft the phlyactery", oPC);
|
||||
return;
|
||||
}
|
||||
// Make sure the PC has enough exp so they dont go back a level
|
||||
int nHD = GetHitDice(oPC);
|
||||
int nMinXPForLevel = ((nHD * (nHD - 1)) / 2) * 1000;
|
||||
int nNewXP = GetXP(oPC) - 1600;
|
||||
// -------------------------------------------------------------------------
|
||||
// check for sufficient XP to create
|
||||
// -------------------------------------------------------------------------
|
||||
if (nMinXPForLevel > nNewXP || nNewXP == 0 )
|
||||
{
|
||||
FloatingTextStrRefOnCreature(3785, oPC); // Item Creation Failed - Not enough XP
|
||||
return;
|
||||
}
|
||||
|
||||
object oAmulet = GetItemPossessedBy(oPC,"lichamulet");
|
||||
int nAmuletLevel = GetAmuletLevel(oAmulet);
|
||||
// Cant upgrade past level 10
|
||||
if (nAmuletLevel >= 10)
|
||||
{
|
||||
FloatingTextStringOnCreature("You can not upgrade your phlyactery anymore", oPC);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Remove some gold from the player
|
||||
TakeGoldFromCreature(40000, oPC, TRUE);
|
||||
|
||||
// Remove some xp from the player
|
||||
SetXP(oPC, nNewXP);
|
||||
|
||||
// Allow the pc to get lich levels
|
||||
SetLocalInt(oPC,"PNP_AllowLich", 0);
|
||||
|
||||
// do some VFX
|
||||
CraftVFX(OBJECT_SELF);
|
||||
|
||||
// Create the amulet if they dont have one
|
||||
if (!GetIsObjectValid(oAmulet))
|
||||
{
|
||||
// Give them the level 1 phylactery
|
||||
oAmulet = CreateItemOnObject("lichamulet",oPC);
|
||||
SetIdentified(oAmulet,TRUE);
|
||||
return;
|
||||
}
|
||||
// Upgrade the amulet if they do
|
||||
LevelUpAmulet(oAmulet,nAmuletLevel+1);
|
||||
|
||||
// Trigger the level up lich check
|
||||
DelayCommand(0.1, EvalPRCFeats(oPC));
|
||||
}
|
||||
28
_removed/pnp_lich_craftwo.nss
Normal file
28
_removed/pnp_lich_craftwo.nss
Normal file
@@ -0,0 +1,28 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_craft
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// summons the lich's creation device to allow
|
||||
// the PC to advance their lich powers.
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
// effects
|
||||
effect eGatefx = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
|
||||
effect eSumfx = EffectVisualEffect(VFX_FNF_UNDEAD_DRAGON);
|
||||
object oCraft = CreateObject(OBJECT_TYPE_PLACEABLE,"lichcrafting",GetSpellTargetLocation());
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eGatefx,GetSpellTargetLocation(),5.0);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eSumfx,GetSpellTargetLocation());
|
||||
|
||||
DelayCommand(60.0f, DestroyObject(oCraft));
|
||||
}
|
||||
55
_removed/pnp_lich_csgem.nss
Normal file
55
_removed/pnp_lich_csgem.nss
Normal file
@@ -0,0 +1,55 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_lich_csgem
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 1/24/2004 9:39:35 AM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "pnp_lich_inc"
|
||||
|
||||
// Crafts the soul gem
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
// Make sure the PC has enough gold
|
||||
if (GetGold(oPC) < 120000)
|
||||
{
|
||||
FloatingTextStringOnCreature("You do not have enough gold to craft the soul gem", oPC);
|
||||
return;
|
||||
}
|
||||
// Make sure the PC has enough exp so they dont go back a level
|
||||
int nHD = GetHitDice(oPC);
|
||||
int nMinXPForLevel = ((nHD * (nHD - 1)) / 2) * 1000;
|
||||
int nNewXP = GetXP(oPC) - 4800;
|
||||
// -------------------------------------------------------------------------
|
||||
// check for sufficient XP to create
|
||||
// -------------------------------------------------------------------------
|
||||
if (nMinXPForLevel > nNewXP || nNewXP == 0 )
|
||||
{
|
||||
FloatingTextStrRefOnCreature(3785, oPC); // Item Creation Failed - Not enough XP
|
||||
return;
|
||||
}
|
||||
// Allow the pc to get lich levels
|
||||
SetLocalInt(oPC,"PNP_AllowLich", 0);
|
||||
|
||||
// Remove some gold from the player
|
||||
TakeGoldFromCreature(120000, oPC, TRUE);
|
||||
|
||||
// Remove some xp from the player
|
||||
SetXP(oPC, nNewXP);
|
||||
|
||||
// do some VFX
|
||||
CraftVFX(OBJECT_SELF);
|
||||
|
||||
// Soul gem creation code
|
||||
object oSoulGem = CreateItemOnObject("soul_gem",oPC);
|
||||
itemproperty iProp = ItemPropertyCastSpell(851,IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iProp,oSoulGem);
|
||||
|
||||
// Trigger the level up lich check
|
||||
DelayCommand(0.1, EvalPRCFeats(oPC));
|
||||
|
||||
}
|
||||
39
_removed/pnp_lich_faura.nss
Normal file
39
_removed/pnp_lich_faura.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_faura
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// fear aura for lich
|
||||
|
||||
void main()
|
||||
{
|
||||
// turn off aura if it is on
|
||||
if (GetLocalInt(OBJECT_SELF,"LichAuraOn"))
|
||||
{
|
||||
effect eF = GetFirstEffect(OBJECT_SELF);
|
||||
while (GetIsEffectValid(eF))
|
||||
{
|
||||
if ( (GetEffectType(eF) == EFFECT_TYPE_AREA_OF_EFFECT) &&
|
||||
(GetEffectDurationType(eF) == DURATION_TYPE_PERMANENT))
|
||||
RemoveEffect( OBJECT_SELF,eF);
|
||||
eF = GetNextEffect(OBJECT_SELF);
|
||||
}
|
||||
SetLocalInt(OBJECT_SELF,"LichAuraOn",FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
// turn aura on
|
||||
// Set variable to tell us it is on
|
||||
SetLocalInt(OBJECT_SELF,"LichAuraOn",TRUE);
|
||||
effect eAOE = EffectAreaOfEffect(AOE_MOB_FEAR);
|
||||
// Cant be dispelled or removed during rest
|
||||
eAOE = SupernaturalEffect(eAOE);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAOE, OBJECT_SELF);
|
||||
}
|
||||
589
_removed/pnp_lich_inc.nss
Normal file
589
_removed/pnp_lich_inc.nss
Normal file
@@ -0,0 +1,589 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_inc
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/* Functions needed to handle the amulet, soul gem, and hide
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "pnp_shifter"
|
||||
#include "strat_prc_inc"
|
||||
|
||||
// Returns the lich amulet level
|
||||
int GetAmuletLevel(object oAmulet);
|
||||
// Sets the passed in amulet to nLevel
|
||||
void LevelUpAmulet(object oAmulet,int nLevel);
|
||||
// Returns the lich hide level
|
||||
int GetHideLevel(object oHide);
|
||||
// Sets the passed in hide on the PC to nLevel
|
||||
void LevelUpHide(object oPC, object oHide, int nLevel);
|
||||
// Creates some VFX on the object when crafting
|
||||
void CraftVFX(object oObject);
|
||||
|
||||
void LichSkills(object oHide, int iLevel)
|
||||
{
|
||||
SetCompositeBonus(oHide, "LichSkillHide", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE);
|
||||
SetCompositeBonus(oHide, "LichSkillListen", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN);
|
||||
SetCompositeBonus(oHide, "LichSkillPersuade", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE);
|
||||
SetCompositeBonus(oHide, "LichSkillSilent", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY);
|
||||
SetCompositeBonus(oHide, "LichSkillSearch", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_SEARCH);
|
||||
SetCompositeBonus(oHide, "LichSkillSpot", iLevel, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT);
|
||||
}
|
||||
|
||||
int GetAmuletLevel(object oAmulet)
|
||||
{
|
||||
object oPC = GetFirstPC();
|
||||
//SendMessageToPC(oPC,"Amulet level func");
|
||||
itemproperty iProp = GetFirstItemProperty(oAmulet);
|
||||
int nLevel = 0;
|
||||
|
||||
while (GetIsItemPropertyValid(iProp))
|
||||
{
|
||||
if (GetItemPropertyType(iProp) == ITEM_PROPERTY_AC_BONUS)
|
||||
{
|
||||
//SendMessageToPC(oPC," AC found");
|
||||
int nAC = GetItemPropertyCostTableValue(iProp);
|
||||
//SendMessageToPC(oPC, "AC = " + IntToString(nAC));
|
||||
switch (nAC)
|
||||
{
|
||||
case 2:
|
||||
return 1;
|
||||
case 3:
|
||||
return 2;
|
||||
case 4:
|
||||
return 3;
|
||||
case 5:
|
||||
// cant return because anything above has this AC 5 bonus
|
||||
nLevel = 4;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// for levels above 4 use a junk item like weight reduction
|
||||
if (GetItemPropertyType(iProp) == ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION)
|
||||
{
|
||||
int nWt = GetItemPropertyCostTableValue(iProp);
|
||||
//SendMessageToPC(oPC, "wt = " + IntToString(nWt));
|
||||
switch(nWt)
|
||||
{
|
||||
case IP_CONST_REDUCEDWEIGHT_10_PERCENT:
|
||||
return 5;
|
||||
case IP_CONST_REDUCEDWEIGHT_20_PERCENT:
|
||||
return 6;
|
||||
case IP_CONST_REDUCEDWEIGHT_40_PERCENT:
|
||||
return 7;
|
||||
case IP_CONST_REDUCEDWEIGHT_60_PERCENT:
|
||||
return 8;
|
||||
case IP_CONST_REDUCEDWEIGHT_80_PERCENT:
|
||||
return 9;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// level 10 gets something special (we ran out of weight reduction)
|
||||
if (GetItemPropertyType(iProp) == ITEM_PROPERTY_CAST_SPELL)
|
||||
{
|
||||
int nSpell = GetItemPropertySubType(iProp);
|
||||
|
||||
if (nSpell == IP_CONST_CASTSPELL_CREATE_GREATER_UNDEAD_18)
|
||||
return 10;
|
||||
}
|
||||
|
||||
iProp = GetNextItemProperty(oAmulet);
|
||||
}
|
||||
return nLevel;
|
||||
}
|
||||
|
||||
int GetHideLevel(object oHide)
|
||||
{
|
||||
itemproperty iProp = GetFirstItemProperty(oHide);
|
||||
while (GetIsItemPropertyValid(iProp))
|
||||
{
|
||||
if (GetItemPropertyType(iProp) == ITEM_PROPERTY_SKILL_BONUS)
|
||||
{
|
||||
int nSkill = GetItemPropertySubType(iProp);
|
||||
int nSkillAdd = GetItemPropertyCostTableValue(iProp);
|
||||
if (nSkill == SKILL_HIDE)
|
||||
{
|
||||
if (nSkillAdd == 2)
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
if (GetItemPropertyType(iProp) == ITEM_PROPERTY_DAMAGE_REDUCTION)
|
||||
{
|
||||
int nEncht = GetItemPropertySubType(iProp);
|
||||
int nDR = GetItemPropertyCostTableValue(iProp);
|
||||
// lich hide is always +1
|
||||
if (nEncht == IP_CONST_DAMAGEREDUCTION_1)
|
||||
{
|
||||
switch (nDR)
|
||||
{
|
||||
case IP_CONST_DAMAGESOAK_5_HP:
|
||||
return 2;
|
||||
case IP_CONST_DAMAGESOAK_10_HP:
|
||||
return 3;
|
||||
case IP_CONST_DAMAGESOAK_15_HP:
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (nDR)
|
||||
{
|
||||
case IP_CONST_DAMAGESOAK_5_HP:
|
||||
return 5;
|
||||
case IP_CONST_DAMAGESOAK_10_HP:
|
||||
return 6;
|
||||
case IP_CONST_DAMAGESOAK_15_HP:
|
||||
return 7;
|
||||
case IP_CONST_DAMAGESOAK_20_HP:
|
||||
return 8;
|
||||
case IP_CONST_DAMAGESOAK_25_HP:
|
||||
return 9;
|
||||
case IP_CONST_DAMAGESOAK_30_HP:
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
iProp = GetNextItemProperty(oHide);
|
||||
}
|
||||
// A level 0 hide wont have any lich powers
|
||||
if (GetIsObjectValid(oHide))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Remove any possible non composite item prop from the hide
|
||||
// that is set by the lich hide at anytime
|
||||
void RemoveAllNonComposite(object oHide)
|
||||
{
|
||||
//Clear out non-composite properties from last level
|
||||
// phys DR
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_5_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_10_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_15_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_5, IP_CONST_DAMAGESOAK_5_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_8, IP_CONST_DAMAGESOAK_10_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_11, IP_CONST_DAMAGESOAK_15_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_14, IP_CONST_DAMAGESOAK_20_HP, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_REDUCTION, IP_CONST_DAMAGEREDUCTION_17, IP_CONST_DAMAGESOAK_25_HP, 1, "");
|
||||
// elemental dr
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ACID, IP_CONST_DAMAGERESIST_15, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_15, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_SONIC, IP_CONST_DAMAGERESIST_15, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_20, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_DAMAGE_RESISTANCE, IP_CONST_DAMAGETYPE_ELECTRICAL, IP_CONST_DAMAGERESIST_20, 1, "");
|
||||
// Remove all immunities
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS,IP_CONST_IMMUNITYMISC_CRITICAL_HITS);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_BACKSTAB);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_DEATH_MAGIC);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_DISEASE);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_MINDSPELLS);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_PARALYSIS);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS, IP_CONST_IMMUNITYMISC_POISON);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE, IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGEIMMUNITY_100_PERCENT);
|
||||
RemoveSpecificProperty(oHide,ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE, IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGEIMMUNITY_100_PERCENT);
|
||||
//Spell level immunities
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 10, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 9, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 8, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 7, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 6, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 5, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 4, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 3, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 2, 1, "");
|
||||
RemoveSpecificProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL, -1, 1, 1, "");
|
||||
}
|
||||
|
||||
void LevelUpHide(object oPC, object oHide, int nLevel)
|
||||
{
|
||||
itemproperty iprop;
|
||||
|
||||
// Clean the hide of all things that dont stack
|
||||
// remember to put everything for every level back on!
|
||||
RemoveAllNonComposite(oHide);
|
||||
|
||||
// Level 1 hide
|
||||
if (nLevel == 1)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 1, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
|
||||
//Lich skills +2
|
||||
LichSkills(oHide, 2);
|
||||
|
||||
//Damage reduction 5/- cold
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGERESIST_5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 5/- electric
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGERESIST_5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
// Level 2
|
||||
if (nLevel == 2)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 2, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
|
||||
//Lich skills +4
|
||||
LichSkills(oHide, 4);
|
||||
|
||||
//Damage reduction 5/+1
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1,IP_CONST_DAMAGESOAK_5_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- cold
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- electric
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 3)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 3, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +6
|
||||
LichSkills(oHide, 6);
|
||||
|
||||
|
||||
//Damage reduction 10/1
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1,IP_CONST_DAMAGESOAK_10_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 20/- cold
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGERESIST_20);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 20/- electric
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGERESIST_20);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
// Common things for being undead and a lich
|
||||
if (nLevel >= 4)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichCon", 12, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CON);
|
||||
|
||||
// Undead abilities
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DEATH_MAGIC);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DISEASE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_MINDSPELLS);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
iprop = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// 100 % immune to cold
|
||||
iprop = ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGEIMMUNITY_100_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// 100 % immune to electric
|
||||
iprop = ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGEIMMUNITY_100_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 4)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 4, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +8
|
||||
LichSkills(oHide, 8);
|
||||
|
||||
//Damage reduction 15/1
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1,IP_CONST_DAMAGESOAK_15_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 5)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 3, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 3, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 3, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 5, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +10
|
||||
LichSkills(oHide, 10);
|
||||
|
||||
|
||||
//Damage reduction 5/+5
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_5,IP_CONST_DAMAGESOAK_5_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 5/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 5/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 5/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// Spell level immune to 1 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(2);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 6)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 4, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 4, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 4, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 8, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +12
|
||||
LichSkills(oHide, 12);
|
||||
|
||||
//Damage reduction 10/+8
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_8,IP_CONST_DAMAGESOAK_10_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// Spell level immune to 3 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(4);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 7)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 6, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 6, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 6, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 11, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +14
|
||||
LichSkills(oHide, 14);
|
||||
|
||||
//Damage reduction 15/+11
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_11,IP_CONST_DAMAGESOAK_15_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 10/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// Spell level immune to 5 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(6);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 8)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 7, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 7, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 7, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 14, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +16
|
||||
LichSkills(oHide, 16);
|
||||
|
||||
//Damage reduction 20/+14
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_14,IP_CONST_DAMAGESOAK_20_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
|
||||
// Spell level immune to 7 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(8);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 9)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 8, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 8, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 8, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 17, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +18
|
||||
LichSkills(oHide, 18);
|
||||
|
||||
//Damage reduction 25/+17
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_17,IP_CONST_DAMAGESOAK_25_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 15/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_15);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
|
||||
// Spell level immune to 8 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(9);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
if (nLevel == 10)
|
||||
{
|
||||
// Ability bonus
|
||||
SetCompositeBonus(oHide, "LichInt", 10, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_INT);
|
||||
SetCompositeBonus(oHide, "LichWis", 10, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_WIS);
|
||||
SetCompositeBonus(oHide, "LichCha", 10, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CHA);
|
||||
// Turn resistance
|
||||
SetCompositeBonus(oHide, "LichTurn", 20, ITEM_PROPERTY_TURN_RESISTANCE);
|
||||
//Lich skills +20
|
||||
LichSkills(oHide, 20);
|
||||
|
||||
//Damage reduction 30/+20
|
||||
iprop = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_20,IP_CONST_DAMAGESOAK_30_HP);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 20/- ACID
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_20);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 20/- fire
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_20);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
//Damage reduction 20/- sonic
|
||||
iprop = ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SONIC,IP_CONST_DAMAGERESIST_20);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
// Spell level immune to 9 and lower
|
||||
iprop = ItemPropertyImmunityToSpellLevel(10);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oHide);
|
||||
}
|
||||
}
|
||||
|
||||
void LevelUpAmulet(object oAmulet,int nLevel)
|
||||
{
|
||||
RemoveAllItemProperties(oAmulet);
|
||||
itemproperty iprop;
|
||||
|
||||
// Level 2
|
||||
if (nLevel == 2)
|
||||
{
|
||||
// Ac bonus
|
||||
iprop = ItemPropertyACBonus(3);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 3)
|
||||
{
|
||||
// Ac bonus
|
||||
iprop = ItemPropertyACBonus(4);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
// Common level 4 and above things
|
||||
if (nLevel >= 4)
|
||||
{
|
||||
// Ac bonus
|
||||
iprop = ItemPropertyACBonus(5);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
// Extra so the amulet is useful til 20th level
|
||||
iprop = ItemPropertyRegeneration(1);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
iprop = ItemPropertyCastSpell(IP_CONST_CASTSPELL_ANIMATE_DEAD_15,IP_CONST_CASTSPELL_NUMUSES_UNLIMITED_USE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
iprop = ItemPropertyBonusFeat(IP_CONST_FEAT_SPELLFOCUSNEC);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 4)
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
if (nLevel == 5)
|
||||
{
|
||||
// reduction is used to permenantly track how much the PC has paid for level ups
|
||||
// because reduction of 1/2 lb is nothing usefull
|
||||
iprop = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_10_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 6)
|
||||
{
|
||||
iprop = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_20_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 7)
|
||||
{
|
||||
iprop = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_40_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 8)
|
||||
{
|
||||
iprop = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_60_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 9)
|
||||
{
|
||||
iprop = ItemPropertyWeightReduction(IP_CONST_REDUCEDWEIGHT_80_PERCENT);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
if (nLevel == 10)
|
||||
{
|
||||
iprop = ItemPropertyCastSpell(IP_CONST_CASTSPELL_CREATE_GREATER_UNDEAD_18,IP_CONST_CASTSPELL_NUMUSES_UNLIMITED_USE);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,iprop,oAmulet);
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAllGold(object oObject)
|
||||
{
|
||||
//Destroy everthing
|
||||
object oItem = GetFirstItemInInventory();
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory();
|
||||
}
|
||||
}
|
||||
|
||||
void CraftVFX(object oObject)
|
||||
{
|
||||
effect eFx = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_EVIL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oObject,3.0);
|
||||
eFx = EffectVisualEffect(VFX_FNF_LOS_EVIL_30);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oObject, 4.0);
|
||||
}
|
||||
|
||||
26
_removed/pnp_lich_isdemi.nss
Normal file
26
_removed/pnp_lich_isdemi.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_lich_isdemi
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 1/24/2004 9:30:45 AM
|
||||
//:://////////////////////////////////////////////
|
||||
#include "strat_prc_inc"
|
||||
|
||||
// Determines if the the lich is able to start the process of becoming a demilich
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
|
||||
// Restrict based on the player's class
|
||||
int iPassed = 0;
|
||||
if((GetLevelByClass(CLASS_TYPE_LICH, GetPCSpeaker()) >= 4) &&
|
||||
((GetLevelByClass(CLASS_TYPE_CLERIC,GetPCSpeaker()) >= 21) ||
|
||||
(GetLevelByClass(CLASS_TYPE_WIZARD,GetPCSpeaker()) >= 21) ||
|
||||
(GetLevelByClass(CLASS_TYPE_SORCERER,GetPCSpeaker()) >= 21)) )
|
||||
iPassed = 1;
|
||||
if(iPassed == 0)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
177
_removed/pnp_lich_level.nss
Normal file
177
_removed/pnp_lich_level.nss
Normal file
@@ -0,0 +1,177 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_level
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// Completes the level up process by checking the amulet level vs the hide level
|
||||
// vs the lich level.
|
||||
|
||||
// Called by the EvalPRC function
|
||||
|
||||
#include "pnp_lich_inc"
|
||||
|
||||
void LichLevelUpVFX(object oPC)
|
||||
{
|
||||
// make some fancy fireworks for when the lich levels up
|
||||
// VFX for the increase of powers
|
||||
effect eFx = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_EVIL);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oPC);
|
||||
eFx = EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oPC);
|
||||
eFx = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// being called by EvalPRCFeats
|
||||
object oPC = OBJECT_SELF;
|
||||
int nLichLevel = GetLevelByClass(CLASS_TYPE_LICH,oPC);
|
||||
|
||||
//************************************************
|
||||
// Lich items
|
||||
// The amulet is the phlycatery that is required to become a lich
|
||||
object oAmulet = GetItemPossessedBy(oPC,"lichamulet");
|
||||
int nAmuletLevel = GetAmuletLevel(oAmulet);
|
||||
//SendMessageToPC(oPC,"amulet level = " + IntToString(nAmuletLevel));
|
||||
|
||||
object oHide = GetPCSkin(oPC);
|
||||
int nHideLevel = GetHideLevel(oHide);
|
||||
//SendMessageToPC(oPC,"hide level = " + IntToString(nHideLevel));
|
||||
//debug code to inspect the hide props
|
||||
//CopyItem(oHide,oPC,TRUE);
|
||||
|
||||
// Find the number of soul gems on the lich
|
||||
int nNumSoulGems = 0;
|
||||
object oItem = GetFirstItemInInventory(oPC);
|
||||
while (GetIsObjectValid(oItem) == TRUE)
|
||||
{
|
||||
if (GetResRef(oItem) == "soul_gem")
|
||||
nNumSoulGems++;
|
||||
oItem = GetNextItemInInventory(GetFirstPC());
|
||||
}
|
||||
//SendMessageToPC(oPC,"num soul gems = " + IntToString(nNumSoulGems));
|
||||
// Lich items
|
||||
//************************************************
|
||||
|
||||
// Evalutation EVENT Hook.
|
||||
// Check to see if they have the amulet, find out what level it is,
|
||||
// and adjust the hide to match the amulet level. If they loose the amulet
|
||||
// they need to do everything all over from scratch.
|
||||
// Make sure they dont get a hide above the lich level
|
||||
effect eFx;
|
||||
|
||||
switch(nLichLevel)
|
||||
{
|
||||
case 0:
|
||||
return;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if ((nAmuletLevel >= nLichLevel) && (nHideLevel < nLichLevel))
|
||||
{
|
||||
LevelUpHide(oPC, oHide, nLichLevel);
|
||||
LichLevelUpVFX(oPC);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{ // indicate the problem
|
||||
if (nAmuletLevel < nLichLevel)
|
||||
{
|
||||
FloatingTextStringOnCreature("You need to upgrade your phylactery in order to gain more lich powers",oPC);
|
||||
// make sure we give them the highest hide they can get
|
||||
if (nHideLevel < nAmuletLevel)
|
||||
LevelUpHide(oPC, oHide, nAmuletLevel);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if ((nAmuletLevel >= nLichLevel) && (nHideLevel < nLichLevel))
|
||||
{
|
||||
LevelUpHide(oPC, oHide, nLichLevel);
|
||||
// they are now a full lich, make them look like one
|
||||
LichLevelUpVFX(oPC);
|
||||
SetCreatureAppearanceType(oPC,APPEARANCE_TYPE_LICH);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{ // indicate the problem
|
||||
if (nAmuletLevel < nLichLevel)
|
||||
{
|
||||
FloatingTextStringOnCreature("You need to upgrade your phylactery in order to gain more lich powers",oPC);
|
||||
// make sure we give them the highest hide they can get
|
||||
if (nHideLevel < nAmuletLevel)
|
||||
LevelUpHide(oPC, oHide, nAmuletLevel);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
// for the demilich levels we need soul gems
|
||||
if ((nAmuletLevel >= nLichLevel) && (nHideLevel < nLichLevel) && (nNumSoulGems >= (nLichLevel-4)))
|
||||
{
|
||||
LevelUpHide(oPC, oHide, nLichLevel);
|
||||
LichLevelUpVFX(oPC);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{ // indicate the problem
|
||||
if (nAmuletLevel < nLichLevel)
|
||||
FloatingTextStringOnCreature("You need to upgrade your phylactery in order to gain more lich powers",oPC);
|
||||
if (nNumSoulGems < nLichLevel-4)
|
||||
FloatingTextStringOnCreature("You need to make more soul gems in order to gain more lich powers",oPC);
|
||||
|
||||
// Determine what hide they should get
|
||||
int nLowestHideLevel = nLichLevel;
|
||||
if (nAmuletLevel < nLowestHideLevel)
|
||||
nLowestHideLevel = nAmuletLevel;
|
||||
if (nNumSoulGems+4 < nLowestHideLevel)
|
||||
nLowestHideLevel = nNumSoulGems+4;
|
||||
if (nHideLevel < nLowestHideLevel)
|
||||
LevelUpHide(oPC, oHide, nLowestHideLevel);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
// at 10th level we need 8 gems
|
||||
if ((nAmuletLevel >= nLichLevel) && (nNumSoulGems >= 8) && (nHideLevel < nLichLevel))
|
||||
{
|
||||
LevelUpHide(oPC, oHide, nLichLevel);
|
||||
LichLevelUpVFX(oPC);
|
||||
eFx = EffectVisualEffect(VFX_FNF_WAIL_O_BANSHEES);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eFx,oPC);
|
||||
SetCreatureAppearanceType(oPC,430);
|
||||
}
|
||||
else
|
||||
{ // indicate the problem
|
||||
if (nAmuletLevel < nLichLevel)
|
||||
FloatingTextStringOnCreature("You need to upgrade your phylactery in order to gain more lich powers",oPC);
|
||||
if (nNumSoulGems < 8)
|
||||
FloatingTextStringOnCreature("You need 8 soul gems in order to gain more lich powers",oPC);
|
||||
// Determine what hide they should get
|
||||
int nLowestHideLevel = nLichLevel;
|
||||
if (nAmuletLevel < nLowestHideLevel)
|
||||
nLowestHideLevel = nAmuletLevel;
|
||||
if (nNumSoulGems+4 < nLowestHideLevel)
|
||||
nLowestHideLevel = nNumSoulGems+4;
|
||||
// they need 8 gems at 10 so.. need to plug up this hole
|
||||
if (nLowestHideLevel >= 10)
|
||||
nLowestHideLevel = 9;
|
||||
if (nHideLevel < nLowestHideLevel)
|
||||
LevelUpHide(oPC, oHide, nLowestHideLevel);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
114
_removed/pnp_lich_touch.nss
Normal file
114
_removed/pnp_lich_touch.nss
Normal file
@@ -0,0 +1,114 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_touch
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// touch attack for the lich class
|
||||
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetSpellTargetObject();
|
||||
|
||||
// Gotta hit first
|
||||
if(TouchAttackMelee(oTarget,TRUE)<1)
|
||||
return;
|
||||
|
||||
// Gotta be a living critter
|
||||
int nType = MyPRCGetRacialType(oTarget);
|
||||
if ((nType == RACIAL_TYPE_CONSTRUCT) ||
|
||||
(nType == RACIAL_TYPE_UNDEAD) ||
|
||||
(nType == RACIAL_TYPE_ELEMENTAL))
|
||||
return;
|
||||
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
|
||||
|
||||
// Lich level determines the damage and paralyze length
|
||||
int nLichLevel = GetLevelByClass(CLASS_TYPE_LICH);
|
||||
// Total character levels
|
||||
int nTotalHD = GetHitDice(OBJECT_SELF);
|
||||
// Save DC
|
||||
int nSaveDC = 10 + nTotalHD/2 + GetAbilityModifier(ABILITY_CHARISMA,OBJECT_SELF);
|
||||
// Damage
|
||||
int nDam = 0;
|
||||
// Para duration in seconds
|
||||
float fDuration;
|
||||
switch(nLichLevel)
|
||||
{
|
||||
case 1:
|
||||
nDam += d6() + 5;
|
||||
fDuration = RoundsToSeconds(d4());
|
||||
break;
|
||||
case 2:
|
||||
nDam += d8() + 5;
|
||||
fDuration = IntToFloat(d4() * 60);
|
||||
break;
|
||||
case 3:
|
||||
nDam += d8() + 5;
|
||||
fDuration = IntToFloat(d4() * 60 * 60);
|
||||
break;
|
||||
case 4:
|
||||
nDam += d8() + 5;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 5:
|
||||
nDam += d6(2) + 5;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 6:
|
||||
nDam += d6(4) + 8;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 7:
|
||||
nDam += d6(6) + 12;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 8:
|
||||
nDam += d6(8) + 15;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 9:
|
||||
nDam += d6(9) + 18;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
case 10:
|
||||
nDam += d6(10) + 20;
|
||||
fDuration = 0.0;
|
||||
break;
|
||||
}
|
||||
|
||||
// Apply Damage 1/2 if they will save
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
|
||||
if(WillSave(oTarget,nSaveDC , SAVING_THROW_TYPE_NEGATIVE))
|
||||
nDam = nDam/2;
|
||||
|
||||
effect eDamage = EffectDamage(nDam);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget);
|
||||
|
||||
// Apply paralyze touch
|
||||
if(FortitudeSave(oTarget,nSaveDC , SAVING_THROW_TYPE_MIND_SPELLS))
|
||||
return;
|
||||
eVis = EffectVisualEffect(VFX_DUR_PARALYZED);
|
||||
effect ePara = EffectParalyze();
|
||||
ePara = EffectLinkEffects(eVis,ePara);
|
||||
// Cant be dispelled
|
||||
ePara = SupernaturalEffect(ePara);
|
||||
if (fDuration < 1.0)
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,ePara,oTarget);
|
||||
else
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePara,oTarget,fDuration);
|
||||
|
||||
eVis = EffectVisualEffect(VFX_IMP_STUN);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
|
||||
return;
|
||||
}
|
||||
66
_removed/pnp_lich_trap.nss
Normal file
66
_removed/pnp_lich_trap.nss
Normal file
@@ -0,0 +1,66 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name Lich
|
||||
//:: FileName pnp_lich_trap
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Shane Hennessy
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
// trap the soul spell for the lich class (demilich)
|
||||
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetSpellTargetObject();
|
||||
|
||||
// Gotta be a living critter
|
||||
int nType = MyPRCGetRacialType(oTarget);
|
||||
if ((nType == RACIAL_TYPE_CONSTRUCT) ||
|
||||
(nType == RACIAL_TYPE_UNDEAD) ||
|
||||
(nType == RACIAL_TYPE_ELEMENTAL))
|
||||
{
|
||||
FloatingTextStringOnCreature("Target must be alive",OBJECT_SELF);
|
||||
// should not count as a usage but... no way to do it
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
|
||||
|
||||
// Total character levels
|
||||
int nTotalHD = GetHitDice(OBJECT_SELF);
|
||||
// Save DC
|
||||
int nSaveDC = 10 + nTotalHD/2 + GetAbilityModifier(ABILITY_CHARISMA,OBJECT_SELF);
|
||||
|
||||
effect eVis;
|
||||
// Apply 4 neg levels if they fort save save
|
||||
if(FortitudeSave(oTarget,nSaveDC,SAVING_THROW_TYPE_DEATH ))
|
||||
{
|
||||
eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE );
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget,1.0);
|
||||
effect eNegLev = EffectNegativeLevel(4);
|
||||
// Cant be dispelled
|
||||
eNegLev = SupernaturalEffect(eNegLev);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eNegLev,oTarget);
|
||||
// should not count as a usage but... no way to do it
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// They failed, now they die
|
||||
eVis = EffectVisualEffect(VFX_FNF_PWKILL);
|
||||
effect eDeath = EffectDeath(TRUE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
// Blow yellow chunks for extra fun
|
||||
eVis = EffectVisualEffect(VFX_COM_CHUNK_YELLOW_MEDIUM);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
// Give the PKill vis time to run
|
||||
DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget));
|
||||
|
||||
return;
|
||||
}
|
||||
21
_removed/pnp_shift_c100.nss
Normal file
21
_removed/pnp_shift_c100.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c100
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 0 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=0;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
}
|
||||
22
_removed/pnp_shift_c101.nss
Normal file
22
_removed/pnp_shift_c101.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c101
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=1;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
21
_removed/pnp_shift_c102.nss
Normal file
21
_removed/pnp_shift_c102.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c102
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 2 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=2;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
}
|
||||
22
_removed/pnp_shift_c103.nss
Normal file
22
_removed/pnp_shift_c103.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c103
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=3;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c104.nss
Normal file
22
_removed/pnp_shift_c104.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c104
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=4;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c105.nss
Normal file
22
_removed/pnp_shift_c105.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c105
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=5;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c106.nss
Normal file
22
_removed/pnp_shift_c106.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c106
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=6;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c107.nss
Normal file
22
_removed/pnp_shift_c107.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c107
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=7;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c108.nss
Normal file
22
_removed/pnp_shift_c108.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c108
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=8;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
22
_removed/pnp_shift_c109.nss
Normal file
22
_removed/pnp_shift_c109.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_c109
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 5:22:03 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_generic"
|
||||
#include "pnp_shifter"
|
||||
|
||||
// The user has selected index 1 from the starting condition to shift into
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
// add index to the start
|
||||
nStartIndex+=9;
|
||||
ShiftFromKnownArray(nStartIndex,OBJECT_SELF,oPC);
|
||||
|
||||
}
|
||||
6
_removed/pnp_shift_egwild.nss
Normal file
6
_removed/pnp_shift_egwild.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main()
|
||||
{
|
||||
// Create the epic listener
|
||||
object oListener = CreateObject(OBJECT_TYPE_CREATURE,"epicshifterliste",GetLocation(OBJECT_SELF));
|
||||
|
||||
}
|
||||
16
_removed/pnp_shift_eonspw.nss
Normal file
16
_removed/pnp_shift_eonspw.nss
Normal file
@@ -0,0 +1,16 @@
|
||||
void main()
|
||||
{
|
||||
// Spawn in shifter listener
|
||||
|
||||
// Make it perm invis
|
||||
effect eInv = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
|
||||
SupernaturalEffect(eInv);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eInv,OBJECT_SELF);
|
||||
|
||||
// Listen for messages from the shifter
|
||||
SetListening(OBJECT_SELF,TRUE);
|
||||
SetListenPattern(OBJECT_SELF,"Epic Form of **",10102);
|
||||
// this is for a resref Epic form, works just like form of does
|
||||
SetListenPattern(OBJECT_SELF,"resref Epic Form of **",10103);
|
||||
}
|
||||
5
_removed/pnp_shift_gwild.nss
Normal file
5
_removed/pnp_shift_gwild.nss
Normal file
@@ -0,0 +1,5 @@
|
||||
void main()
|
||||
{
|
||||
// Create the listener
|
||||
object oListener = CreateObject(OBJECT_TYPE_CREATURE,"shifterlistenero",GetLocation(OBJECT_SELF));
|
||||
}
|
||||
38
_removed/pnp_shift_listfm.nss
Normal file
38
_removed/pnp_shift_listfm.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_listfm
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 2:59:44 PM
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "pnp_shifter"
|
||||
|
||||
// We will be setting the custom tokens so the dlg will display
|
||||
// 10 forms at a time.
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oMimicForms = GetItemPossessedBy( oPC, "sparkoflife" );
|
||||
if ( !GetIsObjectValid(oMimicForms) )
|
||||
oMimicForms = CreateItemOnObject( "sparkoflife", oPC );
|
||||
int num_creatures = GetLocalInt( oMimicForms, "num_creatures" );
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
int i;
|
||||
int j = 0;
|
||||
|
||||
//SendMessageToPC(oPC,"sid "+IntToString(nStartIndex)+" num "+IntToString(num_creatures));
|
||||
// cycle back to the start
|
||||
if (nStartIndex > num_creatures)
|
||||
nStartIndex = 0;
|
||||
|
||||
for ( i=nStartIndex; i<nStartIndex+10; i++ )
|
||||
{
|
||||
SetCustomToken(100+j,GetLocalArrayString( oMimicForms, "shift_choice", i ));
|
||||
j++;
|
||||
//SendMessageToPC(oPC,GetLocalArrayString( oMimicForms, "shift_choice", i ));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
18
_removed/pnp_shift_mimic.nss
Normal file
18
_removed/pnp_shift_mimic.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
#include "pnp_shifter"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oTarget = GetSpellTargetObject();
|
||||
if (GetValidShift(OBJECT_SELF,oTarget))
|
||||
{
|
||||
if (!SetShift(OBJECT_SELF,oTarget))
|
||||
IncrementRemainingFeatUses(OBJECT_SELF,2900); // only uses a feat if they shift
|
||||
else
|
||||
RecognizeCreature( OBJECT_SELF, GetResRef(oTarget) );
|
||||
}
|
||||
else
|
||||
IncrementRemainingFeatUses(OBJECT_SELF,2900); // only uses a feat if they shift
|
||||
|
||||
}
|
||||
25
_removed/pnp_shift_nextfm.nss
Normal file
25
_removed/pnp_shift_nextfm.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: FileName pnp_shift_nextfm
|
||||
//:://////////////////////////////////////////////
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Script Wizard
|
||||
//:: Created On: 2/22/2004 6:13:10 PM
|
||||
//:://////////////////////////////////////////////
|
||||
// Move to the starting point in the list of critters by 10
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
int nStartIndex = GetLocalInt(oPC,"ShifterListIndex");
|
||||
object oMimicForms = GetItemPossessedBy( oPC, "sparkoflife" );
|
||||
if ( !GetIsObjectValid(oMimicForms) )
|
||||
oMimicForms = CreateItemOnObject( "sparkoflife", oPC );
|
||||
int num_creatures = GetLocalInt( oMimicForms, "num_creatures" );
|
||||
|
||||
nStartIndex+=10;
|
||||
// Make sure we dont go beyond the end of the list
|
||||
if (nStartIndex > num_creatures)
|
||||
nStartIndex = 0;
|
||||
// Set the variable
|
||||
SetLocalInt(oPC, "ShifterListIndex", nStartIndex);
|
||||
|
||||
}
|
||||
77
_removed/pnp_shift_onconv.nss
Normal file
77
_removed/pnp_shift_onconv.nss
Normal file
@@ -0,0 +1,77 @@
|
||||
#include "pnp_shifter"
|
||||
|
||||
void main()
|
||||
{
|
||||
// OnConversation script for listener monster
|
||||
int i = 1; // Start after the Form of phrase
|
||||
object oPC = GetLastSpeaker();
|
||||
int nMatch = GetListenPatternNumber();
|
||||
|
||||
// Revert to true form
|
||||
if(nMatch == 10110)
|
||||
{
|
||||
if (SetShiftTrueForm(oPC))
|
||||
DestroyObject(OBJECT_SELF,2.0); // all done
|
||||
}
|
||||
else if (nMatch == 10100) // translate a creature string to a resref
|
||||
{
|
||||
nMatch = GetMatchedSubstringsCount();
|
||||
|
||||
string sCreatureName;
|
||||
while(i<nMatch)
|
||||
{
|
||||
sCreatureName += GetMatchedSubstring(i);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Force the PC to shift
|
||||
if (SetShiftFromTemplateValidate(oPC,GetResRefFromName(sCreatureName)))
|
||||
DestroyObject(OBJECT_SELF,2.0);
|
||||
}
|
||||
else if (nMatch == 10101) // no translations this is a resref
|
||||
{
|
||||
nMatch = GetMatchedSubstringsCount();
|
||||
|
||||
string sCreatureName;
|
||||
while(i<nMatch)
|
||||
{
|
||||
sCreatureName += GetMatchedSubstring(i);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Force the PC to shift
|
||||
if (SetShiftFromTemplateValidate(oPC,sCreatureName))
|
||||
DestroyObject(OBJECT_SELF,2.0);
|
||||
}
|
||||
else if (nMatch == 10102) // give the shifter some of the powers of the form
|
||||
{
|
||||
nMatch = GetMatchedSubstringsCount();
|
||||
|
||||
string sCreatureName;
|
||||
while(i<nMatch)
|
||||
{
|
||||
sCreatureName += GetMatchedSubstring(i);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Force the PC to shift
|
||||
if (SetShiftEpicFromTemplateValidate(oPC,GetResRefFromName(sCreatureName)))
|
||||
DestroyObject(OBJECT_SELF,2.0);
|
||||
}
|
||||
else if (nMatch == 10103) // no translations this is a resref
|
||||
{
|
||||
nMatch = GetMatchedSubstringsCount();
|
||||
|
||||
string sCreatureName;
|
||||
while(i<nMatch)
|
||||
{
|
||||
sCreatureName += GetMatchedSubstring(i);
|
||||
i++;
|
||||
}
|
||||
|
||||
// Force the PC to shift
|
||||
if (SetShiftEpicFromTemplateValidate(oPC,sCreatureName))
|
||||
DestroyObject(OBJECT_SELF,2.0);
|
||||
}
|
||||
|
||||
}
|
||||
18
_removed/pnp_shift_onspwn.nss
Normal file
18
_removed/pnp_shift_onspwn.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
void main()
|
||||
{
|
||||
// Spawn in shifter listener
|
||||
|
||||
// Make it perm invis
|
||||
effect eInv = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
|
||||
SupernaturalEffect(eInv);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eInv,OBJECT_SELF);
|
||||
|
||||
// Listen for messages from the shifter
|
||||
SetListening(OBJECT_SELF,TRUE);
|
||||
// the ** will be the name of the creature to become
|
||||
SetListenPattern(OBJECT_SELF,"Form of **",10100);
|
||||
// the ** will be the name of the creature to become
|
||||
// this is for a resref name, no translation of the string
|
||||
SetListenPattern(OBJECT_SELF,"resref Form of **",10101);
|
||||
}
|
||||
9
_removed/pnp_shift_true.nss
Normal file
9
_removed/pnp_shift_true.nss
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "pnp_shifter"
|
||||
|
||||
void main()
|
||||
{
|
||||
SetShiftTrueForm(OBJECT_SELF);
|
||||
|
||||
// Reset any PRC feats that might have been lost from the shift
|
||||
EvalPRCFeats(OBJECT_SELF);
|
||||
}
|
||||
2308
_removed/pnp_shifter.nss
Normal file
2308
_removed/pnp_shifter.nss
Normal file
File diff suppressed because it is too large
Load Diff
116
_removed/prc_acolyte.nss
Normal file
116
_removed/prc_acolyte.nss
Normal file
@@ -0,0 +1,116 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Acolyte of the Skin Feats]
|
||||
//:: [prc_acolyte.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Acolyte of the Skin feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 28, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
|
||||
// * Applies the Acolyte's AC bonuses as CompositeBonuses on object's skin.
|
||||
// * iLevel = integer AC Bonus
|
||||
void AcolyteFiendSkin(object oPC, object oSkin, int iLevel)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "AcolyteSkinBonus") == iLevel) return;
|
||||
|
||||
SetCompositeBonus(oSkin, "AcolyteSkinBonus", iLevel, ITEM_PROPERTY_AC_BONUS);
|
||||
}
|
||||
|
||||
// * Applies the Acolyte's damage reduction bonuses as CompositeBonuses on object's skin.
|
||||
// * iLevel = IP_CONST_DAMAGEREDUCTION_*
|
||||
void AcolyteSymbiosis(object oPC, object oSkin, int iLevel)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "AcolyteSymbBonus") == iLevel) return;
|
||||
|
||||
RemoveSpecificProperty(oSkin, ITEM_PROPERTY_DAMAGE_REDUCTION, GetLocalInt(oSkin, "AcolyteSymbBonus"), IP_CONST_DAMAGESOAK_20_HP, 1, "AcolyteSymbBonus");
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageReduction(iLevel, IP_CONST_DAMAGESOAK_20_HP), oSkin);
|
||||
SetLocalInt(oSkin, "AcolyteSymbBonus", iLevel);
|
||||
}
|
||||
|
||||
// * Applies the Acolyte's stat bonuses as CompositeBonuses on object's skin.
|
||||
// * Currently only valid for Con, Dex and Int
|
||||
// * iLevel = integer stat bonus
|
||||
// * iStat = IP_CONST_ABILITY_*
|
||||
void AcolyteStatBonus(object oPC, object oSkin, int iLevel, int iStat)
|
||||
{
|
||||
string sFlag;
|
||||
if(iStat == IP_CONST_ABILITY_CON) sFlag = "AcolyteStatBonusCon";
|
||||
if(iStat == IP_CONST_ABILITY_DEX) sFlag = "AcolyteStatBonusDex";
|
||||
if(iStat == IP_CONST_ABILITY_INT) sFlag = "AcolyteStatBonusInt";
|
||||
|
||||
if(GetLocalInt(oSkin, sFlag) == iLevel) return;
|
||||
|
||||
if(iLevel > 0){
|
||||
SetCompositeBonus(oSkin, sFlag, iLevel, ITEM_PROPERTY_ABILITY_BONUS, iStat);
|
||||
SetLocalInt(oSkin, sFlag, TRUE);
|
||||
}
|
||||
else {
|
||||
SetCompositeBonus(oSkin, sFlag, 0, ITEM_PROPERTY_ABILITY_BONUS, iStat);
|
||||
SetLocalInt(oSkin, sFlag, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// * Applies the Acolyte's resistance bonuses as CompositeBonuses on object's skin.
|
||||
// * Currently only valid for Cold, Fire, Acid and Electric
|
||||
// * Resistance level is hardcodded to 20
|
||||
// * iType = IP_CONST_DAMAGETYPE_*
|
||||
void AcolyteResistance(object oPC, object oSkin, int iType)
|
||||
{
|
||||
string sFlag;
|
||||
if(iType == IP_CONST_DAMAGETYPE_COLD) sFlag = "AcolyteResistanceCold";
|
||||
if(iType == IP_CONST_DAMAGETYPE_FIRE) sFlag = "AcolyteResistanceFire";
|
||||
if(iType == IP_CONST_DAMAGETYPE_ACID) sFlag = "AcolyteResistanceAcid";
|
||||
if(iType == IP_CONST_DAMAGETYPE_ELECTRICAL) sFlag = "AcolyteResistanceElectric";
|
||||
|
||||
if(GetLocalInt(oSkin, sFlag) == TRUE) return;
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageResistance(iType, IP_CONST_DAMAGERESIST_20), oSkin);
|
||||
SetLocalInt(oSkin, sFlag, TRUE);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = OBJECT_SELF;
|
||||
|
||||
int bFSkin = GetHasFeat(FEAT_WEAR_FIEND, oPC) ? 1 : 0;
|
||||
bFSkin = GetHasFeat(FEAT_SKIN_ADAPTION, oPC) ? 2 : bFSkin;
|
||||
|
||||
int bSymbi = GetHasFeat(FEAT_SYMBIOSIS, oPC) ? IP_CONST_DAMAGEREDUCTION_1 : -1;
|
||||
bSymbi = GetHasFeat(FEAT_EPIC_SYMBIOSIS_1, oPC) ? IP_CONST_DAMAGEREDUCTION_2 : bSymbi;
|
||||
bSymbi = GetHasFeat(FEAT_EPIC_SYMBIOSIS_2, oPC) ? IP_CONST_DAMAGEREDUCTION_3 : bSymbi;
|
||||
bSymbi = GetHasFeat(FEAT_EPIC_SYMBIOSIS_3, oPC) ? IP_CONST_DAMAGEREDUCTION_4 : bSymbi;
|
||||
bSymbi = GetHasFeat(FEAT_EPIC_SYMBIOSIS_4, oPC) ? IP_CONST_DAMAGEREDUCTION_5 : bSymbi;
|
||||
|
||||
int bStCon = GetHasFeat(FEAT_SKIN_ADAPTION, oPC) ? 2 : 0;
|
||||
bStCon = GetHasFeat(FEAT_EPIC_CON_1, oPC) ? 4 : bStCon;
|
||||
bStCon = GetHasFeat(FEAT_EPIC_CON_2, oPC) ? 6 : bStCon;
|
||||
bStCon = GetHasFeat(FEAT_EPIC_CON_3, oPC) ? 8 : bStCon;
|
||||
|
||||
int bStDex = GetHasFeat(FEAT_WEAR_FIEND, oPC) ? 2 : 0;
|
||||
|
||||
int bStInt = GetHasFeat(FEAT_EPIC_INT_1, oPC) ? 2 : 0;
|
||||
bStInt = GetHasFeat(FEAT_EPIC_INT_2, oPC) ? 4 : bStInt;
|
||||
|
||||
int bResCo = GetHasFeat(FEAT_COLD_RESISTANT, oPC);
|
||||
int bResFl = GetHasFeat(FEAT_FLAME_RESISTANT, oPC);
|
||||
int bResAc = GetHasFeat(FEAT_ACID_RESISTANT, oPC);
|
||||
int bResEl = GetHasFeat(FEAT_ELEC_RESISTANT, oPC);
|
||||
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
|
||||
if(bFSkin > 0) AcolyteFiendSkin(oPC, oSkin, bFSkin);
|
||||
//NOT IMPLEMENTED if(bFKnow > 0) AcolyteFiendishKnowledge(oPC, oSkin, bFKnow);
|
||||
if(bSymbi > -1) AcolyteSymbiosis(oPC, oSkin, bSymbi);
|
||||
if(bStCon > 0) AcolyteStatBonus(oPC, oSkin, bStCon, IP_CONST_ABILITY_CON);
|
||||
if(bStDex > 0) AcolyteStatBonus(oPC, oSkin, bStDex, IP_CONST_ABILITY_DEX);
|
||||
if(bStInt > 0) AcolyteStatBonus(oPC, oSkin, bStInt, IP_CONST_ABILITY_INT);
|
||||
if(bResCo) AcolyteResistance(oPC, oSkin, IP_CONST_DAMAGETYPE_COLD);
|
||||
if(bResFl) AcolyteResistance(oPC, oSkin, IP_CONST_DAMAGETYPE_FIRE);
|
||||
if(bResAc) AcolyteResistance(oPC, oSkin, IP_CONST_DAMAGETYPE_ACID);
|
||||
if(bResEl) AcolyteResistance(oPC, oSkin, IP_CONST_DAMAGETYPE_ELECTRICAL);
|
||||
}
|
||||
230
_removed/prc_alterations.nss
Normal file
230
_removed/prc_alterations.nss
Normal file
@@ -0,0 +1,230 @@
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_prc_function"
|
||||
|
||||
|
||||
//does everything myResistSPell does, only it adjusts for +1 ECL
|
||||
// uses spell script: "add_spell_penetr" , also any changes made to "prc_caster_level" will affect
|
||||
// it the same way as they affect the GetChangesToCasterLevel function.
|
||||
int MyPRCResistSpell(object oCaster, object oTarget, float fDelay = 0.0);
|
||||
|
||||
|
||||
// Scraped - because it turned out not to be quite versatile enough.
|
||||
//effect PRCElementalDamage(object oCaster, int nDamage, int nType, int nDamagePower = DAMAGE_POWER_NORMAL);
|
||||
|
||||
|
||||
// returns amount added to Caster Level to allow adjustments for +1 ECL
|
||||
// uses spell script: "prc_caster_level"
|
||||
int GetChangesToCasterLevel(object oCaster);
|
||||
|
||||
// returns any additional changes to spell save DC you want included other
|
||||
// than the basic 10 + spell level + attribute + feats
|
||||
// uses spell script: "add_spell_dc"
|
||||
int GetChangesToSaveDC(object oCaster);
|
||||
|
||||
// returns alternate damage type for spells that do area of effect, or damage sheilds.
|
||||
// uses script: "set_damage_type"
|
||||
int ChangedElementalDamage(object oCaster, int nDamageType);
|
||||
|
||||
|
||||
|
||||
// does SR checks. Runs ExecuteScriptAndReturnInt() twice, once to get adjusted PRC caster level
|
||||
// and a second time to get any random spell penetration bonuses or to exclude certain targets from
|
||||
// taking damage. The caster level script is called "prc_caster_level" and the other is "add_spell_penetr"
|
||||
|
||||
// I think the code for it was much more readable before I tried to optimise it a bit. :)
|
||||
|
||||
int MyPRCResistSpell(object oCaster, object oTarget, float fDelay = 0.0)
|
||||
{
|
||||
|
||||
if (fDelay > 0.5)
|
||||
{
|
||||
fDelay = fDelay - 0.1;
|
||||
}
|
||||
|
||||
int nResist = 0;
|
||||
int nTargetSR = GetSpellResistance(oTarget);
|
||||
int nRolled;
|
||||
string toSay = "";
|
||||
|
||||
nResist = ExecuteScriptAndReturnInt("screen_targets", oTarget);
|
||||
// Make sure this script returns 0 if you don't want any thing specifically screened.
|
||||
// If this script returns 0, nothing happens
|
||||
// If 1, Spell is automatically resisted with the usual SR vfx
|
||||
// If 2, same, but with globe vfx
|
||||
// If 3, same, but with spell mantle vfx
|
||||
// If 4 or higher, same but with no vfx.
|
||||
|
||||
|
||||
/// I want the "add_spell_penetr" to return -2001, -2002, -2003, or -2004 if the target is
|
||||
/// supposed to just plain not get hurt by the spell. It's a good way to do feats like
|
||||
/// the Arch Mage's Mastery of Shaping feat. (Though just the aspect of avoiding harm to allies)
|
||||
|
||||
/// If -2001 is returned, the SR vfx fires and the target is unharmed. If -2002 is returned,
|
||||
/// the globe vfx will fire instead. If -2003 is returned, it will be the spell mantle vfx.
|
||||
/// And, if -2004 is returned, then no vfx at all. In any of these cases, the target is
|
||||
/// unharmed.
|
||||
|
||||
/// I figured it would be better processing time wise rather than to fire off 2 scripts
|
||||
/// one for friendly fire checks, and one for random spell penetration bonuses, to just
|
||||
/// have them both happen in "add_spell_penetr"
|
||||
if(nResist == 0)
|
||||
{
|
||||
if(nTargetSR > 0) // no matter how big the negative modifier you give the
|
||||
{ // caster on their spell penetration check, it will never
|
||||
// fail against an sr of 0.
|
||||
|
||||
int nCasterLevel = GetCasterLevel(oCaster) + ExecuteScriptAndReturnInt("prc_caster_level", oCaster);
|
||||
// this is the same as saying: GetCasterLevel(oCaster) + GetChangesToCasterLevel(oCaster);
|
||||
// I just think it would be silly to actually call the GetChangesToCasterLevel(oCaster) function.
|
||||
// It only wastes like I don't know: 5 operations or so? But why waste them?
|
||||
if(GetHasFeat(FEAT_EPIC_SPELL_PENETRATION, oCaster))
|
||||
{
|
||||
nCasterLevel = nCasterLevel + 6;
|
||||
}
|
||||
else if(GetHasFeat(FEAT_GREATER_SPELL_PENETRATION, oCaster))
|
||||
{
|
||||
nCasterLevel = nCasterLevel + 4;
|
||||
}
|
||||
else if(GetHasFeat(FEAT_SPELL_PENETRATION, oCaster))
|
||||
{
|
||||
nCasterLevel = nCasterLevel + 2;
|
||||
}
|
||||
|
||||
// Adds any special amounts you might want to add to the check, useful if you want to
|
||||
// do something like have a staff or scepter of penetrating spell resistance, or a special
|
||||
// feat that adds a special bonus to the caster's checks to beat spell resistance.
|
||||
nCasterLevel = nCasterLevel + ExecuteScriptAndReturnInt("add_spell_penetr", oCaster);
|
||||
|
||||
|
||||
int nRolled = d20(1);
|
||||
// d&d 3.0E PHB page 150: caster's check (d20 + caster level) must equal or exceed target's SR
|
||||
// for the spell to affect it. So the spell only fails if that check is LESS than the sr,
|
||||
// and succeeds if it's equal or greater.
|
||||
|
||||
if(nCasterLevel + nRolled < nTargetSR) // Do the actual spell resistance check.
|
||||
{
|
||||
nResist = 1; // <- This is what kills the spell.
|
||||
toSay = (IntToString(nRolled) + " + " + IntToString(nCasterLevel) + " = "
|
||||
+ IntToString(nRolled + nCasterLevel) + " vs. Spell Resistance " + IntToString(nTargetSR)
|
||||
+ " : Resisted Spell. ");
|
||||
}
|
||||
else
|
||||
{
|
||||
toSay = (IntToString(nRolled) + " + " + IntToString(nCasterLevel) + " = "
|
||||
+ IntToString(nRolled + nCasterLevel) + " vs. Spell Resistance " + IntToString(nTargetSR)
|
||||
+ " : Spell Resistance Defeated. ");
|
||||
}
|
||||
// A touch I thought I'd add in, since it's possible now. Caster and Target get
|
||||
// to see the roll. :) They only see it if the spell hits or is defeated by SR.
|
||||
//
|
||||
DelayCommand(fDelay, SendMessageToPC(oCaster, toSay));
|
||||
DelayCommand(fDelay, SendMessageToPC(oTarget, toSay));
|
||||
|
||||
}// end of check for if target has SR
|
||||
|
||||
|
||||
if(nResist == 0) // I don't want it to run the Resist Spell function if SR wasn't penetrated
|
||||
{ // or if the target was already getting passed over, or it could waste some
|
||||
// of the target's spell mantle unnecessarily.
|
||||
|
||||
// The downside is that globes of invulnerability also aren't tested against
|
||||
// if sr isn't penetrated, only if it is.
|
||||
// ie. if both a globe and SR stop a spell, the globe vfx won't fire, only
|
||||
// the SR vfx.
|
||||
|
||||
int nOtherReason = ResistSpell(oCaster, oTarget);
|
||||
switch(nOtherReason)
|
||||
{
|
||||
case 2: nResist = 2;break; // Spell stopped by globe
|
||||
case 3: nResist = 3;break; // Spell stopped by spell mantle.
|
||||
}
|
||||
|
||||
}// end of check for globes of invulnerability, and spell mantles.
|
||||
}// end of original if(nResist == 0) check much earlier. Yeah, there's 2 of them.
|
||||
|
||||
|
||||
|
||||
effect eSR = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
|
||||
effect eGlobe = EffectVisualEffect(VFX_IMP_GLOBE_USE);
|
||||
effect eMantle = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
|
||||
|
||||
if(nResist == 1) //Spell Resistance
|
||||
{
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
|
||||
|
||||
}
|
||||
else if(nResist == 2) //Globe
|
||||
{
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
|
||||
}
|
||||
else if(nResist == 3) //Spell Mantle
|
||||
{
|
||||
if (fDelay > 0.5)
|
||||
{
|
||||
fDelay = fDelay - 0.1;
|
||||
}
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
|
||||
}
|
||||
return nResist;
|
||||
}
|
||||
// End of MyPRCResistSpell. :) the longest function in this file.
|
||||
|
||||
|
||||
|
||||
// This function was scrapped, in favor of the other elemental damage modifying function.
|
||||
// It lacked too much in versatility.
|
||||
/*
|
||||
effect PRCElementalDamage(object oCaster, int nDamage, int nType, int nDamagePower = DAMAGE_POWER_NORMAL)
|
||||
{
|
||||
|
||||
int nNewType = ExecuteScriptAndReturnInt("set_damage_type", oCaster);
|
||||
if(nNewType != 0)
|
||||
{
|
||||
nType = nNewType;
|
||||
}
|
||||
return EffectDamage(nDamage, nType, nDamagePower);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/// used to get the +1 ECL caster level amount of a PRC
|
||||
/// uses ExecuteScriptAndReturnInt() to get the amount of +1 ECL levels
|
||||
/// that should be added to the spell's casting class due to a PRC
|
||||
/// the script is called "prc_caster_level"
|
||||
int GetChangesToCasterLevel(object oCaster)
|
||||
{
|
||||
int nLevelAdded = ExecuteScriptAndReturnInt("prc_caster_level", oCaster);
|
||||
return nLevelAdded;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// used to get additional modifications a DM may want made to a spell's save DC
|
||||
/// uses ExecuteScriptAndReturnInt to decide if the save DC of the caster's spell
|
||||
/// should be changed. The script is called "add_spell_dc"
|
||||
|
||||
int GetChangesToSaveDC(object oCaster)
|
||||
{
|
||||
return ExecuteScriptAndReturnInt("add_spell_dc", oCaster);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// uses ExecuteScriptAndReturnInt to decide whether the type
|
||||
// of elemental damage a spell does should be changed. Mind you, the vfx for
|
||||
// an elemental spell will stay the same, only the damage type will change.
|
||||
// the script being executed is called "set_damage_type"
|
||||
|
||||
int ChangedElementalDamage(object oCaster, int nDamageType)
|
||||
{
|
||||
int nNewType = ExecuteScriptAndReturnInt("set_damage_type", oCaster);
|
||||
if(nNewType != 0)
|
||||
{
|
||||
nDamageType = nNewType;
|
||||
}
|
||||
return nDamageType;
|
||||
}
|
||||
|
||||
44
_removed/prc_at_legerdem.nss
Normal file
44
_removed/prc_at_legerdem.nss
Normal file
@@ -0,0 +1,44 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Ranged Legerdemain
|
||||
//:: prc_at_legerdem.nss
|
||||
//:://////////////////////////////////////////////
|
||||
//::
|
||||
//:: Allows caster to use skills at a range
|
||||
//:: of up to 30 feet.
|
||||
//::
|
||||
//:://///////////////////////////
|
||||
//:: Created By: James Tallett
|
||||
//:: Created On: Mar 4, 2004
|
||||
//::////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "prc_alterations"
|
||||
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//Declare major variables
|
||||
int nDC;
|
||||
object oCaster = OBJECT_SELF;
|
||||
object oLock = GetSpellTargetObject();
|
||||
int nType = GetObjectType(oLock);
|
||||
if (OBJECT_TYPE_DOOR == nType || OBJECT_TYPE_PLACEABLE == nType)
|
||||
{
|
||||
if (GetDistanceToObject(oLock) <= 30.0)
|
||||
{
|
||||
nDC = GetLockUnlockDC(oLock);
|
||||
nDC = nDC + 5;
|
||||
if (GetIsSkillSuccessful(oCaster, SKILL_OPEN_LOCK, nDC))
|
||||
{
|
||||
SetLocked(oLock, FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
248
_removed/prc_caster_level.nss
Normal file
248
_removed/prc_caster_level.nss
Normal file
@@ -0,0 +1,248 @@
|
||||
#include "prc_dg_inc"
|
||||
#include "strat_prc_inc"
|
||||
#include "discipleinclude"
|
||||
#include "inc_prc_function"
|
||||
#include "heartward_inc"
|
||||
#include "lookup_2da_spell"
|
||||
|
||||
//Added code to correct problems in Hierophant spell-like abilities.
|
||||
//Aaon Graywolf - 6 Jan 2004
|
||||
|
||||
int bArcane(int nCastingClass);
|
||||
int bDivine(int nCastingClass);
|
||||
int bIsFirstArcaneClass(int nCastingClass, object oCaster = OBJECT_SELF);
|
||||
int bIsFirstDivineClass(int nCastingClass, object oCaster = OBJECT_SELF);
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
// prevents any prc levels from being added to the cast level of a wand or scroll.
|
||||
if(GetSpellCastItem() != OBJECT_INVALID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
object oCaster = OBJECT_SELF;
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// This is the section where you declare any + 1 caster level prc's and the amount
|
||||
// of casting levels they should add
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
// Determine how many caster levels of Pale Master are added to oCaster's arcane spells.
|
||||
int nPaleMasterLevels = GetLevelByClass(CLASS_TYPE_PALEMASTER, oCaster);
|
||||
if(nPaleMasterLevels > 0) nPaleMasterLevels = (nPaleMasterLevels - 1) / 2 + 1;
|
||||
|
||||
/******************* DarkGod PrC ********************/
|
||||
|
||||
/* Archmages */
|
||||
int nArchmageLevels = GetLevelByClass(CLASS_TYPE_ARCHMAGE, oCaster);
|
||||
|
||||
/* Spell Power feats */
|
||||
int nSpellPowerLevels = 0;
|
||||
if (GetHasFeat(FEAT_SPELL_POWER_V)) nSpellPowerLevels = 5;
|
||||
else if (GetHasFeat(FEAT_SPELL_POWER_IV)) nSpellPowerLevels = 4;
|
||||
else if (GetHasFeat(FEAT_SPELL_POWER_III)) nSpellPowerLevels = 3;
|
||||
else if (GetHasFeat(FEAT_SPELL_POWER_II)) nSpellPowerLevels = 2;
|
||||
else if (GetHasFeat(FEAT_SPELL_POWER_I)) nSpellPowerLevels = 1;
|
||||
|
||||
/* Oozemasters */
|
||||
int nOozemasterLevels = GetLevelByClass(CLASS_TYPE_OOZEMASTER, oCaster) / 2;
|
||||
|
||||
/******************* Stratovarius PrC ********************/
|
||||
|
||||
int nMageKillerLevels = GetLevelByClass(CLASS_TYPE_MAGEKILLER, oCaster);
|
||||
int nHarperLevels = GetLevelByClass(CLASS_TYPE_HARPERMAGE, oCaster);
|
||||
int nSpellswordLevels = GetLevelByClass(CLASS_TYPE_SPELLSWORD, oCaster) / 2;
|
||||
int nAcolyteLevels = GetLevelByClass(CLASS_TYPE_ACOLYTE, oCaster) / 2;
|
||||
int nEldritchLevels = GetLevelByClass(CLASS_TYPE_ELDRITCH_KNIGHT, oCaster);
|
||||
int nFireLevels = GetLevelByClass(CLASS_TYPE_ES_FIRE, oCaster);
|
||||
int nColdLevels = GetLevelByClass(CLASS_TYPE_ES_COLD, oCaster);
|
||||
int nElecLevels = GetLevelByClass(CLASS_TYPE_ES_ELEC, oCaster);
|
||||
int nAcidLevels = GetLevelByClass(CLASS_TYPE_ES_ACID, oCaster);
|
||||
int nMastHarpLevels = GetLevelByClass(CLASS_TYPE_MASTER_HARPER, oCaster);
|
||||
int nFireAdept = GetHasFeat(FEAT_FIRE_ADEPT, oCaster);
|
||||
|
||||
|
||||
int nHeartWLevels = GetLevelByClass(CLASS_TYPE_HEARTWARDER, oCaster);
|
||||
int nStormlord = GetLevelByClass(CLASS_TYPE_STORMLORD, oCaster);
|
||||
int nFistRaziel = GetLevelByClass(CLASS_TYPE_FISTRAZIEL, oCaster);
|
||||
int nMasterShroud = GetLevelByClass(CLASS_TYPE_MASTER_OF_SHROUDS, oCaster);
|
||||
int nHospitaler = GetLevelByClass(CLASS_TYPE_HOSPITALER, oCaster);
|
||||
|
||||
|
||||
/******************* True Necromancer ********************/
|
||||
|
||||
int nTrueNecroArcLevels;
|
||||
int nTrueNecroDivLevels;
|
||||
int nTrueNecroLevels;
|
||||
nTrueNecroLevels = GetLevelByClass(CLASS_TYPE_TRUENECRO, oCaster);
|
||||
string school = lookup_spell_school(GetSpellId());
|
||||
if (school == "N")
|
||||
{
|
||||
nTrueNecroArcLevels = GetLevelByClass(CLASS_TYPE_CLERIC, oCaster);
|
||||
nTrueNecroDivLevels = GetLevelByClass(CLASS_TYPE_WIZARD, oCaster);
|
||||
nTrueNecroDivLevels = nTrueNecroLevels + nTrueNecroDivLevels;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// INSTRUCTIONS
|
||||
//
|
||||
// If you want to add more +1 caster level prc's, declare them above
|
||||
// and sort out the exact number of caster levels each one should add
|
||||
// then add that amount to the appropriate category below.
|
||||
// -> either add the amount to nArcaneCastLevels or to nDivineCastLevels, depending
|
||||
// on which kind of class it affects.
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
int nArcaneCastLevels = nArchmageLevels +
|
||||
nSpellPowerLevels +
|
||||
nMageKillerLevels +
|
||||
nAcolyteLevels +
|
||||
nEldritchLevels +
|
||||
nHarperLevels +
|
||||
nSpellswordLevels +
|
||||
nFireLevels + nAcidLevels + nColdLevels + nElecLevels +
|
||||
nPaleMasterLevels + nFireAdept +
|
||||
nMastHarpLevels +
|
||||
nTrueNecroLevels +
|
||||
nTrueNecroArcLevels; // + n<levels from any other arcane prc you define>;
|
||||
|
||||
int nDivineCastLevels = nHeartWLevels +
|
||||
nStormlord +
|
||||
nFistRaziel +
|
||||
nMasterShroud +
|
||||
nHospitaler +
|
||||
nTrueNecroDivLevels; // + n<levels from any divine prc you define>;
|
||||
|
||||
/* Find which class to add levels to for Oozemasters */
|
||||
if (bArcane(GetClassByPosition(1, oCaster)) || bDivine(GetClassByPosition(1, oCaster)))
|
||||
{
|
||||
if (bArcane(GetClassByPosition(1, oCaster)))
|
||||
nArcaneCastLevels += nOozemasterLevels;
|
||||
else if (bDivine(GetClassByPosition(1, oCaster)))
|
||||
nDivineCastLevels += nOozemasterLevels;
|
||||
}
|
||||
else if (bArcane(GetClassByPosition(2, oCaster)) || bDivine(GetClassByPosition(2, oCaster)))
|
||||
{
|
||||
if (bArcane(GetClassByPosition(2, oCaster)))
|
||||
nArcaneCastLevels += nOozemasterLevels;
|
||||
else if (bDivine(GetClassByPosition(2, oCaster)))
|
||||
nDivineCastLevels += nOozemasterLevels;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// This is the end of the section where you declare any +1 caster level prc's -
|
||||
//
|
||||
// - so there shouldn't be any need to alter any lines of code below this line if all
|
||||
// you're trying to do is add more prc classes.
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int nCastingClass = GetLastSpellCastClass();
|
||||
|
||||
if(bArcane(nCastingClass) && nArcaneCastLevels)
|
||||
// Making sure they are using an arcane class, and there is something to be added.
|
||||
{
|
||||
if(bIsFirstArcaneClass(nCastingClass))
|
||||
// determine whether nCastingClass is their first arcane class.
|
||||
{
|
||||
int nToReturn = nArcaneCastLevels;
|
||||
SetLocalInt(oCaster,"X2_L_LAST_RETVAR", nToReturn);
|
||||
}
|
||||
}
|
||||
else if(bDivine(nCastingClass) && nDivineCastLevels)
|
||||
// Making sure they are using a divine class, and there is something to be added.
|
||||
{
|
||||
if(bIsFirstDivineClass(nCastingClass))
|
||||
// determine whether nCastingClass is their first divine class.
|
||||
{
|
||||
int nToReturn = nDivineCastLevels;
|
||||
SetLocalInt(oCaster,"X2_L_LAST_RETVAR", nToReturn);
|
||||
}
|
||||
}
|
||||
//Hierophant spell-like abilities should be cast using Cleric level, not Hierophant level
|
||||
else if(GetWasLastSpellHieroSLA())
|
||||
{
|
||||
int nToReturn = GetLevelByClass(CLASS_TYPE_CLERIC, OBJECT_SELF) - GetLevelByClass(CLASS_TYPE_HIEROPHANT, OBJECT_SELF);
|
||||
SetLocalInt(oCaster,"X2_L_LAST_RETVAR", nToReturn);
|
||||
}
|
||||
|
||||
|
||||
}// end void main
|
||||
|
||||
|
||||
// Determines whether a given class is one of the 3 arcane base classes
|
||||
int bArcane(int nCastingClass)
|
||||
{
|
||||
switch(nCastingClass)
|
||||
{
|
||||
case CLASS_TYPE_WIZARD: return TRUE; break;
|
||||
case CLASS_TYPE_SORCERER: return TRUE; break;
|
||||
case CLASS_TYPE_BARD: return TRUE; break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// Determines whether a given class is one of the 2 divine base classes.
|
||||
// I'm not sure if Paladin or Ranger can be used, so I commented them out, but you can
|
||||
// feel free to uncomment them if you discover that they can be used.
|
||||
int bDivine(int nCastingClass)
|
||||
{
|
||||
switch(nCastingClass)
|
||||
{
|
||||
case CLASS_TYPE_CLERIC: return TRUE; break;
|
||||
case CLASS_TYPE_DRUID: return TRUE; break;
|
||||
//case CLASS_TYPE_PALADIN: return TRUE; break; // I'm not sure if the +1 Caster Level spell progression
|
||||
//case CLASS_TYPE_RANGER: return TRUE; break; // works for Rangers or Paladins, so they're commented out
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// This function's job is just to make sure that if the character has 2 arcane classes, they
|
||||
// aren't using the second one to cast the spell
|
||||
|
||||
int bIsFirstArcaneClass(int nCastingClass, object oCaster = OBJECT_SELF)
|
||||
{
|
||||
int nFirstClass = GetClassByPosition(1, oCaster);
|
||||
if(nFirstClass == nCastingClass || !bArcane(nFirstClass))
|
||||
// If the first character class isn't arcane, then the second one must be or the
|
||||
// character could never have taken any levels in a +1 casting level arcane prc to
|
||||
// begin with, so there's no need to screen for that.
|
||||
// It HAS to be the case
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}// end function
|
||||
|
||||
|
||||
// This function's job is just to make sure that if the character has 2 divine classes, they
|
||||
// aren't using the second one to cast the spell
|
||||
|
||||
int bIsFirstDivineClass(int nCastingClass, object oCaster = OBJECT_SELF)
|
||||
{
|
||||
int nFirstClass = GetClassByPosition(1, oCaster);
|
||||
if(nFirstClass == nCastingClass || !bDivine(nFirstClass))
|
||||
// If the first character class isn't divine, then the second one must be or the
|
||||
// character could never have taken any levels in a +1 casting level divine prc to
|
||||
// begin with, so there's no need to screen for that.
|
||||
// It HAS to be the case
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}// end function
|
||||
21
_removed/prc_dg_inc.nss
Normal file
21
_removed/prc_dg_inc.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
int CLASS_TYPE_ARCHMAGE = 100; /* Archmage PrC */
|
||||
const int FEAT_MASTERY_SHAPES = 3006; /* Mastery of Shaping feat */
|
||||
const int FEAT_SPELL_POWER_I = 3007; /* Spell Power */
|
||||
const int FEAT_SPELL_POWER_II = 3008; /* Spell Power */
|
||||
const int FEAT_SPELL_POWER_III = 3009; /* Spell Power */
|
||||
const int FEAT_SPELL_POWER_IV = 3010; /* Spell Power */
|
||||
const int FEAT_SPELL_POWER_V = 3011; /* Spell Power */
|
||||
const int FEAT_ARCANE_FIRE = 3012; /* Arcane Fire */
|
||||
const int FEAT_SPELL_LIKE = 3013; /* Spell-Like */
|
||||
|
||||
int CLASS_TYPE_OOZEMASTER = 101; /* Oozemaster PrC */
|
||||
const int FEAT_MIN_OOZY_TOUCH_BROWN = 3020; /* Oozy: Brown Mold */
|
||||
const int FEAT_MIN_OOZY_TOUCH_GRAY = 3021; /* Oozy: Gray Ooze */
|
||||
const int FEAT_MIN_OOZY_TOUCH_OCHRE = 3022; /* Oozy: Ochre Jelly */
|
||||
const int FEAT_MIN_OOZY_TOUCH_FUNGUS = 3023; /* Oozy: Fungus */
|
||||
const int FEAT_INDISCERNIBLE_ANATOMY = 3033;
|
||||
const int FEAT_CHARISMA_PENALITY = 3034;
|
||||
const int FEAT_ONE_WITH_THE_OOZE = 3035;
|
||||
|
||||
const int SPELL_SLIME_WAVE = 2023;
|
||||
|
||||
39
_removed/prc_discmeph.nss
Normal file
39
_removed/prc_discmeph.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Disciple of Mephistopheles Feats]
|
||||
//:: [prc_elemsavant.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Disciple of Mephistopheles feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Attilla. Modified by Aaon Graywolf
|
||||
//:: Created On: Jan 8, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
#include "prc_dg_inc"
|
||||
#include "discipleinclude"
|
||||
|
||||
// * Applies the Disciple of Mephistopheles's resistances on the object's skin.
|
||||
// * iLevel = IP_CONST_DAMAGERESIST_*
|
||||
void ElemSavantResist(object oPC, object oSkin, int iLevel)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "DiscMephResist") == iLevel) return;
|
||||
|
||||
RemoveSpecificProperty(oSkin, ITEM_PROPERTY_DAMAGE_RESISTANCE,IP_CONST_DAMAGETYPE_FIRE, iLevel, 1, "DiscMephResist");
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, iLevel), oSkin);
|
||||
SetLocalInt(oSkin, "DiscMephResist", iLevel);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
|
||||
int iResist = GetHasFeat(FEAT_FIRE_RESISTANCE_10, oPC) ? IP_CONST_DAMAGERESIST_10 : -1;
|
||||
iResist = GetHasFeat(FEAT_FIRE_RESISTANCE_10, oPC) ? IP_CONST_DAMAGERESIST_20 : iResist;
|
||||
|
||||
//Apply bonuses accordingly
|
||||
if(iResist > -1) ElemSavantResist(oPC, oSkin, iResist);
|
||||
}
|
||||
135
_removed/prc_duelist.nss
Normal file
135
_removed/prc_duelist.nss
Normal file
@@ -0,0 +1,135 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Duelist Feats]
|
||||
//:: [prc_duelist.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Duelist feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 20, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
|
||||
// * Applies the Duelist's AC bonuses as CompositeBonuses on the object's skin.
|
||||
// * AC bonus is determined by object's int bonus (2x int bonus if epic)
|
||||
// * iOnOff = TRUE/FALSE
|
||||
// * iEpic = TRUE/FALSE
|
||||
void DuelistCannyDefense(object oPC, object oSkin, int iOnOff, int iEpic = FALSE)
|
||||
{
|
||||
int iIntBonus = GetAbilityModifier(ABILITY_INTELLIGENCE, oPC);
|
||||
iIntBonus = iEpic ? iIntBonus * 2 : iIntBonus;
|
||||
|
||||
if(iOnOff){
|
||||
SetCompositeBonus(oSkin, "CannyDefenseBonus", iIntBonus, ITEM_PROPERTY_AC_BONUS);
|
||||
if(GetLocalInt(oPC, "CannyDefense") != TRUE)
|
||||
FloatingTextStringOnCreature("Canny Defense On", oPC);
|
||||
SetLocalInt(oPC, "CannyDefense", TRUE);
|
||||
}
|
||||
else {
|
||||
SetCompositeBonus(oSkin, "CannyDefenseBonus", 0, ITEM_PROPERTY_AC_BONUS);
|
||||
if(GetLocalInt(oPC, "CannyDefense") != FALSE)
|
||||
FloatingTextStringOnCreature("Canny Defense Off", oPC);
|
||||
SetLocalInt(oPC, "CannyDefense", FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// * Applies the Duelist's reflex bonuses as CompositeBonuses on the object's skin.
|
||||
// * iLevel = integer reflex save bonus
|
||||
void DuelistGrace(object oPC, object oSkin, int iLevel)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "GraceBonus") == iLevel) return;
|
||||
|
||||
if(iLevel > 0){
|
||||
SetCompositeBonus(oSkin, "GraceBonus", iLevel, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC, IP_CONST_SAVEBASETYPE_REFLEX);
|
||||
if(GetLocalInt(oPC, "Grace") != TRUE)
|
||||
FloatingTextStringOnCreature("Grace On", oPC);
|
||||
SetLocalInt(oPC, "Grace", TRUE);
|
||||
}
|
||||
else {
|
||||
SetCompositeBonus(oSkin, "GraceBonus", 0, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC, IP_CONST_SAVEBASETYPE_REFLEX);
|
||||
if(GetLocalInt(oPC, "Grace") != FALSE)
|
||||
FloatingTextStringOnCreature("Grace Off", oPC);
|
||||
SetLocalInt(oPC, "Grace", FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// * Applies the Duelist's parry skill bonuses as CompositeBonuses on the object's skin.
|
||||
// * Bonus is determined by object's Duelist level
|
||||
void DuelistElaborateParry(object oPC, object oSkin)
|
||||
{
|
||||
int iClassBonus = GetLevelByClass(CLASS_TYPE_DUELIST, oPC);
|
||||
if(GetLocalInt(oSkin, "ElaborateParryBonus") == iClassBonus) return;
|
||||
|
||||
SetCompositeBonus(oSkin, "ElaborateParryBonus", iClassBonus, ITEM_PROPERTY_SKILL_BONUS, SKILL_PARRY);
|
||||
}
|
||||
|
||||
// * Applies the Duelist's damage bonuses on the object's main hand weapon.
|
||||
// * iPStrkLevel = 1 (1D6), 2 (2D6) or 0 (off)
|
||||
void DuelistPreciseStrike(object oPC, object oWeap, int iPStrkLevel)
|
||||
{
|
||||
int iDamBonus = 0;
|
||||
|
||||
if(iPStrkLevel == 1) iDamBonus = IP_CONST_DAMAGEBONUS_1d6;
|
||||
if(iPStrkLevel == 2) iDamBonus = IP_CONST_DAMAGEBONUS_2d6;
|
||||
|
||||
if(iPStrkLevel > 0){
|
||||
if(GetLocalInt(oWeap, "PStrkBonus") != iDamBonus){
|
||||
DuelistRemovePreciseStrike(oWeap);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_SLASHING, iDamBonus), oWeap);
|
||||
SetLocalInt(oWeap, "PStrkBonus", iDamBonus);
|
||||
}
|
||||
|
||||
if(GetLocalInt(oPC, "PreciseStrike") != TRUE)
|
||||
FloatingTextStringOnCreature("Precise Strike On", oPC);
|
||||
SetLocalInt(oPC, "PreciseStrike", TRUE);
|
||||
}
|
||||
else {
|
||||
//The actual removal of the bonus is handled in the module's unequip script
|
||||
//This section simply alerts the player that the bonus has been turned off
|
||||
if(GetLocalInt(oPC, "PreciseStrike") != FALSE)
|
||||
FloatingTextStringOnCreature("Precise Strike Off", oPC);
|
||||
SetLocalInt(oPC, "PreciseStrike", FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
|
||||
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
|
||||
|
||||
//Determine which duelist feats the character has
|
||||
int bCanDef = GetHasFeat(FEAT_CANNY_DEFENSE, oPC);
|
||||
int bEpicCD = GetHasFeat(FEAT_EPIC_DUELIST, oPC);
|
||||
int bPStrk = GetHasFeat(FEAT_PRECISE_STRIKE_1d6, oPC) ? 1 : 0;
|
||||
bPStrk = GetHasFeat(FEAT_PRECISE_STRIKE_2d6, oPC) ? 2 : bPStrk;
|
||||
int bGrace = GetHasFeat(FEAT_GRACE_2, oPC) ? 2 : 0;
|
||||
bGrace = GetHasFeat(FEAT_GRACE_4, oPC) ? 4 : bGrace;
|
||||
bGrace = GetHasFeat(FEAT_GRACE_6, oPC) ? 6 : bGrace;
|
||||
bGrace = GetHasFeat(FEAT_GRACE_8, oPC) ? 8 : bGrace;
|
||||
bGrace = GetHasFeat(FEAT_GRACE_10, oPC) ? 10 : bGrace;
|
||||
int bElabPr = GetHasFeat(FEAT_ELABORATE_PARRY, oPC);
|
||||
|
||||
//Apply bonuses accordingly
|
||||
if(bCanDef > 0 && GetBaseAC(oArmor) == 0)
|
||||
DuelistCannyDefense(oPC, oSkin, TRUE, bEpicCD);
|
||||
else
|
||||
DuelistCannyDefense(oPC, oSkin, FALSE);
|
||||
|
||||
if(bPStrk > 0 && (GetBaseItemType(oWeapon) == BASE_ITEM_RAPIER || GetBaseItemType(oWeapon) == BASE_ITEM_DAGGER))
|
||||
DuelistPreciseStrike(oPC, oWeapon, bPStrk);
|
||||
else
|
||||
DuelistPreciseStrike(oPC, oWeapon, 0);
|
||||
|
||||
if(bGrace > 0 && GetBaseAC(oArmor) == 0)
|
||||
DuelistGrace(oPC, oSkin, bGrace);
|
||||
else
|
||||
DuelistGrace(oPC, oSkin, 0);
|
||||
|
||||
if(bElabPr > 0) DuelistElaborateParry(oPC, oSkin);
|
||||
|
||||
}
|
||||
87
_removed/prc_elemsavant.nss
Normal file
87
_removed/prc_elemsavant.nss
Normal file
@@ -0,0 +1,87 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Elemental Savant Feats]
|
||||
//:: [prc_elemsavant.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Elemental Savant feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Stratovarius. Modified by Aaon Graywolf
|
||||
//:: Created On: Jan 6, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
#include "prc_dg_inc"
|
||||
|
||||
// * Applies the Elemental Savant's immunities on the object's skin.
|
||||
// * iType = IP_CONST_IMMUNITYMISC_*
|
||||
// * sFlag = Flag to check whether the property has already been added
|
||||
void ElemSavantImmunity(object oPC, object oSkin, int iType, string sFlag)
|
||||
{
|
||||
if(GetLocalInt(oSkin, sFlag) == TRUE) return;
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(iType), oSkin);
|
||||
SetLocalInt(oSkin, sFlag, TRUE);
|
||||
}
|
||||
|
||||
// * Applies the Elemental Savant's resistances on the object's skin.
|
||||
// * iElem = IP_CONST_DAMAGETYPE_*
|
||||
// * iLevel = IP_CONST_DAMAGERESIST_*
|
||||
void ElemSavantResist(object oPC, object oSkin, int iElem, int iLevel)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "ElemSavantResist") == iLevel) return;
|
||||
|
||||
RemoveSpecificProperty(oSkin, ITEM_PROPERTY_DAMAGE_RESISTANCE, iElem, iLevel, 1, "ElemSavantResist");
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageResistance(iElem, iLevel), oSkin);
|
||||
SetLocalInt(oSkin, "ElemSavantResist", iLevel);
|
||||
}
|
||||
|
||||
// * Applies the Elemental Savant's perfections bonuses on the object's skin.
|
||||
// * Immunity to Poison, Backstab, Disease and Critical Hits
|
||||
// * 100% immunity to iElem, 100% vulnerability to opposite of iElem
|
||||
// * iElem = IP_CONST_DAMAGETYPE_*
|
||||
void ElemSavantPerfection(object oPC, object oSkin, int iElem)
|
||||
{
|
||||
if(GetLocalInt(oSkin, "ElemSavantPerfection") == TRUE) return;
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageImmunity(iElem, IP_CONST_DAMAGEIMMUNITY_100_PERCENT), oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDamageVulnerability(GetOppositeElement(iElem), IP_CONST_DAMAGEVULNERABILITY_100_PERCENT), oSkin);
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON), oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DISEASE), oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB), oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS), oSkin);
|
||||
|
||||
SetLocalInt(oSkin, "ElemSavantPerfection", TRUE);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
int iElement;
|
||||
|
||||
//Determine which Elemental Savant feats the character has
|
||||
if(GetHasFeat(FEAT_ES_FIRE, oPC)) iElement = IP_CONST_DAMAGETYPE_FIRE;
|
||||
if(GetHasFeat(FEAT_ES_COLD, oPC)) iElement = IP_CONST_DAMAGETYPE_COLD;
|
||||
if(GetHasFeat(FEAT_ES_ACID, oPC)) iElement = IP_CONST_DAMAGETYPE_ACID;
|
||||
if(GetHasFeat(FEAT_ES_ELEC, oPC)) iElement = IP_CONST_DAMAGETYPE_ELECTRICAL;
|
||||
|
||||
int iResist = GetHasFeat(FEAT_ES_RESIST_1, oPC) ? IP_CONST_DAMAGERESIST_5 : -1;
|
||||
iResist = GetHasFeat(FEAT_ES_RESIST_2, oPC) ? IP_CONST_DAMAGERESIST_10 : iResist;
|
||||
iResist = GetHasFeat(FEAT_ES_RESIST_3, oPC) ? IP_CONST_DAMAGERESIST_15 : iResist;
|
||||
|
||||
int iTrans1 = GetHasFeat(FEAT_ES_TRANS_1, oPC);
|
||||
int iTrans2 = GetHasFeat(FEAT_ES_TRANS_2, oPC);
|
||||
int iTrans3 = GetHasFeat(FEAT_ES_TRANS_3, oPC);
|
||||
|
||||
int iPerfect = GetHasFeat(FEAT_ES_PERFECTION, oPC);
|
||||
|
||||
//Apply bonuses accordingly
|
||||
if(iResist > -1) ElemSavantResist(oPC, oSkin, iElement, iResist);
|
||||
if(iTrans1) ElemSavantImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_MINDSPELLS, "ElemSavantImmMind");
|
||||
if(iTrans2) ElemSavantImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_PARALYSIS, "ElemSavantImmParal");
|
||||
if(iTrans3) ElemSavantImmunity(oPC, oSkin, IMMUNITY_TYPE_SLEEP, "ElemSavantImmSleep");
|
||||
if(iPerfect) ElemSavantPerfection(oPC, oSkin, iElement);
|
||||
}
|
||||
82
_removed/prc_equip.nss
Normal file
82
_removed/prc_equip.nss
Normal file
@@ -0,0 +1,82 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Example XP2 OnItemEquipped
|
||||
//:: x2_mod_def_equ
|
||||
//:: (c) 2003 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Put into: OnEquip Event
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Georg Zoeller
|
||||
//:: Created On: 2003-07-16
|
||||
//:://////////////////////////////////////////////
|
||||
#include "x2_inc_switches"
|
||||
#include "x2_inc_intweapon"
|
||||
#include "strat_prc_inc"
|
||||
#include "inc_prc_function"
|
||||
|
||||
void PrcFeats(object oPC)
|
||||
{
|
||||
SetLocalInt(oPC,"ONEQUIP",2);
|
||||
EvalPRCFeats(oPC);
|
||||
DeleteLocalInt(oPC,"ONEQUIP");
|
||||
}
|
||||
|
||||
//Added hook into EvalPRCFeats event
|
||||
// Aaon Graywolf - 6 Jan 2004
|
||||
//Added delay to EvalPRCFeats event to allow module setup to take priority
|
||||
// Aaon Graywolf - Jan 6, 2004
|
||||
|
||||
void main()
|
||||
{
|
||||
object oItem = GetPCItemLastEquipped();
|
||||
object oPC = GetPCItemLastEquippedBy();
|
||||
// -------------------------------------------------------------------------
|
||||
// Intelligent Weapon System
|
||||
// -------------------------------------------------------------------------
|
||||
if (IPGetIsIntelligentWeapon(oItem))
|
||||
{
|
||||
IWSetIntelligentWeaponEquipped(oPC,oItem);
|
||||
// prevent players from reequipping their weapon in
|
||||
if (IWGetIsInIntelligentWeaponConversation(oPC))
|
||||
{
|
||||
object oConv = GetLocalObject(oPC,"X2_O_INTWEAPON_SPIRIT");
|
||||
IWEndIntelligentWeaponConversation(oConv, oPC);
|
||||
}
|
||||
else
|
||||
{
|
||||
//------------------------------------------------------------------
|
||||
// Trigger Drain Health Event
|
||||
//------------------------------------------------------------------
|
||||
if (GetLocalInt(oPC,"X2_L_ENSERRIC_ASKED_Q3")==1)
|
||||
{
|
||||
ExecuteScript ("x2_ens_dodrain",oPC);
|
||||
}
|
||||
else
|
||||
{
|
||||
IWPlayRandomEquipComment(oPC,oItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Generic Item Script Execution Code
|
||||
// If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
|
||||
// it will execute a script that has the same name as the item's tag
|
||||
// inside this script you can manage scripts for all events by checking against
|
||||
// GetUserDefinedItemEventNumber(). See x2_it_example.nss
|
||||
// -------------------------------------------------------------------------
|
||||
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
|
||||
{
|
||||
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_EQUIP);
|
||||
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
|
||||
if (nRet == X2_EXECUTE_SCRIPT_END)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DelayCommand(0.5,PrcFeats(oPC));
|
||||
|
||||
}
|
||||
109
_removed/prc_heartwarder.nss
Normal file
109
_removed/prc_heartwarder.nss
Normal file
@@ -0,0 +1,109 @@
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
#include "prc_dg_inc"
|
||||
#include "heartward_inc"
|
||||
|
||||
//// bonus CHA ////
|
||||
void CharBonus(object oPC ,object oSkin ,int iLevel)
|
||||
{
|
||||
|
||||
if(GetLocalInt(oSkin, "HeartWardCharBonus") == iLevel) return;
|
||||
|
||||
SetCompositeBonus(oSkin, "HeartWardCharBonus", iLevel, ITEM_PROPERTY_ABILITY_BONUS,IP_CONST_ABILITY_CHA);
|
||||
|
||||
}
|
||||
|
||||
/// +2 on CHA based skill /////////
|
||||
void Heart_Passion(object oPC ,object oSkin ,int iLevel)
|
||||
{
|
||||
|
||||
if(GetLocalInt(oSkin, "HeartPassion") == iLevel) return;
|
||||
|
||||
SetCompositeBonus(oSkin, "HeartPassionA", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_ANIMAL_EMPATHY);
|
||||
SetCompositeBonus(oSkin, "HeartPassionP", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_PERFORM);
|
||||
SetCompositeBonus(oSkin, "HeartPassionPe", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_PERSUADE);
|
||||
SetCompositeBonus(oSkin, "HeartPassionT", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_TAUNT);
|
||||
SetCompositeBonus(oSkin, "HeartPassionUMD", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_USE_MAGIC_DEVICE);
|
||||
SetCompositeBonus(oSkin, "HeartPassionB", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_BLUFF);
|
||||
SetCompositeBonus(oSkin, "HeartPassionI", iLevel, ITEM_PROPERTY_SKILL_BONUS,SKILL_INTIMIDATE);
|
||||
|
||||
}
|
||||
|
||||
//// subtype Fey ////
|
||||
void Fey_Type(object oPC ,object oSkin )
|
||||
{
|
||||
if(GetLocalInt(oSkin, "FeyType") == 1) return;
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertySpellImmunitySpecific(IP_CONST_IMMUNITYSPELL_CHARM_PERSON),oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertySpellImmunitySpecific(IP_CONST_IMMUNITYSPELL_DOMINATE_PERSON),oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertySpellImmunitySpecific(IP_CONST_IMMUNITYSPELL_HOLD_PERSON),oSkin);
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertySpellImmunitySpecific(IP_CONST_IMMUNITYSPELL_MASS_CHARM),oSkin);
|
||||
|
||||
SetLocalInt(oSkin, "FeyType",1);
|
||||
}
|
||||
|
||||
void Lips_Rapture(object oPC)
|
||||
{
|
||||
object oRod=GetItemPossessedBy(oPC,"RodofLipsRapture");
|
||||
if (oRod==OBJECT_INVALID)
|
||||
{
|
||||
oRod=CreateItemOnObject("RodofLipsRapture",oPC);
|
||||
int iUse=GetAbilityModifier(ABILITY_CHARISMA,oPC);
|
||||
|
||||
while (iUse>5)
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY),oRod);
|
||||
iUse-=5;
|
||||
}
|
||||
|
||||
switch (iUse)
|
||||
{
|
||||
case 1:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY),oRod);
|
||||
break;
|
||||
case 2:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 3:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 4:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 5:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY),oRod);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
//Declare main variables.
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
|
||||
int bChar=GetHasFeat(FEAT_CHARISMA_INC1, oPC) ? 1 : 0;
|
||||
bChar=GetHasFeat(FEAT_CHARISMA_INC2, oPC) ? 2 : bChar;
|
||||
bChar=GetHasFeat(FEAT_CHARISMA_INC3, oPC) ? 3 : bChar;
|
||||
bChar=GetHasFeat(FEAT_CHARISMA_INC4, oPC) ? 4 : bChar;
|
||||
bChar=GetHasFeat(FEAT_CHARISMA_INC5, oPC) ? 5 : bChar;
|
||||
|
||||
int bHeartP = GetHasFeat(FEAT_HEART_PASSION, oPC) ? 2 : 0;
|
||||
int bLipsR = GetHasFeat(FEAT_LIPS_RAPTUR, oPC) ? 1 : 0;
|
||||
// int bVoiceS = GetHasFeat(FEAT_VOICE_SIREN, oPC) ? 1 : 0;
|
||||
// int bTearsE = GetHasFeat(FEAT_TEARS_EVERGOLD, oPC)? 1 : 0;
|
||||
int bFey = GetHasFeat(FEAT_FEY_METAMORPH, oPC) ? 1 : 0;
|
||||
|
||||
if (bChar>0) CharBonus(oPC, oSkin,bChar);
|
||||
if (bHeartP>0) Heart_Passion(oPC, oSkin,bHeartP);
|
||||
if (bFey>0) Fey_Type(oPC ,oSkin );
|
||||
|
||||
if (bLipsR>0) Lips_Rapture(oPC);
|
||||
|
||||
|
||||
|
||||
}
|
||||
32
_removed/prc_levelup.nss
Normal file
32
_removed/prc_levelup.nss
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
Put into: OnLevelup Event
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Stratovarius and DarkGod
|
||||
//:: Created On: 2003-07-16
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
//Added hook into EvalPRCFeats event
|
||||
// Aaon Graywolf - Jan 6, 2004
|
||||
//Added delay to EvalPRCFeats event to allow module setup to take priority
|
||||
// Aaon Graywolf - Jan 6, 2004
|
||||
|
||||
|
||||
#include "prc_dg_inc"
|
||||
#include "strat_prc_inc"
|
||||
#include "discipleinclude"
|
||||
#include "x2_inc_switches"
|
||||
#include "x2_inc_intweapon"
|
||||
#include "inc_prc_function"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCLevellingUp();
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC);
|
||||
|
||||
//All of the PRC feats have been hooked into EvalPRCFeats
|
||||
//The code is pretty similar, but much more modular, concise
|
||||
//And easy to maintain.
|
||||
// - Aaon Graywolf
|
||||
DelayCommand(0.1, EvalPRCFeats(oPC));
|
||||
}
|
||||
48
_removed/prc_magekill.nss
Normal file
48
_removed/prc_magekill.nss
Normal file
@@ -0,0 +1,48 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Mage Killer Feats]
|
||||
//:: [prc_magekill.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Mage Killer feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Stratovarius. Modified by Aaon Graywolf
|
||||
//:: Created On: Dec 29, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
|
||||
// * Applies the Mage Killer's saving throw bonuses as CompositeBonuses on the object's skin.
|
||||
// * Currently only valid for Fortitude and Reflex saves.
|
||||
// * iLevel = integer save bonus
|
||||
// * iType = IP_CONST_SAVEBASETYPE_*
|
||||
// * sFlag = Flag to check whether the property has already been added
|
||||
void MageKillerSaveBonus(object oPC, object oSkin, int iLevel, int iType, string sFlag)
|
||||
{
|
||||
if(GetLocalInt(oSkin, sFlag) == iLevel) return;
|
||||
|
||||
SetCompositeBonus(oSkin, sFlag, iLevel, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC, iType);
|
||||
SetLocalInt(oPC, sFlag, TRUE);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = OBJECT_SELF;
|
||||
|
||||
int bRefx = GetHasFeat(MK_REF_1, oPC) ? 1 : 0;
|
||||
bRefx = GetHasFeat(MK_REF_2, oPC) ? 2 : bRefx;
|
||||
bRefx = GetHasFeat(MK_REF_3, oPC) ? 3 : bRefx;
|
||||
bRefx = GetHasFeat(MK_REF_4, oPC) ? 4 : bRefx;
|
||||
bRefx = GetHasFeat(MK_REF_5, oPC) ? 5 : bRefx;
|
||||
|
||||
int bFort = GetHasFeat(MK_FORT_1, oPC) ? 1 : 0;
|
||||
bFort = GetHasFeat(MK_FORT_2, oPC) ? 2 : bFort;
|
||||
bFort = GetHasFeat(MK_FORT_3, oPC) ? 3 : bFort;
|
||||
bFort = GetHasFeat(MK_FORT_4, oPC) ? 4 : bFort;
|
||||
bFort = GetHasFeat(MK_FORT_5, oPC) ? 5 : bFort;
|
||||
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
|
||||
if(bRefx > 0) MageKillerSaveBonus(oPC, oSkin, bRefx, IP_CONST_SAVEBASETYPE_REFLEX, "MKFortBonus");
|
||||
if(bFort > 0) MageKillerSaveBonus(oPC, oSkin, bFort, IP_CONST_SAVEBASETYPE_FORTITUDE, "MKRefBonus");
|
||||
}
|
||||
45
_removed/prc_masterh.nss
Normal file
45
_removed/prc_masterh.nss
Normal file
@@ -0,0 +1,45 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Master Harper Feat]
|
||||
//:: [prc_masterh.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Master Harper feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Age
|
||||
//:: Created On: Feb 6, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "mh_constante"
|
||||
|
||||
void MasterHarperBonusFeat(object oPC, object oSkin, string sFlag, int iItemProp, int iSubProp, int iValue)
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
if(GetLocalInt(oSkin,sFlag) == TRUE) return;
|
||||
|
||||
SetCompositeBonus(oSkin, sFlag, iValue,
|
||||
iItemProp,iSubProp);
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//SpawnScriptDebugger();
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
int iLycanbane = GetHasFeat(FEAT_LYCANBANE,oPC);
|
||||
int iMililEar = GetHasFeat(FEAT_MILILS_EAR,oPC);
|
||||
int iDeneirsOrel = GetHasFeat(FEAT_DENEIRS_OREL,oPC);
|
||||
|
||||
if (iLycanbane > 0) MasterHarperBonusFeat(oPC, oSkin, "MHLycanbane",
|
||||
ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP,
|
||||
IP_CONST_RACIALTYPE_SHAPECHANGER, 5);
|
||||
if (iMililEar > 0) MasterHarperBonusFeat(oPC, oSkin, "MHMililEar",
|
||||
ITEM_PROPERTY_SKILL_BONUS,
|
||||
SKILL_LISTEN, 4);
|
||||
if (iDeneirsOrel > 0) MasterHarperBonusFeat(oPC, oSkin, "MHDeneirsOrel",
|
||||
ITEM_PROPERTY_SKILL_BONUS,
|
||||
SKILL_SPELLCRAFT, 4);
|
||||
|
||||
}
|
||||
|
||||
26
_removed/prc_onenter.nss
Normal file
26
_removed/prc_onenter.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "inc_item_props"
|
||||
#include "prc_inc_function"
|
||||
|
||||
void main()
|
||||
{
|
||||
//The composite properties system gets confused when an exported
|
||||
//character re-enters. Local Variables are lost and most properties
|
||||
//get re-added, sometimes resulting in larger than normal bonuses.
|
||||
//The only real solution is to wipe the skin on entry. This will
|
||||
//mess up the lich, but only until I hook it into the EvalPRC event -
|
||||
//hopefully in the next update
|
||||
// -Aaon Graywolf
|
||||
object oPC = GetEnteringObject();
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
ScrubPCSkin(oPC, oSkin);
|
||||
DeletePRCLocalInts(oSkin);
|
||||
|
||||
SetLocalInt(oPC,"ONENTER",1);
|
||||
|
||||
// Make sure we reapply any bonuses before the player notices they are gone.
|
||||
DelayCommand(0.1, EvalPRCFeats(oPC));
|
||||
// Check to see which special prc requirements (i.e. those that can't be done)
|
||||
// through the .2da's, the entering player already meets.
|
||||
CheckSpecialPRCRecs(oPC);
|
||||
DeleteLocalInt(oPC,"ONENTER");
|
||||
}
|
||||
59
_removed/prc_oozemstr.nss
Normal file
59
_removed/prc_oozemstr.nss
Normal file
@@ -0,0 +1,59 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Oozemaster Feats]
|
||||
//:: [prc_oozemstr.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Check to see which Oozemaster feats a creature
|
||||
//:: has and apply the appropriate bonuses.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: DarkGod (Modified by Aaon Graywolf)
|
||||
//:: Created On: Jan 7, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "inc_item_props"
|
||||
#include "strat_prc_inc"
|
||||
#include "prc_dg_inc"
|
||||
|
||||
// * Applies the Oozemasters's immunities on the object's skin.
|
||||
// * iType = IP_CONST_IMMUNITYMISC_*
|
||||
// * sFlag = Flag to check whether the property has already been added
|
||||
void OozemasterImmunity(object oPC, object oSkin, int iType, string sFlag)
|
||||
{
|
||||
if(GetLocalInt(oSkin, sFlag) == TRUE) return;
|
||||
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyImmunityMisc(iType), oSkin);
|
||||
SetLocalInt(oSkin, sFlag, TRUE);
|
||||
}
|
||||
|
||||
// * Applies the Oozemasters's charisma penalty as a composite on the object's skin.
|
||||
void OozemasterCharismaPenatly(object oPC, object oSkin)
|
||||
{
|
||||
int iPenalty = GetLevelByClass(CLASS_TYPE_OOZEMASTER, oPC) / 2;
|
||||
if(GetLocalInt(oSkin, "OozeChaPen") == iPenalty) return;
|
||||
|
||||
SetCompositeBonus(oSkin, "OozeChaPen", iPenalty, ITEM_PROPERTY_DECREASED_ABILITY_SCORE, IP_CONST_ABILITY_CHA);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
object oPC = OBJECT_SELF;
|
||||
object oSkin = GetPCSkin(oPC);
|
||||
|
||||
//Determine which Oozemaster feats the character has
|
||||
int bIdAnat = GetHasFeat(FEAT_INDISCERNIBLE_ANATOMY, oPC);
|
||||
int bChaPen = GetHasFeat(FEAT_CHARISMA_PENALITY, oPC);
|
||||
int bOneOz = GetHasFeat(FEAT_ONE_WITH_THE_OOZE, oPC);
|
||||
|
||||
//Apply bonuses accordingly
|
||||
if(bIdAnat){
|
||||
OozemasterImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_CRITICAL_HITS, "IndiscernibleCrit");
|
||||
OozemasterImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_BACKSTAB, "IndiscernibleBS");
|
||||
}
|
||||
|
||||
if(bOneOz){
|
||||
OozemasterImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_MINDSPELLS, "OneOozeMind");
|
||||
OozemasterImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_POISON, "OneOozePoison");
|
||||
OozemasterImmunity(oPC, oSkin, IP_CONST_IMMUNITYMISC_PARALYSIS, "OneOozePoison");
|
||||
}
|
||||
if(bChaPen) OozemasterCharismaPenatly(oPC, oSkin);
|
||||
}
|
||||
48
_removed/prc_rest.nss
Normal file
48
_removed/prc_rest.nss
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "heartward_inc"
|
||||
#include "inc_item_props"
|
||||
|
||||
void LipsRap(object oPC,int iUse,object oRod)
|
||||
{
|
||||
while (iUse>5)
|
||||
{
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY),oRod);
|
||||
iUse-=5;
|
||||
}
|
||||
|
||||
switch (iUse)
|
||||
{
|
||||
case 1:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY),oRod);
|
||||
break;
|
||||
case 2:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 3:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 4:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY),oRod);
|
||||
break;
|
||||
case 5:
|
||||
AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyCastSpell(IP_CONST_CASTSPELL_LIPS_RAPTURE_1,IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY),oRod);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
|
||||
{
|
||||
object oPC=GetLastPCRested();
|
||||
|
||||
if (GetHasFeat(FEAT_LIPS_RAPTUR,oPC))
|
||||
{
|
||||
object oRod=GetItemPossessedBy(oPC,"RodofLipsRapture");
|
||||
TotalAndRemoveProperty(oRod,ITEM_PROPERTY_CAST_SPELL);
|
||||
int iLips=GetAbilityModifier(ABILITY_CHARISMA,oPC);
|
||||
if (iLips>0)
|
||||
LipsRap(oPC,iLips,oRod);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
76
_removed/prc_s_acroatk.nss
Normal file
76
_removed/prc_s_acroatk.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Acrobatic Attack]
|
||||
//:: [prc_s_acroatk.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Leaps at a target and performs a full round of
|
||||
//:: attacks at a bonus to damage and attack determined
|
||||
//:: by feat level.
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 21, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x0_i0_spells"
|
||||
#include "inc_combat"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetSpellTargetObject();
|
||||
object oWeap = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, OBJECT_SELF);
|
||||
int iEnhancement = GetWeaponEnhancement(oWeap);
|
||||
int iDamageType = GetWeaponDamageType(oWeap);
|
||||
|
||||
float iDistance = GetDistanceToObject(oTarget);
|
||||
int iAttacks = GetBaseAttackBonus(OBJECT_SELF) / 5 + 1;
|
||||
iAttacks = iAttacks > 4 ? 4 : iAttacks;
|
||||
|
||||
int iBonus = 0;
|
||||
int iNextAttackPenalty = 0;
|
||||
|
||||
//Check which level of acrobatic attack has been used
|
||||
if(GetHasFeat(FEAT_ACROBATIC_ATTACK_8))iBonus = 8;
|
||||
else if(GetHasFeat(FEAT_ACROBATIC_ATTACK_6))iBonus = 6;
|
||||
else if(GetHasFeat(FEAT_ACROBATIC_ATTACK_4))iBonus = 4;
|
||||
else if(GetHasFeat(FEAT_ACROBATIC_ATTACK_2))iBonus = 2;
|
||||
|
||||
int iDamage = 0;
|
||||
|
||||
effect eDamage;
|
||||
effect eAttack = EffectAttackIncrease(iBonus);
|
||||
|
||||
//Ability only works from 2.5 or more meters away
|
||||
if(iDistance >= 2.5f){
|
||||
DelayCommand(0.2, DoWhirlwindAttack(FALSE));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAttack, OBJECT_SELF, 3.0f);
|
||||
DelayCommand(1.5f, JumpToObject(oTarget));
|
||||
|
||||
float fDelay = 1.5f;
|
||||
|
||||
//Perform a full round of attacks
|
||||
for(iAttacks; iAttacks > 0; iAttacks--){
|
||||
|
||||
//Roll to hit
|
||||
int iHit = DoMeleeAttack(OBJECT_SELF, oWeap, oTarget, iBonus + iNextAttackPenalty, TRUE, fDelay);
|
||||
|
||||
if(iHit > 0){
|
||||
|
||||
//Check to see if we rolled a critical and determine damage accordingly
|
||||
if(iHit == 2)
|
||||
iDamage = GetMeleeWeaponDamage(OBJECT_SELF, oWeap, TRUE) + iBonus;
|
||||
else
|
||||
iDamage = GetMeleeWeaponDamage(OBJECT_SELF, oWeap, FALSE) + iBonus;
|
||||
|
||||
//Apply the damage
|
||||
eDamage = EffectDamage(iDamage, DAMAGE_TYPE_PIERCING, iEnhancement);
|
||||
DelayCommand(fDelay + 0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
|
||||
|
||||
iNextAttackPenalty -= 5;
|
||||
fDelay += 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStringOnCreature("Too close for Acrobatic Attack", OBJECT_SELF);
|
||||
}
|
||||
}
|
||||
66
_removed/prc_s_deadshout.nss
Normal file
66
_removed/prc_s_deadshout.nss
Normal file
@@ -0,0 +1,66 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Acrobatic Attack]
|
||||
//:: [prc_s_acroatk.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Leaps at a target. Inflicting d6 / 2 duelist
|
||||
//:: levels + dex bonus damage and knockdown for
|
||||
//:: 1 round. Reflex save verus 10 + duelist
|
||||
//:: level + dex bonus for half damage and no
|
||||
//:: knockdown.
|
||||
//::
|
||||
//:: Attack/Damage bonus of +2 or +4 for 1 round
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 21, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
int nWis = GetAbilityModifier(ABILITY_WISDOM);
|
||||
int nDC = 15 + nWis;
|
||||
int nBonus = nWis;
|
||||
int nDamage;
|
||||
|
||||
if(GetHasFeat(FEAT_FREE_KI_2, OBJECT_SELF)){
|
||||
nDC += nWis;
|
||||
nBonus += nWis;
|
||||
}
|
||||
if(GetHasFeat(FEAT_FREE_KI_3, OBJECT_SELF)){
|
||||
nDC += nWis;
|
||||
nBonus += nWis;
|
||||
}
|
||||
if(GetHasFeat(FEAT_FREE_KI_4, OBJECT_SELF)){
|
||||
nDC += nWis;
|
||||
nBonus += nWis;
|
||||
}
|
||||
|
||||
location lTargetLocation = GetSpellTargetLocation();
|
||||
object oTarget;
|
||||
effect eDamage;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_SONIC);
|
||||
|
||||
//Get first target in spell area
|
||||
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
nDamage = d6(3) + nBonus;
|
||||
if(!GetIsReactionTypeFriendly(oTarget) && oTarget != OBJECT_SELF)
|
||||
{
|
||||
//Determine effect delay
|
||||
float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
|
||||
if(MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay))
|
||||
nDamage /= 2;
|
||||
|
||||
eDamage = EffectDamage(nDamage, DAMAGE_TYPE_SONIC, DAMAGE_POWER_ENERGY);
|
||||
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
|
||||
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
||||
}
|
||||
//Get next target in spell area
|
||||
oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTargetLocation, TRUE);
|
||||
}
|
||||
}
|
||||
76
_removed/prc_s_kiheal.nss
Normal file
76
_removed/prc_s_kiheal.nss
Normal file
@@ -0,0 +1,76 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Lay_On_Hands
|
||||
//:: NW_S2_LayOnHand.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
The Paladin is able to heal his Chr Bonus times
|
||||
his level.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Aug 15, 2001
|
||||
//:: Updated On: Oct 20, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_SPELLS"
|
||||
#include "strat_prc_inc"
|
||||
#include "prc_alterations"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
object oTarget = GetSpellTargetObject();
|
||||
int nWis = GetAbilityModifier(ABILITY_WISDOM);
|
||||
int nBonus = nWis;
|
||||
int nLevel = GetLevelByClass(CLASS_TYPE_RED_AVENGER);
|
||||
|
||||
if(GetHasFeat(FEAT_FREE_KI_2, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
if(GetHasFeat(FEAT_FREE_KI_3, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
if(GetHasFeat(FEAT_FREE_KI_4, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
|
||||
// Caluclate the amount to heal, min is 1 hp
|
||||
int nHeal = nLevel * nBonus;
|
||||
if(nHeal <= 0)
|
||||
{
|
||||
nHeal = 1;
|
||||
}
|
||||
effect eHeal = EffectHeal(nHeal);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_M);
|
||||
effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
|
||||
effect eDam;
|
||||
int nTouch;
|
||||
|
||||
//Undead are damaged instead of healed
|
||||
if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || GetLevelByClass(CLASS_TYPE_UNDEAD,oTarget)>0)
|
||||
{
|
||||
//Make a ranged touch attack
|
||||
nTouch = TouchAttackMelee(oTarget,TRUE);
|
||||
|
||||
int nResist = MyResistSpell(OBJECT_SELF,oTarget);
|
||||
if (nResist == 0 )
|
||||
{
|
||||
if(nTouch > 0)
|
||||
{
|
||||
if(nTouch == 2)
|
||||
{
|
||||
nHeal *= 2;
|
||||
}
|
||||
|
||||
eDam = EffectDamage(nHeal, DAMAGE_TYPE_DIVINE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
39
_removed/prc_s_kisave.nss
Normal file
39
_removed/prc_s_kisave.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: [Acrobatic Attack]
|
||||
//:: [prc_s_acroatk.nss]
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Leaps at a target. Inflicting d6 / 2 duelist
|
||||
//:: levels + dex bonus damage and knockdown for
|
||||
//:: 1 round. Reflex save verus 10 + duelist
|
||||
//:: level + dex bonus for half damage and no
|
||||
//:: knockdown.
|
||||
//::
|
||||
//:: Attack/Damage bonus of +2 or +4 for 1 round
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Aaon Graywolf
|
||||
//:: Created On: Dec 21, 2003
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "nw_i0_spells"
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare major variables
|
||||
int nWis = GetAbilityModifier(ABILITY_WISDOM);
|
||||
int nBonus = nWis;
|
||||
|
||||
if(GetHasFeat(FEAT_FREE_KI_2, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
if(GetHasFeat(FEAT_FREE_KI_3, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
if(GetHasFeat(FEAT_FREE_KI_4, OBJECT_SELF))
|
||||
nBonus += nWis;
|
||||
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID);
|
||||
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, nBonus);
|
||||
effect eLink = EffectLinkEffects(eVis, eSave);
|
||||
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, RoundsToSeconds(2));
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user