37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
#include "NW_I0_SPELLS"
|
|
#include "prc_inc_spells"
|
|
|
|
void main()
|
|
{
|
|
object oCaster = GetAreaOfEffectCreator();
|
|
|
|
int nLevel = GetHitDice(oCaster);
|
|
int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster);
|
|
|
|
if ( nLevel > 20 )
|
|
nLevel = 20;
|
|
|
|
float fDuration = HoursToSeconds(nLevel);
|
|
|
|
effect eCharm = EffectCharmed();
|
|
effect eImp = EffectVisualEffect(VFX_IMP_CHARM);
|
|
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
|
|
effect eLink = EffectLinkEffects(eCharm,eVis);
|
|
eLink = EffectLinkEffects(eLink,eDur);
|
|
|
|
object oTarget = GetFirstInPersistentObject();
|
|
while ( GetIsObjectValid(oTarget) )
|
|
{
|
|
if ( oTarget != oCaster && GetIsEnemy(oTarget,oCaster) )
|
|
{
|
|
if ( !PRCMySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) )
|
|
{
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget);
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration);
|
|
}
|
|
}
|
|
oTarget = GetNextInPersistentObject();
|
|
}
|
|
}
|