Jaysyn904 22947ad4b6 Initial Upload
Initial Upload
2023-08-08 16:22:17 -04:00

74 lines
2.5 KiB
Plaintext

void CreateBalor()
{
CreateObject(OBJECT_TYPE_CREATURE, "balor_wild", GetSpellTargetLocation());
}
void main()
{
int nMetaMagic = GetMetaMagicFeat();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
int nDuration = GetCasterLevel(OBJECT_SELF);
effect eSummon;
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
location lSpellTargetLOC = GetSpellTargetLocation();
object oPC = GetLastSpellCaster();
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
if(GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL) ||
GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL) ||
GetHasSpellEffect(SPELL_HOLY_AURA))
{
if(GetItemPossessedBy(oPC,"chokey2")!= OBJECT_INVALID)
{
eSummon = EffectSummonCreature("fho_dragon",VFX_FNF_SUMMONDRAGON,1.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
return;
}
else if(GetItemPossessedBy(oPC,"OHSKEY")!= OBJECT_INVALID)
{
eSummon = EffectSummonCreature("ohs_avatar",VFX_FNF_MYSTICAL_EXPLOSION,1.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
return;
}
else if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD && GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL)
{
eSummon = EffectSummonCreature("good_avatar",VFX_FNF_SUMMON_CELESTIAL,1.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
return;
}
else if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL && GetAlignmentLawChaos(oPC) == ALIGNMENT_CHAOTIC)
{
eSummon = EffectSummonCreature("evil_avatar",VFX_FNF_SUMMON_UNDEAD,1.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
return;
}
eSummon = EffectSummonCreature("balor_tame",VFX_FNF_SUMMON_GATE,1.0);
float fSeconds = RoundsToSeconds(nDuration);
DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lSpellTargetLOC, fSeconds));
}
else
{
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lSpellTargetLOC);
DelayCommand(1.0, CreateBalor());
}
}