Battledale_PRC8/_removed/nw_s0_tenstrans.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

106 lines
3.5 KiB
Plaintext

///::///////////////////////////////////////////////
//:: Tensor's Transformation
//:: NW_S0_TensTrans.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Gives the caster the following bonuses:
+1 Attack per 2 levels
+4 Natural AC
20 STR and DEX and CON
1d6 Bonus HP per level
+5 on Fortitude Saves
-10 Intelligence
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 26, 2001
//:://////////////////////////////////////////////
//: Sep2002: losing hit-points won't get rid of the rest of the bonuses
#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
if (GetHasSpellEffect(SPELL_TENSERS_TRANSFORMATION))
{
SendMessageToPC(OBJECT_SELF,"You already have Tenser's Transformation cast on yourself");
return;
}
//Declare major variables
int nLevel = GetCasterLevel(OBJECT_SELF);
int nHP, nCnt, nDuration;
nDuration = GetCasterLevel(OBJECT_SELF);
//Determine bonus HP
for(nCnt; nCnt <= nLevel; nCnt++)
{
nHP += d4();
}
int nMeta = GetMetaMagicFeat();
//Metamagic
if(nMeta == METAMAGIC_MAXIMIZE)
{
nHP = nLevel * 6;
}
else if(nMeta == METAMAGIC_EMPOWER)
{
nHP = nHP + (nHP/2);
}
else if(nMeta == METAMAGIC_EXTEND)
{
nDuration *= 2;
}
//Declare effects
effect eAttack = EffectAttackIncrease(nLevel/3);
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_FORT, 2);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect ePoly = EffectPolymorph(POLYMORPH_TYPE_HUGE_FIRE_ELEMENTAL);
//ActionUnequipItem
//object oWeapon=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);
//SetPlotFlag(oWeapon,0);
//DestroyObject(oWeapon);
//oWeapon=GetItemPossessedBy(OBJECT_SELF,"NW_WSWMLS013");
//SetPlotFlag(oWeapon,0);
//DestroyObject(oWeapon);
effect eSwing = EffectModifyAttacks(1);
//Link effects
effect eLink = EffectLinkEffects(eAttack, ePoly);
eLink = EffectLinkEffects(eLink, eSave);
eLink = EffectLinkEffects(eLink, eDur);
eLink = EffectLinkEffects(eLink, eSwing);
effect eHP = EffectTemporaryHitpoints(nHP);
effect eVis = EffectVisualEffect(VFX_IMP_SUPER_HEROISM);
//Signal Spell Event
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TENSERS_TRANSFORMATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageIncrease(DAMAGE_BONUS_1d4,DAMAGE_TYPE_FIRE), OBJECT_SELF, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, OBJECT_SELF, RoundsToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, RoundsToSeconds(nDuration));
// ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BLUR), OBJECT_SELF, RoundsToSeconds(nDuration));
// ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOSTLY_PULSE), OBJECT_SELF, RoundsToSeconds(nDuration));
// ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_AURA_DISEASE), OBJECT_SELF, RoundsToSeconds(nDuration));
}