WhenTheNightComes wrote...
Still didn't work, and somehow the beam has switched to the original ray of frost. Help, anyone?
thats not a surprise, the script you posted should always work like that, you made an error somwhere switched the old script for this i guess, but try this:
#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
object oTarget = GetSpellTargetObject();
if(GetTag(GetSpellCastItem()) == "warlock_staff")
{
int nTouch = TouchAttackRanged(oTarget);
if (nTouch > 0)
{
int nDam = d8(GetLevelByclass(class_TYPE_SORCERER)/2*nTouch);
effect eDam = EffectDamage(nDam, DAMAGE_TYPE_NEGATIVE);
effect eRay = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND);
//Apply the VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGBLUE), oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
}
return;
}
//Declare major variables
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDam = d4(1) + 1;
effect eDam;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);
if(!GetIsReactionTypeFriendly(oTarget))
{
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_FROST));
eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND);
//Make SR Check
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_MAXIMIZE)
{
nDam = 5 ;//Damage is at max
}
else if (nMetaMagic == METAMAGIC_EMPOWER)
{
nDam = nDam + nDam/2; //Damage/Healing is +50%
}
//Set damage effect
eDam = EffectDamage(nDam, DAMAGE_TYPE_COLD);
//Apply the VFX impact and damage effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
}
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7);
}
This should work + I added critical hit damage calculation into beam damage