261 lines
6.8 KiB
Plaintext
261 lines
6.8 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Summon Creature Series
|
|
//:: NW_S0_Summon
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Carries out the summoning of the appropriate
|
|
creature for the Summon Monster Series of spells
|
|
1 to 9
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Preston Watamaniuk
|
|
//:: Created On: Jan 8, 2002
|
|
//:://////////////////////////////////////////////
|
|
|
|
effect SetSummonEffect(int nSpellID);
|
|
|
|
#include "x2_inc_spellhook"
|
|
|
|
void main()
|
|
{
|
|
|
|
/*
|
|
Spellcast Hook Code
|
|
Added 2003-06-23 by GeorgZ
|
|
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
|
|
|
|
|
|
//Declare major variables
|
|
int nSpellID = GetSpellId();
|
|
int nDuration = GetCasterLevel(OBJECT_SELF);
|
|
nDuration = 24;
|
|
if(nDuration == 1)
|
|
{
|
|
nDuration = 4;
|
|
}
|
|
effect eSummon = SetSummonEffect(nSpellID);
|
|
|
|
//Make metamagic check for extend
|
|
int nMetaMagic = GetMetaMagicFeat();
|
|
if (nMetaMagic == METAMAGIC_EXTEND)
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
//Apply the VFX impact and summon effect
|
|
|
|
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration));
|
|
}
|
|
|
|
|
|
effect SetSummonEffect(int nSpellID)
|
|
{
|
|
int nFNF_Effect;
|
|
int nRoll = d3();
|
|
string sSummon;
|
|
if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER)) //WITH THE ANIMAL DOMAIN
|
|
{
|
|
if(nSpellID == SPELL_SUMMON_CREATURE_I)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "NW_S_BOARDIRE";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_II)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "NW_S_WOLFDIRE";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_III)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "direspider4";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
|
|
sSummon = "diretiger5";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_V)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
|
|
sSummon = "direbear6";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "airelder7";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "waterelder7";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "fireelder7";
|
|
break;
|
|
}
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "airgreat8";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "watergreat8";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "firegreat8";
|
|
break;
|
|
}
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "asummon9";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "bsummon9";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "csummon9";
|
|
break;
|
|
}
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_IX)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "asummon9";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "csummon9";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "dsummon9";
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else //WITOUT THE ANIMAL DOMAIN
|
|
{
|
|
if(nSpellID == SPELL_SUMMON_CREATURE_I)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "NW_S_badgerdire";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_II)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "NW_S_BOARDIRE";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_III)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_1;
|
|
sSummon = "NW_S_WOLFDIRE";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
|
|
sSummon = "direspider4";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_V)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
|
|
sSummon = "diretiger5";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_2;
|
|
sSummon = "direbear6";
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "airelder7";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "waterelder7";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "fireelder7";
|
|
break;
|
|
}
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "airgreat8";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "watergreat8";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "firegreat8";
|
|
break;
|
|
}
|
|
}
|
|
else if(nSpellID == SPELL_SUMMON_CREATURE_IX)
|
|
{
|
|
nFNF_Effect = VFX_FNF_SUMMON_MONSTER_3;
|
|
switch (nRoll)
|
|
{
|
|
case 1:
|
|
sSummon = "asummon9";
|
|
break;
|
|
|
|
case 2:
|
|
sSummon = "bsummon9";
|
|
break;
|
|
|
|
case 3:
|
|
sSummon = "csummon9";
|
|
break;
|
|
|
|
}
|
|
}
|
|
}
|
|
//effect eVis = EffectVisualEffect(nFNF_Effect);
|
|
//ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation());
|
|
effect eSummonedMonster = EffectSummonCreature(sSummon, nFNF_Effect);
|
|
return eSummonedMonster;
|
|
}
|
|
|