Initial commit
Adding all of the current content for Anphillia Unlimited.
This commit is contained in:
103
_removed/x2_s0_magcvest.nss
Normal file
103
_removed/x2_s0_magcvest.nss
Normal file
@@ -0,0 +1,103 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Magic Vestment
|
||||
//:: X2_S0_MagcVest
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Grants a +1 AC bonus to armor touched per 3 caster
|
||||
levels (maximum of +5).
|
||||
*/
|
||||
/*
|
||||
Anphillia Changes
|
||||
The maximum AC bonus of this spell is now +3.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Andrew Nobbs
|
||||
//:: Created On: Nov 28, 2002
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Updated by Andrew Nobbs May 09, 2003
|
||||
//:: 2003-07-29: Rewritten, Georg Zoeller
|
||||
|
||||
#include "nw_i0_spells"
|
||||
#include "x2_i0_spells"
|
||||
|
||||
#include "x2_inc_spellhook"
|
||||
|
||||
|
||||
|
||||
void AddACBonusToArmor(object oMyArmor, float fDuration, int nAmount)
|
||||
{
|
||||
IPSafeAddItemProperty(oMyArmor,ItemPropertyACBonus(nAmount), fDuration, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING ,FALSE,TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
/*
|
||||
Spellcast Hook Code
|
||||
Added 2003-07-07 by Georg Zoeller
|
||||
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_IMP_GLOBE_USE);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
int nDuration = GetCasterLevel(OBJECT_SELF);
|
||||
int nMetaMagic = GetMetaMagicFeat();
|
||||
int nAmount = GetCasterLevel(OBJECT_SELF)/3;
|
||||
if (nAmount <0)
|
||||
{
|
||||
nAmount = 1;
|
||||
}
|
||||
else if (nAmount>3)
|
||||
{
|
||||
nAmount = 3;
|
||||
}
|
||||
|
||||
object oMyArmor = IPGetTargetedOrEquippedArmor(TRUE);
|
||||
if(GetBaseItemType(oMyArmor) != BASE_ITEM_ARMOR)
|
||||
{
|
||||
FloatingTextStringOnCreature("Invalid item type! Magic Vestment can only be applied to armor.", OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nMetaMagic == METAMAGIC_EXTEND)
|
||||
{
|
||||
nDuration = nDuration * 2; //Duration is +100%
|
||||
}
|
||||
|
||||
|
||||
if(GetIsObjectValid(oMyArmor) )
|
||||
{
|
||||
SignalEvent(GetItemPossessor(oMyArmor ), EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE));
|
||||
|
||||
if (nDuration>0)
|
||||
{
|
||||
|
||||
location lLoc = GetLocation(GetSpellTargetObject());
|
||||
DelayCommand(1.3f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oMyArmor)));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, GetItemPossessor(oMyArmor), HoursToSeconds(nDuration));
|
||||
AddACBonusToArmor(oMyArmor, HoursToSeconds(nDuration),nAmount);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStrRefOnCreature(83826, OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user