PRC8/nwn/nwnprc/trunk/spells/sp_magicstone.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

69 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//::///////////////////////////////////////////////
//:: Magic Stone
//:: sp_magicstone.nss
//:://////////////////////////////////////////////
/*
Transmutation
Level: Clr 1, Drd 1, Earth 1
Components: V, S, DF
Casting Time: 1 standard action
Range: Touch
Targets: Up to three pebbles touched
Duration: 30 minutes or until discharged
Saving Throw: Will negates (harmless, object)
Spell Resistance: Yes (harmless, object)
You transmute as many as three pebbles, which can
be no larger than sling bullets, so that they
strike with great force when thrown or slung. If
hurled, they have a range increment of 20 feet. If
slung, treat them as sling bullets (range
increment 50 feet). The spell gives them a +1
enhancement bonus on attack and damage rolls. The
user of the stones makes a normal ranged attack.
Each stone that hits deals 1d6+1 points of damage
(including the spells enhancement bonus), or
2d6+2 points against undead.
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "prc_inc_spells"
#include "prc_alterations"
void main()
{
if (!X2PreSpellCastCode()) return;
PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION);
//Declare major variables
object oCaster = OBJECT_SELF;
int nMetaMagic = PRCGetMetaMagicFeat();
float fDuration = TurnsToSeconds(30);
object oStone = CreateItemOnObject("magicstone", oCaster, 3);
itemproperty ipEnhanceBonus = ItemPropertyEnhancementBonus(1);
itemproperty ipDamageBonus = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_1d6);
itemproperty ipUndEnhanceBonus = ItemPropertyEnhancementBonusVsRace(RACIAL_TYPE_UNDEAD, 2);
itemproperty ipUndDamageBonus = ItemPropertyDamageBonusVsRace(RACIAL_TYPE_UNDEAD, IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGEBONUS_1d6);
if(CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
fDuration *= 2; //Duration is +100%
SignalEvent(oCaster, EventSpellCastAt(oCaster, SPELL_MAGIC_STONE, FALSE));
if(GetIsObjectValid(oStone)){
AddItemProperty(DURATION_TYPE_TEMPORARY, ipEnhanceBonus, oStone, fDuration);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipDamageBonus, oStone, fDuration);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipUndEnhanceBonus, oStone, fDuration);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipUndDamageBonus, oStone, fDuration);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_NEUTRAL), oStone, fDuration);
}
PRCSetSchool();
}