I have a modified/renamed version of the epic spell Mummy Dust for my module. It spawns an undead for most casters but for druids it spawns a treant. This works just fine. What I'd like to do however, is make it scale with the caster's level a bit.
Here's the script currently:
#include "x2_inc_spellhook"
#include "inc_epicspells"
void main()
{
if (!X2PreSpellCastCode())
{
return;
}
if (GetCanCastSpell(OBJECT_SELF, MUMDUST_DC, MUMDUST_S, MUMDUST_XP))
{
//Declare major variables
int nDuration = 24;
//effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
effect eSummon;
//NC:EDIT
// Add check for druid for different summon
int nDruid = GetLevelByClass(CLASS_TYPE_DRUID, OBJECT_SELF);
string sSummon;
if (nDruid >=20)
{
sSummon = "s_treant_001";
}
else
{
sSummon = "s_morglord_001";
}
//NC:EDIT
//Summon the appropriate creature based on the summoner level
//Warrior Mummy
//NC:EDIT
//Treant Druid only
eSummon = EffectSummonCreature(sSummon,496,1.0f);
//NC:EDIT
eSummon = ExtraordinaryEffect(eSummon);
//Apply the summon visual and summon the undead.
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
}
}
I'd like the spell to summon stronger minions every 5 levels. So the one we have in the script are the base versions. Basically at 25, 30, 35, and 40 the spell summons a stronger version of the minion. I also want to do the same with my modified Dragon Knight spell. How can I edit the scripts to do that?
#include "x2_inc_toollib"
#include "inc_epicspells"
#include "x2_inc_spellhook"
void main()
{
if (!X2PreSpellCastCode())
{
return;
}
if (GetCanCastSpell(OBJECT_SELF, DRG_KNI_DC, DRG_KNI_S, DRG_KNI_XP))
{
//Declare major variables
int nDuration = 20;
effect eSummon;
effect eVis = EffectVisualEffect(460);
eSummon = EffectSummonCreature("s_drake_001",481,0.0f,TRUE);
// * make it so dragon cannot be dispelled
eSummon = ExtraordinaryEffect(eSummon);
//Apply the summon visual and summon the dragon.
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon,GetSpellTargetLocation(), RoundsToSeconds(nDuration));
DelayCommand(1.0f,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis,GetSpellTargetLocation()));
}
}