Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "inc_char_token"
- #include "inc_summon_comps"
- #include "inc_summon_theme"
- #include "inc_summon_disco"
- #include "inc_summon_pproc"
- #include "inc_domains_new"
- #include "inc_vfx_eyes"
- #include "inc_itemgenesis"
- const int SPELL_SCHOOL_NO_MULTISUMMON = 20000;
- const int SPELL_SCHOOL_IGNORE_HD = 20001;
- string GetInnateTheme(object oPC);
- int ApplySummonModifier(int nSpellID, int nSpellModifier);
- // Process the Special Effects / Name change for the War Summoning Theme.
- void EFUSummon_ProcessWar(object oSummon);
- //Get Female War Theme Name
- string GetFemaleWarName();
- //Get Male War Theme Name
- string GetMaleWarName();
- //War Summon Titan Name Database
- string GetTitanWarName();
- // Implements summoning as per EfU conventions. Do not summon creatures directly
- // unless you are sure of what you are doing.
- // Created by Johannes.
- void EFUSummon(effect eSummon, location lLocation, float fDuration, object oPC=OBJECT_SELF, int nSpellSchool=SPELL_SCHOOL_CONJURATION, int bNoMultisummon=FALSE, int nPostprocessingInstruction=0, float fSummonCustomChallengeRating=-1.0f, int bIgnoreSummonHD=FALSE);
- int EFUSummon_GetMaxSummonHD(object oPC)
- {
- int nMaxHD = 0;
- nMaxHD += GetLevelByClass(CLASS_TYPE_BARD, oPC);
- nMaxHD += 2 * GetLevelByClass(CLASS_TYPE_CLERIC, oPC);
- nMaxHD += 2 * GetLevelByClass(CLASS_TYPE_DRUID, oPC);
- nMaxHD += GetLevelByClass(CLASS_TYPE_PALADIN, oPC);
- nMaxHD += GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC);
- nMaxHD += GetLevelByClass(CLASS_TYPE_RANGER, oPC);
- nMaxHD += 2 * GetLevelByClass(CLASS_TYPE_SORCERER, oPC);
- nMaxHD += 2 * GetLevelByClass(CLASS_TYPE_WIZARD, oPC);
- nMaxHD += GetTokenInt(oPC,"nSummonBonus");
- //Channeler
- if (GetTokenInt(oPC,"bFeat_Channeler") == 1) nMaxHD += 5;
- nMaxHD *= 1; // May change this later as necessary.
- return nMaxHD;
- }
- int EFUSummon_GetGreaterSpellFocusFeatFromSpellSchool(int nSpellSchool)
- {
- int nFeat;
- switch (nSpellSchool)
- {
- case SPELL_SCHOOL_ABJURATION:
- nFeat = FEAT_GREATER_SPELL_FOCUS_ABJURATION;
- break;
- case SPELL_SCHOOL_DIVINATION:
- nFeat = FEAT_GREATER_SPELL_FOCUS_DIVINATION;
- break;
- case SPELL_SCHOOL_ENCHANTMENT:
- nFeat = FEAT_GREATER_SPELL_FOCUS_ENCHANTMENT;
- break;
- case SPELL_SCHOOL_EVOCATION:
- nFeat = FEAT_GREATER_SPELL_FOCUS_EVOCATION;
- break;
- case SPELL_SCHOOL_ILLUSION:
- nFeat = FEAT_GREATER_SPELL_FOCUS_ILLUSION;
- break;
- case SPELL_SCHOOL_NECROMANCY:
- nFeat = FEAT_GREATER_SPELL_FOCUS_NECROMANCY;
- break;
- case SPELL_SCHOOL_TRANSMUTATION:
- nFeat = FEAT_GREATER_SPELL_FOCUS_TRANSMUTATION;
- break;
- default:
- nFeat = FEAT_GREATER_SPELL_FOCUS_CONJURATION;
- }
- return nFeat;
- }
- int EFUSummon_GetSpellFocusFeatFromSpellSchool(int nSpellSchool)
- {
- int nFeat;
- switch (nSpellSchool)
- {
- case SPELL_SCHOOL_ABJURATION:
- nFeat = FEAT_SPELL_FOCUS_ABJURATION;
- break;
- case SPELL_SCHOOL_DIVINATION:
- nFeat = FEAT_SPELL_FOCUS_DIVINATION;
- break;
- case SPELL_SCHOOL_ENCHANTMENT:
- nFeat = FEAT_SPELL_FOCUS_ENCHANTMENT;
- break;
- case SPELL_SCHOOL_EVOCATION:
- nFeat = FEAT_SPELL_FOCUS_EVOCATION;
- break;
- case SPELL_SCHOOL_ILLUSION:
- nFeat = FEAT_SPELL_FOCUS_ILLUSION;
- break;
- case SPELL_SCHOOL_NECROMANCY:
- nFeat = FEAT_SPELL_FOCUS_NECROMANCY;
- break;
- case SPELL_SCHOOL_TRANSMUTATION:
- nFeat = FEAT_SPELL_FOCUS_TRANSMUTATION;
- break;
- default:
- nFeat = FEAT_SPELL_FOCUS_CONJURATION;
- }
- return nFeat;
- }
- // Okay. We're not REALLY using HitDie. In actuality we are taking the challenge
- // rating and modifying it depending on the summoner's feats/classes.
- float EFUSummon_GetSummonHD(object oSummon, object oMaster)
- {
- float fMultiplier = 1.0;
- float fHD = IntToFloat(GetLocalInt(oSummon, "nSummonCost"))/10.0;
- if (fHD < 1.0) fHD = GetChallengeRating(oSummon);
- if (fHD <= 1.0) fHD = GetChallengeRating(oSummon);
- fHD = fHD < 1.0 ? 1.0 : fHD;
- int nSpellSchool = GetLocalInt(oSummon, "nSummonSpellSchool");
- if (GetHasFeat(EFUSummon_GetGreaterSpellFocusFeatFromSpellSchool(nSpellSchool), oMaster))
- {
- fMultiplier -= 0.25;
- }
- if (GetHasFeat(EFUSummon_GetSpellFocusFeatFromSpellSchool(nSpellSchool), oMaster))
- {
- fMultiplier -= 0.25;
- }
- //if (nSpellSchool == SPELL_SCHOOL_NECROMANCY && GetLevelByClass(CLASS_TYPE_PALE_MASTER, oMaster) > 0)
- //{
- // fMultiplier -= 0.25;
- //}
- fHD *= fMultiplier;
- //Negation if it is a summoned animal companion.
- if(GetLocalInt(oSummon, "bAnimalCompanion"))
- {
- fHD = 0.0;
- }
- return fHD;
- }
- int EFUSummon_GetSummonSpellSchool(object oSummon)
- {
- int nSpellSchool = GetLocalInt(oSummon, "nSummonSpellSchool");
- return nSpellSchool;
- }
- int EFUSummon_GetSummonSpellSchoolFromMaster(object oMaster)
- {
- int nSpellSchool = GetLocalInt(oMaster, "nLastSummonSpellSchool");
- DeleteLocalInt(oMaster, "nLastSummonSpellSchool");
- return nSpellSchool;
- }
- void EFUSummon_ForceUnsummon(object oSummon)
- {
- if(GetTag(oSummon) == "aniweapon001")
- {
- object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oSummon);
- if(GetLocalInt(oWeapon, "bShelgarnDrop"))
- CopyObject(oWeapon, GetLocation(oSummon), OBJECT_INVALID, GetTag(oWeapon));
- }
- AssignCommand(oSummon, SetIsDestroyable(TRUE, FALSE, FALSE));
- ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oSummon));
- DestroyObject(oSummon, 0.0);
- return;
- }
- void EFUSummon_ForceHostile(object oSummon, object oMaster)
- {
- AssignCommand(oSummon, SetIsDestroyable(TRUE, FALSE, FALSE));
- string sResRef = GetResRef(oSummon);
- location lSummon = GetLocation(oSummon);
- DestroyObject(oSummon, 0.0);
- oSummon = CreateObject(OBJECT_TYPE_CREATURE, sResRef, lSummon);
- AssignCommand(oSummon, ActionAttack(oMaster, TRUE));
- ChangeToStandardFaction(oSummon, STANDARD_FACTION_HOSTILE);
- effect eEffect = EffectVisualEffect(VFX_IMP_UNSUMMON);
- DelayCommand(160.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oSummon));
- DestroyObject(oSummon, 160.3);
- }
- float EFUSummon_CountSummonHD(object oMaster)
- {
- int n = 1;
- float fMyHD, fNetHD = 0.0;
- object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster, n++);
- while(GetIsObjectValid(oSummon))
- {
- fMyHD = EFUSummon_GetSummonHD(oSummon, oMaster);
- if (EFUSummon_GetSummonSpellSchool(oSummon) == SPELL_SCHOOL_NO_MULTISUMMON && !GetLocalInt(oSummon, "bAnimalCompanion")) EFUSummon_ForceUnsummon(oSummon);
- else fNetHD += fMyHD;
- oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster, n++);
- }
- // Cruzel additions for undead Henchmen. Same as above, but for Henchman. Ignores non-animated Hench.
- n = 1;
- oSummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oMaster, n++);
- while(GetIsObjectValid(oSummon))
- {
- if (GetLocalInt(oSummon, "nDismissable") == 1) // Make sure they're a proper corpse flagged by animating
- {
- fMyHD = EFUSummon_GetSummonHD(oSummon, oMaster);
- if (EFUSummon_GetSummonSpellSchool(oSummon) == SPELL_SCHOOL_NO_MULTISUMMON && !GetLocalInt(oSummon, "bAnimalCompanion")) EFUSummon_ForceUnsummon(oSummon);
- else fNetHD += fMyHD;
- oSummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oMaster, n++);
- }
- }
- // End of Cruzel Additions
- return fNetHD;
- }
- void EFUSummon(effect eSummon, location lLocation, float fDuration, object oPC=OBJECT_SELF, int nSpellSchool=SPELL_SCHOOL_CONJURATION, int bNoMultisummon=FALSE, int nPostprocessingInstruction=0, float fSummonCustomChallengeRating = -1.0f, int bIgnoreSummonHD=FALSE)
- {
- if ((GetIsPC(oPC) || GetLocalInt(oPC, "bMultisummon")) && !bNoMultisummon)
- {
- int n = 1;
- object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC, n++);
- while(GetIsObjectValid(oSummon))
- {
- AssignCommand(oSummon, SetIsDestroyable(FALSE, FALSE, FALSE));
- AssignCommand(oSummon, DelayCommand(0.3, SetIsDestroyable(TRUE, FALSE, FALSE)));
- oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC, n++);
- }
- nSpellSchool = (bIgnoreSummonHD == FALSE) ? nSpellSchool : SPELL_SCHOOL_IGNORE_HD; // Indicates whether we are using an HD limit or not
- SetLocalInt(oPC, "nLastSummonSpellSchool", nSpellSchool);
- }
- else
- {
- // This is going to indicate that our summon does not support multisummoning
- SetLocalInt(oPC, "nLastSummonSpellSchool", SPELL_SCHOOL_NO_MULTISUMMON);
- }
- // If no duration, assume the duration is permanent
- int nDurationType = DURATION_TYPE_TEMPORARY;
- if (fDuration <= 0.0)
- {
- fDuration = 0.0;
- nDurationType = DURATION_TYPE_PERMANENT;
- eSummon = SupernaturalEffect(eSummon);
- }
- if (fSummonCustomChallengeRating >= 1.0f) nPostprocessingInstruction = PROCESS_SUMMON_BASE_CRCONTROL + FloatToInt(fSummonCustomChallengeRating);
- PrepareSummonForProcessing(oPC, nPostprocessingInstruction);
- AssignCommand(oPC, ApplyEffectAtLocation(nDurationType, ExtraordinaryEffect(eSummon), lLocation, fDuration));
- return;
- }
- void EFUSummon_ProcessWar(object oSummon)
- {
- string sTag = GetTag(oSummon);
- object oMaster = GetMaster(oSummon);
- effect eVis;
- effect eSmoke;
- SetLocalInt(oSummon,"nWeaponBonus",1);
- object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST,oSummon);
- object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD,oSummon);
- int iAppr = 0;
- if(GetAlignmentGoodEvil(oMaster) == ALIGNMENT_EVIL)
- { eVis = EffectRedEyes(oSummon);
- oArmor = GenerateTargusColorTemplate(oArmor);
- iAppr = APPEARANCE_TYPE_GIANT_FIRE;
- if(GetIsObjectValid(oHelm) == TRUE) oHelm = GenerateTargusColorTemplate(oHelm);
- }
- else if(GetAlignmentGoodEvil(oMaster) == ALIGNMENT_GOOD)
- { eVis = EffectWhiteEyes(oSummon); }
- else if(GetAlignmentGoodEvil(oMaster) == ALIGNMENT_NEUTRAL)
- {
- if (GetStringLowerCase(GetDeity(oMaster)) == "tempus")
- { eVis = EffectWhiteEyes(oSummon); }
- else if (GetStringLowerCase(GetDeity(oMaster)) == "garagos")
- { eVis = EffectRedEyes(oSummon);
- iAppr = APPEARANCE_TYPE_GIANT_FIRE;
- oArmor = GenerateTargusColorTemplate(oArmor);
- if(GetIsObjectValid(oHelm) == TRUE) oHelm = GenerateTargusColorTemplate(oHelm);
- }
- else if (GetStringLowerCase(GetDeity(oMaster)) == "targus")
- { eVis = EffectRedEyes(oSummon);
- iAppr = APPEARANCE_TYPE_GIANT_FIRE;
- oArmor = GenerateTargusColorTemplate(oArmor);
- if(GetIsObjectValid(oHelm) == TRUE) oHelm = GenerateTargusColorTemplate(oHelm);
- }
- else
- { eVis = EffectWhiteEyes(oSummon); }
- }
- eSmoke = EffectVisualEffect(VFX_DUR_GHOST_SMOKE_2);
- eSmoke = SupernaturalEffect(eSmoke);
- eVis = SupernaturalEffect(eVis);
- SetDroppableFlag(oArmor,FALSE);
- if(GetIsObjectValid(oHelm) == TRUE)
- {
- SetDroppableFlag(oHelm,FALSE);
- AssignCommand(oSummon,ActionEquipItem(oHelm,INVENTORY_SLOT_HEAD));
- }
- AssignCommand(oSummon,ActionEquipItem(oArmor,INVENTORY_SLOT_CHEST));
- string sName = GetName(oSummon);
- if(sTag == "sum_war_1")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oSummon);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- GenerateWeapon(oSummon,"normal",1);
- SetName(oSummon,GetMaleWarName() + " the " + sName);
- }
- else if(sTag == "sum_war_2")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oSummon);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- SetName(oSummon,GetMaleWarName() + " the " + sName);
- }
- else if(sTag == "sum_war_3")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oSummon);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- GenerateWeapon(oSummon,"normal",0);
- SetName(oSummon,GetMaleWarName() + " the " + sName);
- }
- else if(sTag == "sum_war_4")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oSummon);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- GenerateWeapon(oSummon,"normal",1);
- SetName(oSummon,GetFemaleWarName() + " the " + sName);
- }
- else if(sTag == "sum_war_5")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oSummon);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- SetLocalInt(oSummon,"nWeaponBonus",2);
- GenerateWeapon(oSummon,"normal",1);
- SetName(oSummon,GetMaleWarName() + " the " + sName);
- }
- else if(sTag == "sum_war_6")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- SetName(oSummon,GetTitanWarName() + " the " + sName);
- if(iAppr != 0)
- {
- SetCreatureAppearanceType(oSummon,iAppr);
- SetPortraitId(oSummon,215);
- }
- }
- else if(sTag == "sum_war_7")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- SetName(oSummon,GetTitanWarName() + " the " + sName);
- if(iAppr != 0)
- {
- SetCreatureAppearanceType(oSummon,iAppr);
- SetPortraitId(oSummon,215);
- }
- }
- else if(sTag == "sum_war_8")
- {
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSmoke, oSummon);
- SetName(oSummon,GetTitanWarName() + " the " + sName);
- if(iAppr != 0)
- {
- SetCreatureAppearanceType(oSummon,iAppr);
- SetPortraitId(oSummon,215);
- }
- }
- }
- // Cruzel : New wrapper function for Johannes' code below. This allows us to call it in the animate dead and player tools
- // w/o triggering the processing functions more than once.
- void HandleOverSpawn(object oSummon, int nSpellSchool=-1)
- {
- object oMaster = GetMaster(oSummon);
- if (nSpellSchool != SPELL_SCHOOL_NO_MULTISUMMON && nSpellSchool != SPELL_SCHOOL_IGNORE_HD)
- {
- float fMaxHD = IntToFloat(EFUSummon_GetMaxSummonHD(oMaster));
- float fNetHD = EFUSummon_CountSummonHD(oMaster);
- float fMyHD = EFUSummon_GetSummonHD(oSummon, oMaster);
- if (GetIsPC(oMaster) == FALSE) fMaxHD = 1500.0;
- if (GetIsPC(oMaster) == TRUE && GetIsDM(oMaster) == TRUE) fMaxHD = 1500.0;
- if (GetIsPC(oMaster) == TRUE && GetIsDMPossessed(oMaster) == TRUE) fMaxHD = 1500.0;
- if (fNetHD > fMaxHD)
- {
- fNetHD -= fMyHD;
- SendMessageToPC(oMaster, "You have "+IntToString(FloatToInt(10.0*fNetHD))+" of "+IntToString(FloatToInt(10.0*fMaxHD))+" maintainable summoning points and are attempting to summon '"+GetName(oSummon)+"' worth "+IntToString(FloatToInt(10.0*fMyHD))+" summoning points. You are unable to control this summoned creature.");
- if (nSpellSchool != -100) // Handle for undead claim tool. -100 should only be a thing if reclaiming.
- {
- SendMessageToPC(oMaster, "Unable to control your summon, it breaks free of your bonds and leaps back into the ether...");
- ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oSummon));
- DestroyObject(oSummon, 0.5);
- }
- // Johannes: Summons no longer become hostile if uncontrollable.
- // EFUSummon_ForceHostile(oSummon, oMaster);
- }
- else
- {
- SendMessageToPC(oMaster, "You have "+IntToString(FloatToInt(10.0*fNetHD))+" of "+IntToString(FloatToInt(10.0*fMaxHD))+" maintainable summoning points.");
- }
- }
- else if (nSpellSchool != SPELL_SCHOOL_IGNORE_HD)
- {// No multisummoning, so clear the party of unwanted summons.
- int n = 1;
- object oPartySummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster, n++);
- while(GetIsObjectValid(oPartySummon))
- {
- if (oSummon != oPartySummon && !GetLocalInt(oSummon, "bAnimalCompanion")) EFUSummon_ForceUnsummon(oPartySummon);
- oPartySummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster, n++);
- }
- // Cruzel Additions to make it unsummon corpses, but will not unsummon DM granted Henchmen or special minions:
- n = 1;
- oPartySummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oMaster, n++);
- while(GetIsObjectValid(oPartySummon))
- {
- if (GetLocalInt(oPartySummon, "nDismissable") == 1)
- {
- ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oPartySummon), 4.0f);
- DestroyObject(oPartySummon);
- }
- oPartySummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oMaster, n++);
- }
- // End of Cruzel Additions
- }
- }
- // Johannes: Bit of a hack-job on my part. Essentially adds a spell school
- // variable to the summoned creature OnSpawn, and at the same time creates
- // any reaction to oversummoning of creatures if appropriate.
- // Cruzel : Cut out the over summoning function and wrapped it above.
- void EFUSummon_HandleOnSpawn(object oSummon)
- {
- if (GetAssociateType(oSummon) != ASSOCIATE_TYPE_SUMMONED ) return;
- object oMaster = GetMaster(oSummon); int nSpellSchool;
- // Process the summon as necessary.
- ProcessSummon(oMaster, oSummon);
- if ((nSpellSchool=EFUSummon_GetSummonSpellSchoolFromMaster(oMaster))!=0)
- {
- SetLocalInt(oSummon, "nSummonSpellSchool", nSpellSchool);
- }
- // Cruzel Change : Wrapped below function
- HandleOverSpawn(oSummon, nSpellSchool);
- return;
- }
- effect GetSummonEffect(object oPC, int nSpellID){
- string sActiveTheme = "";
- int nSpellModifier = 0;
- // Caster item theme override
- object oItem = GetSpellCastItem();
- if(oItem != OBJECT_INVALID){
- if(GetLocalString(oItem, "Summoning_Theme") != ""){
- sActiveTheme = GetLocalString(oItem, "Summoning_Theme");
- nSpellModifier = GetLocalInt(oItem, "Summoning_Modifier");
- }
- }
- /* --- Get the Active Theme and Spell Level Modifier --- */
- object oReagent = GetLocalObject(oPC, "Summon_Chosen_Reagent");
- string sSingle = GetTokenString(oPC, "Summon_Chosen_Single");
- string sTome = GetTokenString(oPC, "Summon_Chosen_Tome");
- // Reagents are checked first...
- if(sActiveTheme == "" && oReagent != OBJECT_INVALID){
- SetLocalObject(oPC, "Summon_Chosen_Reagent", OBJECT_INVALID);
- if(GetItemPossessor(oReagent) == oPC){
- sActiveTheme = GetSummonTheme(oReagent);
- nSpellModifier = GetSummonModifier(oReagent);
- if(sActiveTheme != "")
- DestroyObject(oReagent);
- else
- SendMessageToPC(oPC, "The chosen reagent does nothing.");
- }
- }
- // ...followed by the single-shot theme...
- if(sActiveTheme == "" && sSingle != ""){
- sActiveTheme = sSingle;
- SetTokenString(oPC, "Summon_Chosen_Single", "");
- }
- // ...followed by the active tome theme...
- if(sActiveTheme == "" && sTome != ""){
- object oTome = GetItemPossessedBy(oPC, sTome);
- if(oTome == OBJECT_INVALID){
- SetTokenString(oPC, "Summon_Chosen_Tome", "");
- }else{
- sActiveTheme = GetSummonTheme(oTome);
- nSpellModifier = GetSummonModifier(oTome);
- }
- }
- // ...followed by the default theme overrides...
- if(sActiveTheme == ""){
- if(GetIsPC(oPC) && !GetIsDMPossessed(oPC)){
- sActiveTheme = GetTokenString(oPC, "Summon_Chosen_Permanent");
- }else{
- sActiveTheme = GetLocalString(oPC, "Summoning_Theme");
- nSpellModifier = GetLocalInt(oPC, "Summoning_Modifier");
- }
- }
- //.. followed by a bonus for being in a summoning circle...
- object oSummonCircle = GetFirstObjectInShape(SHAPE_SPHERE, 4.0, GetLocation(oPC), FALSE, OBJECT_TYPE_PLACEABLE);
- while(GetIsObjectValid(oSummonCircle)) {
- if(GetTag(oSummonCircle) == "summon_circle") {
- SendMessageToPC(oPC, "Your summon is empowered by a nearby summoning circle!");
- nSpellModifier ++;
- break;
- }
- else{
- }
- oSummonCircle = GetNextObjectInShape(SHAPE_SPHERE, 4.0, GetLocation(oPC), FALSE, OBJECT_TYPE_PLACEABLE);
- }
- // ...followed by the default/innate theme.
- if(sActiveTheme == "") {
- sActiveTheme = GetInnateTheme(oPC);
- }
- // Animal Domain gives improved summoning
- // NOTE: Animal Domain will work for the default theme.
- // It will not work for any other summoning theme.
- // in order to add additional themes, add to the next line of script '|| sActivityTheme == <THEME>' for example, adding "Monkey" like so:
- // if((sActiveTheme == "" || sActiveTheme == "Default" || sActiveTheme == "Dog" || sActiveTheme == "Monkey")
- if((sActiveTheme == "" || sActiveTheme == "Default" || sActiveTheme == "Dog")
- && GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER, oPC) && !GetHasFeat(FEAT_PLANT_DOMAIN_POWER, oPC)) {
- nSpellModifier += 1;
- }
- nSpellID = ApplySummonModifier(nSpellID, nSpellModifier);
- if (sActiveTheme == "Default") return GetEffect_Default(nSpellID);
- else if(sActiveTheme == "Aberration")return GetEffect_Aberration(nSpellID);
- else if(sActiveTheme == "Beholder") return GetEffect_Beholder(nSpellID);
- else if(sActiveTheme == "Spider") return GetEffect_Spider(nSpellID);
- else if(sActiveTheme == "Light") return GetEffect_Light(nSpellID);
- else if(sActiveTheme == "Spirits") return GetEffect_Spirit(nSpellID);
- else if(sActiveTheme == "Earth2") return GetEffect_Earth2(nSpellID);
- else if(sActiveTheme == "Rats") return GetEffect_Rats(nSpellID);
- else if(sActiveTheme == "Illusion") return GetEffect_Illusion(nSpellID);
- else if(sActiveTheme == "Slaadi") return GetEffect_Slaad(nSpellID);
- else if(sActiveTheme == "Slimes") return GetEffect_Slime(nSpellID);
- else if(sActiveTheme == "Demons") return GetEffect_Demon(nSpellID);
- else if(sActiveTheme == "Devils") return GetEffect_Devil(nSpellID);
- else if(sActiveTheme == "Ark") return GetEffect_Ark(nSpellID);
- else if(sActiveTheme == "Plant") return GetEffect_Plant(nSpellID);
- else if(sActiveTheme == "Animated") return GetEffect_Animated(nSpellID);
- else if(sActiveTheme == "War") return GetEffect_War(nSpellID);
- else if(sActiveTheme == "Crystal") return GetEffect_Crystal(nSpellID);
- else if(sActiveTheme == "Law") return GetEffect_Law(nSpellID);
- else if(sActiveTheme == "Shadow") return GetEffect_Shadow(nSpellID);
- else if(sActiveTheme == "Astral") return GetEffect_Astral(nSpellID);
- else if(sActiveTheme == "ForgottenSpirits") return GetEffect_ForgottenSpirits(nSpellID);
- else if(sActiveTheme == "Dog") return GetEffect_Dog(nSpellID);
- else if(sActiveTheme == "Chitinoid") return GetEffect_Chitinoid(nSpellID);
- else if(GetIsDiscountTheme(sActiveTheme)){
- return GetEffect_Discount(nSpellID, sActiveTheme, oPC);
- }else if(GetStringLeft(sActiveTheme, 7) == "Special"){
- return GetEffect_Special(nSpellID, StringToInt(GetStringRight(sActiveTheme, GetStringLength(sActiveTheme) - 7)));
- }else
- return GetEffect_Default(nSpellID);
- }
- string GetInnateTheme(object oPC) {
- if(GetHasFeat(FEAT_PLANT_DOMAIN_POWER,oPC)) return "Plant";
- if(GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) return "Water";
- if(GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) return "Air";
- if(GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) return "Fire";
- if(GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) return "Earth";
- if(GetHasFeat(FEAT_OOZE_DOMAIN_POWER, oPC)) return "Slimes";
- if(GetHasFeat(FEAT_SPIDER_DOMAIN_POWER, oPC)) return "Spider";
- if(GetHasFeat(FEAT_UNDEATH_DOMAIN_POWER, oPC)) return "Spirits";
- if(GetHasFeat(FEAT_ILLUSION_DOMAIN_POWER, oPC)) return "Illusion";
- if(GetHasFeat(FEAT_DARKNESS_DOMAIN_POWER, oPC)) return "Shadow";
- if (GetHasFeat(FEAT_GOOD_DOMAIN_POWER, oPC)) return "Light";
- if (GetDeity(oPC) == "Orcus") return "Demons";
- if ((GetDeity(oPC) == "Ithikraszt") ||
- (GetDeity(oPC) == "Gargauth")) return "Devils";
- if(GetTokenString(oPC, "sWatcher_Role") == "ForgottenCircle") return "ForgottenSpirits";
- return "";
- }
- // Utility Function
- int ApplySummonModifier(int nSpellID, int nSpellModifier){
- if(nSpellModifier == 0){
- return nSpellID;
- }else if(nSpellModifier > 0){
- if(nSpellID == SPELL_SUMMON_CREATURE_IX)
- return SPELL_SUMMON_CREATURE_IX;
- else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
- return SPELL_SUMMON_CREATURE_IX;
- else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VIII, nSpellModifier-1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VII, nSpellModifier-1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_V)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VI, nSpellModifier-1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_V, nSpellModifier-1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_III)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_IV, nSpellModifier-1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_II)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_III, nSpellModifier-1);
- else
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_II, nSpellModifier-1);
- }else{
- if(nSpellID == SPELL_SUMMON_CREATURE_I)
- return SPELL_SUMMON_CREATURE_I;
- else if(nSpellID == SPELL_SUMMON_CREATURE_II)
- return SPELL_SUMMON_CREATURE_I;
- else if(nSpellID == SPELL_SUMMON_CREATURE_III)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_II, nSpellModifier+1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_IV)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_III, nSpellModifier+1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_V)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_IV, nSpellModifier+1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_VI)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_V, nSpellModifier+1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_VII)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VI, nSpellModifier+1);
- else if(nSpellID == SPELL_SUMMON_CREATURE_VIII)
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VII, nSpellModifier+1);
- else
- return ApplySummonModifier(SPELL_SUMMON_CREATURE_VIII, nSpellModifier+1);
- }
- }
- //War Summon Male Name Database
- string GetMaleWarName()
- {
- string sName;
- int n = Random(100);
- switch(n)
- {
- case 0: sName = "Brynjar";
- break;
- case 1: sName = "Baldur";
- break;
- case 2: sName = "Bjartur";
- break;
- case 3: sName = "Eirikur";
- case 4: sName = "Ari";break;
- case 5: sName = "Eyvindur";break;
- case 6: sName = "Fannar";break;
- case 7: sName = "Fridrik";break;
- case 8: sName = "Hakon";break;
- case 9: sName = "Hallbjorn";break;
- case 10: sName = "Halldor";break;
- case 11: sName = "Haraldur";break;
- case 12: sName = "Hinrik";break;
- case 13: sName = "Hjortur";break;
- case 14: sName = "Hraen";break;
- case 15: sName = "Hrafn";break;
- case 16: sName = "Jonas";break;
- case 17: sName = "Kristjan";break;
- case 18: sName = "Larus";break;
- case 19: sName = "Ludvik";break;
- case 20: sName = "Njala";break;
- case 21: sName = "Oskar";break;
- case 22: sName = "Petur";break;
- case 23: sName = "Sindri";break;
- case 24: sName = "Sverrir";break;
- case 25: sName = "Drauglur";break;
- case 26: sName = "Tryggvi";break;
- case 27: sName = "Vilhjalmur";break;
- case 28: sName = "Lugos";break;
- case 29: sName = "Lugus";break;
- case 30: sName = "Dwyn";break;
- case 31: sName = "Cernunnos";break;
- case 32: sName = "Belenos";break;
- case 33: sName = "Belenus";break;
- case 34: sName = "Taranis";break;
- case 35: sName = "Askr";break;
- case 36: sName = "Borghild";break;
- case 37: sName = "Brynhildr"; break;
- case 38: sName = "Freyr";break;
- case 39: sName = "Grimhildr";break;
- case 40: sName = "Gunnar";break;
- case 41: sName = "Gudrun";break;
- case 42: sName = "Gunnarr";break;
- case 43: sName = "Heidrun";break;
- case 44: sName = "Hel";break;
- case 45: sName = "Huld";break;
- case 46: sName = "Idun";break;
- case 47: sName = "Jarl";break;
- case 48: sName = "Njall";break;
- case 49: sName = "Njord";break;
- case 50: sName = "Njordr";break;
- case 51: sName = "Oden";break;
- case 52: sName = "Saga";break;
- case 53: sName = "Sigrun";break;
- case 54: sName = "Sigurd";break;
- case 55: sName = "Skadi";break;
- case 56: sName = "Skuld";break;
- case 57: sName = "Thorus";break;
- case 58: sName = "Vidarr";break;
- case 59: sName = "Volund";break;
- case 60: sName = "Yngvi";break;
- case 61: sName = "Wulfgor";break;
- case 62: sName = "Wulfgarr";break;
- case 63: sName = "Gorlf";break;
- case 64: sName = "Volos";break;
- case 65: sName = "Mokosh";break;
- case 66: sName = "Stribog";break;
- case 67: sName = "Svarog"; break;
- case 68: sName = "Dazhdbog"; break;
- case 69: sName = "Aedan";break;
- case 70: sName = "Aedh";break;
- case 71: sName = "Caderyn"; break;
- case 72: sName = "Caratacus"; break;
- case 73: sName = "Drest";break;
- case 74: sName = "Drust"; break;
- case 75: sName = "Faelan"; break;
- case 76: sName = "Eogan"; break;
- case 77: sName = "Iodocus"; break;
- case 78: sName = "Haerviu"; break;
- case 79: sName = "Jodocus"; break;
- case 80: sName = "Mael"; break;
- case 81: sName = "Maedoc"; break;
- case 82: sName = "Loeghair"; break;
- case 83: sName = "Morcant";break;
- case 84: sName = "Oengus"; break;
- case 85: sName = "Angus";break;
- case 86: sName = "Angmor"; break;
- case 87: sName = "Angmarr"; break;
- case 88: sName = "Roagam"; break;
- case 89: sName = "Riagan"; break;
- case 90: sName = "Mael"; break;
- case 91: sName = "Haerix"; break;
- case 92: sName = "Yorr"; break;
- case 93: sName = "Daerix"; break;
- case 94: sName = "Aenphar"; break;
- case 95: sName = "Moratorix"; break;
- case 96: sName = "Angmor"; break;
- case 97: sName = "Gorix";break;
- case 98: sName = "Goratorix"; break;
- case 99: sName = "Vercingetorix"; break;
- }
- return sName;
- }
- //War Summon Titan Name Database
- string GetTitanWarName()
- {
- string sName;
- int n = Random(38);
- switch(n)
- {
- case 0: sName = "Jormungdar"; break;
- case 1: sName = "Odingar"; break;
- case 2: sName = "Graloq"; break;
- case 3: sName = "Bjorganum"; break;
- case 4: sName = "Haerakh"; break;
- case 5: sName = "Forakh"; break;
- case 6: sName = "Ghro"; break;
- case 7: sName = "Eross"; break;
- case 8: sName = "Zorakh"; break;
- case 9: sName = "Bodvar"; break;
- case 10: sName = "Loki"; break;
- case 11: sName = "Hodr"; break;
- case 12: sName = "Hoenir"; break;
- case 13: sName = "Lodurr"; break;
- case 14: sName = "Vali"; break;
- case 15: sName = "Vidarr"; break;
- case 16: sName = "Njorar"; break;
- case 17: sName = "Njor"; break;
- case 18: sName = "Delingr"; break;
- case 19: sName = "Heimdalar"; break;
- case 20: sName = "Freyr"; break;
- case 21: sName = "Glaur"; break;
- case 22: sName = "Jofurr"; break;
- case 23: sName = "Asgarr"; break;
- case 24: sName = "Marahk"; break;
- case 25: sName = "Ragnara"; break;
- case 26: sName = "Gnarok"; break;
- case 27: sName = "Eirek"; break;
- case 28: sName = "Hervarar"; break;
- case 29: sName = "Hrolf"; break;
- case 30: sName = "Sogubrot"; break;
- case 31: sName = "Slaug"; break;
- case 32: sName = "Sturlaugh"; break;
- case 33: sName = "Yngvar"; break;
- case 34: sName = "Volsungahr"; break;
- case 35: sName = "Ghautrek"; break;
- case 36: sName = "Gandar"; break;
- case 37: sName = "Gaendarr"; break;
- }
- return sName;
- }
- //War Summon Female Name Database
- string GetFemaleWarName()
- {
- string sName;
- int n = Random(100);
- switch(n)
- {
- case 0: sName = "Anna"; break;
- case 1: sName = "Asdis"; break;
- case 2: sName = "Bjork"; break;
- case 3: sName = "Adalbjorg"; break;
- case 4: sName = "Elisabet"; break;
- case 5: sName = "Eydis"; break;
- case 6: sName = "Frida"; break;
- case 7: sName = "Fridrika"; break;
- case 8: sName = "Gudlaug"; break;
- case 9: sName = "Gudrun"; break;
- case 10: sName = "Halldora"; break;
- case 11: sName = "Hanna"; break;
- case 12: sName = "Hildur"; break;
- case 13: sName = "Hjordis"; break;
- case 14: sName = "Johanna"; break;
- case 15: sName = "Jona"; break;
- case 16: sName = "Kristin"; break;
- case 17: sName = "Kristjana"; break;
- case 18: sName = "Lara"; break;
- case 19: sName = "Lilja"; break;
- case 20: sName = "Maeja"; break;
- case 21: sName = "Margret"; break;
- case 22: sName = "Pala"; break;
- case 23: sName = "Ragnheidur"; break;
- case 24: sName = "Ragnhildur"; break;
- case 25: sName = "Svana"; break;
- case 26: sName = "Sveltlana"; break;
- case 27: sName = "Svanhildur"; break;
- case 28: sName = "Unnur"; break;
- case 29: sName = "Sjordana"; break;
- case 30: sName = "Agrona"; break;
- case 31: sName = "Agarna"; break;
- case 32: sName = "Asara"; break;
- case 33: sName = "Agahl"; break;
- case 34: sName = "Epona"; break;
- case 35: sName = "Isolda"; break;
- case 36: sName = "Freyja"; break;
- case 37: sName = "Eir"; break;
- case 38: sName = "Borghild"; break;
- case 39: sName = "Borghildr"; break;
- case 40: sName = "Grimhildr"; break;
- case 41: sName = "Hulda"; break;
- case 42: sName = "Silfa"; break;
- case 43: sName = "Silvana"; break;
- case 44: sName = "Sylka"; break;
- case 45: sName = "Sylkana"; break;
- case 46: sName = "Sylra"; break;
- case 47: sName = "Jahla"; break;
- case 48: sName = "Jahra"; break;
- case 49: sName = "Marana"; break;
- case 50: sName = "Skala"; break;
- case 51: sName = "Skasha"; break;
- case 52: sName = "Sorsha"; break;
- case 53: sName = "Vergana"; break;
- case 54: sName = "Morgana"; break;
- case 55: sName = "Siiwa"; break;
- case 56: sName = "Ziiva"; break;
- case 57: sName = "Boadecia"; break;
- case 58: sName = "Genovea"; break;
- case 59: sName = "Asa"; break;
- case 60: sName = "Arnbjorg";break;
- case 61: sName = "Brynja"; break;
- case 62: sName = "Bergljot"; break;
- case 63: sName = "Dagmaer"; break;
- case 64: sName = "Dagny"; break;
- case 65: sName = "Gudlaug"; break;
- case 66: sName = "Gunnvor"; break;
- case 67: sName = "Gunnbjorg"; break;
- case 68: sName = "Eydis"; break;
- case 69: sName = "Inga"; break;
- case 70: sName = "Ingibjorg"; break;
- case 71: sName = "Ingridr"; break;
- case 72: sName = "Idunn"; break;
- case 73: sName = "Jorunnr"; break;
- case 74: sName = "Myrgjol"; break;
- case 75: sName = "Hjordis"; break;
- case 76: sName = "Gyda"; break;
- case 77: sName = "Runa"; break;
- case 78: sName = "Rana"; break;
- case 79: sName = "Janah"; break;
- case 80: sName = "Sarahna"; break;
- case 81: sName = "Zalhana"; break;
- case 82: sName = "Gorhana";break;
- case 83: sName = "Morhana"; break;
- case 84: sName = "Ghaena"; break;
- case 85: sName = "Jaraha"; break;
- case 86: sName = "Faera"; break;
- case 87: sName = "Feaja"; break;
- case 88: sName = "Fioja"; break;
- case 89: sName = "Fiora"; break;
- case 90: sName = "Yiora"; break;
- case 91: sName = "Ilda"; break;
- case 92: sName = "Korja"; break;
- case 93: sName = "Syljarra"; break;
- case 94: sName = "Jaera"; break;
- case 95: sName = "Maeha"; break;
- case 96: sName = "Uldara";break;
- case 97: sName = "Qwara"; break;
- case 98: sName = "Lea"; break;
- case 99: sName = "Leara"; break;
- }
- return sName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement