Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Rasael
- -custom summon code
- -supports multiple summons at the same time
- -supports custom summon AI
- -supports buffing summons
- -supports dismissing summons manually
- -supports dispelling summons
- -Better graphics than default system
- -Centralized include, easy to edit.
- */
- #include "hench_i0_hensho"
- #include "nwnx_clock"
- void ApplySizeIncrease(object oTarget, float fSizeIncrease )
- {
- effect eScale = EffectSetScale(fSizeIncrease);
- eScale = SupernaturalEffect(eScale);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eScale, oTarget);
- }
- void ApplyGood(object oTarget)
- {
- effect eVis = EffectNWN2SpecialEffectFile("fx_succubus_eyes", oTarget); //yellow eyes
- effect eVis2 = EffectNWN2SpecialEffectFile("fx_defaultitem_holy", oTarget); //holy radiance
- ApplyEffectToObject(2, SupernaturalEffect(eVis), oTarget, 0.0f);
- ApplyEffectToObject(2, SupernaturalEffect(eVis2), oTarget, 0.0f);
- SetSubRace(oTarget, "Outsider");
- FeatAdd(oTarget, FEAT_WEAPON_PROFICIENCY_MARTIAL, FALSE, FALSE, FALSE);
- FeatAdd(oTarget, FEAT_WEAPON_PROFICIENCY_EXOTIC, FALSE, FALSE, FALSE);
- DelayCommand(1.5f, AssignCommand(oTarget, ActionEquipMostDamagingMelee(OBJECT_INVALID, FALSE)));
- effect eImmuneToNonMagicWeapons = EffectDamageReduction(1, DAMAGE_POWER_PLUS_ONE, 0, DR_TYPE_MAGICBONUS);
- eImmuneToNonMagicWeapons = SupernaturalEffect(eImmuneToNonMagicWeapons);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eImmuneToNonMagicWeapons, oTarget);
- }
- void ApplyEvil(object oTarget)
- {
- effect eVis = EffectNWN2SpecialEffectFile("fx_wraith_eyes", oTarget); //red eyes
- effect eVis2 = EffectNWN2SpecialEffectFile("zombie_disease", oTarget); //vile skin
- ApplyEffectToObject(2, SupernaturalEffect(eVis), oTarget, 0.0f);
- ApplyEffectToObject(2, SupernaturalEffect(eVis2), oTarget, 0.0f);
- SetSubRace(oTarget, "Outsider");
- FeatAdd(oTarget, FEAT_WEAPON_PROFICIENCY_MARTIAL, FALSE, FALSE, FALSE);
- FeatAdd(oTarget, FEAT_WEAPON_PROFICIENCY_EXOTIC, FALSE, FALSE, FALSE);
- DelayCommand(1.5f, AssignCommand(oTarget, ActionEquipMostDamagingMelee(OBJECT_INVALID, FALSE)));
- effect eImmuneToNonMagicWeapons = EffectDamageReduction(1, DAMAGE_POWER_PLUS_ONE, 0, DR_TYPE_MAGICBONUS);
- eImmuneToNonMagicWeapons = SupernaturalEffect(eImmuneToNonMagicWeapons);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eImmuneToNonMagicWeapons, oTarget);
- }
- void ApplySpirit(object oTarget)
- {
- effect eVis = EffectNWN2SpecialEffectFile("fx_erinyes_eyes", oTarget); //blue eyes
- effect eVis2 = EffectNWN2SpecialEffectFile("fx_telthor_s", oTarget); //spirit visual
- ApplyEffectToObject(2, SupernaturalEffect(eVis), oTarget, 0.0f);
- ApplyEffectToObject(2, SupernaturalEffect(eVis2), oTarget, 0.0f);
- SetSubRace(oTarget, "Outsider");
- SetLocalInt(oTarget, "X2_L_IS_INCORPOREAL", TRUE); //won't do anything, already past spawning.
- //X2_L_IS_INCORPOREAL: will maybe work with GetIsSpirit so Spirit Shamans abilities work
- //If not then we say that summoning magic prevents those abilities from working.
- effect eConceal = EffectConcealment(10, MISS_CHANCE_TYPE_NORMAL);
- eConceal = SupernaturalEffect(eConceal);
- effect eGhost = EffectCutsceneGhost();
- eGhost = SupernaturalEffect(eGhost);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, oTarget);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oTarget);
- }
- void ApplyShadow(object oTarget)
- {
- effect eVis = EffectVisualEffect(VFX_DUR_SPELL_SHADOW_SIMULACRUM);
- ApplyEffectToObject(2, SupernaturalEffect(eVis), oTarget, 0.0f);
- SetLocalInt(oTarget, "X2_L_IS_INCORPOREAL", TRUE); //won't do anything, already past spawning.
- //X2_L_IS_INCORPOREAL: will maybe work with GetIsSpirit so Spirit Shamans abilities work
- //If not then we say that summoning magic prevents those abilities from working.
- effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
- eConceal = SupernaturalEffect(eConceal);
- effect eGhost = EffectCutsceneGhost();
- eGhost = SupernaturalEffect(eGhost);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, oTarget);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, oTarget);
- }
- void AttackNearest(object oSummon, location lSummon, object oCaster)
- {
- /*
- AssignCommand(oSummon, HenchResetHenchmenState());
- SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE, oSummon);
- SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE, oSummon);
- object oNearest = GetFirstObjectInShape(SHAPE_SPHERE, 24.0f, lSummon, FALSE, OBJECT_TYPE_CREATURE);
- int nLoop;
- while(GetIsObjectValid(oNearest) == TRUE && nLoop < 15)
- {
- if(GetIsEnemy(oCaster, oNearest) == TRUE || GetIsReactionTypeHostile(oCaster, oNearest) == TRUE)
- {
- AssignCommand(oSummon, ClearAllActions());
- AssignCommand(oSummon, ActionAttack(oNearest, FALSE));
- return;
- }
- nLoop = nLoop + 1;
- oNearest = GetNextObjectInShape(SHAPE_SPHERE, 24.0f, lSummon, FALSE, OBJECT_TYPE_CREATURE);
- }
- */
- }
- int SUMMON_DOMINATE = 66633459;
- #include "cmi_ginc_spells"
- #include "nw_i0_spells"
- void RemoveSummon(object oSummon)
- {
- if(GetIsObjectValid(oSummon) == FALSE) {return;}
- SetPlotFlag(oSummon, FALSE);
- RemoveEffectsFromSpell(oSummon, SUMMON_DOMINATE);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneImmobilize(), oSummon);
- DestroyObject(oSummon, 1.5f, FALSE);
- int iVis = VFX_IMP_UNSUMMON;
- string iVisualOverride = GetLocalString(oSummon, "dismissal_vfx1");
- string iVisualOverride2 = GetLocalString(oSummon, "dismissal_vfx2");
- location lSummon = GetLocation(oSummon);
- if(iVisualOverride == "")
- {ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(iVis), lSummon);}
- else
- {ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectNWN2SpecialEffectFile(iVisualOverride, oSummon, GetPositionFromLocation(lSummon)), lSummon);}
- if(iVisualOverride2 != "")
- {ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectNWN2SpecialEffectFile(iVisualOverride2, oSummon, GetPositionFromLocation(lSummon)), lSummon);}
- }
- void BladeDance(object oCaster, object oBlade, object oItem)
- {
- if(GetIsObjectValid(oCaster) == FALSE || GetIsObjectValid(oBlade) == FALSE)
- return;
- if(GetArea(oBlade) == OBJECT_INVALID)
- {DelayCommand(12.0f, BladeDance(oCaster, oBlade, oItem)); return;}
- if(GetArea(oCaster) == OBJECT_INVALID)
- {DelayCommand(12.0f, BladeDance(oCaster, oBlade, oItem)); return;}
- object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oCaster);
- if(oWeapon == oItem)
- {
- SendMessageToPC(oCaster, "<color=white>*Bladedance: Expired - Weapon equipped by caster*");
- return;
- }
- DelayCommand(6.0f, BladeDance(oCaster, oBlade, oItem));
- }
- void Control(object oMaster, string sSpellName, float fDuration, string sBlueprint, location lTarget, int iCompetative = FALSE, int iNoSummon = FALSE, int iID = -1)
- {
- object oMislead = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster);
- PlayCustomAnimation(oMislead, "standupB", 0, 1.3f);
- int iCL = GetLocalInt(oMaster, "mislead_casterlevel");
- object oCaster = GetLocalObject(oMaster, "caster");
- int nChoice;
- int nTime = GetUNIXTime();
- SetIsTemporaryFriend(oMaster, oCaster, FALSE, 20000.0f);
- SetIsTemporaryFriend(oCaster, oMaster, FALSE, 20000.0f);
- SetLocalInt(oMislead, "mislead_casterlevel", iCL);
- SetLocalObject(oMislead, "mislead_master", oCaster);
- SetLocalObject(oMislead, "mislead_summoner", oMaster);
- SetLocalObject(oMaster, "mislead_summon", oMislead);
- SetLocalString(oMislead, "dismissal_vfx1", "sp_evocation_aoe");
- SetLocalString(oMislead, "dismissal_vfx2", "fx_ritual_conjure");
- if(fDuration > 0.0f)
- SetLocalInt(oMislead, "mislead_endtime", nTime + FloatToInt(fDuration));
- string sNewTag = ObjectToString(oCaster)+sSpellName;
- SetTag(oMislead, sNewTag);
- if(sBlueprint == "cmi_phantbear" || sBlueprint == "cmi_phantwolf" || sBlueprint == "bg_revenanta" || sBlueprint == "bg_revenantb")
- ApplyPhantomStats(oMaster);
- else if(sBlueprint == "bg_spir_weapon")
- ExecuteScript ("bg_spell_spirit_weapon1", oMislead);
- else if(sBlueprint == "c_ghoul_pm_crt_undead" || sBlueprint == "c_ghast_pm_crt_undead" || sBlueprint == "c_mummy_pm_crt_undead" || sBlueprint == "c_s_mummy_pm_crt_undead")
- {
- string sScript = GetLocalString(oCaster,"X2_S_PM_SPECIAL_ITEM");
- if (sScript != "")
- ExecuteScript (sScript, oMislead);
- }
- if(iNoSummon == FALSE)
- SetLocalInt(oMislead, "summon", TRUE);
- //if(nTime == 0 && fDuration > 0.0f) //singleplayer only
- // {AssignCommand(oMislead, DelayCommand(fDuration, RemoveSummon(oMislead)));}
- //SetEventHandler(oMislead, 10, "bg_illusion_die");
- //DelayCommand(2.0f, SetEventHandler(oMaster, 0, "bg_illusion_remove")); //heartbeat of master, kills himself when summon is gone
- if(iID == 63) //gate
- {
- nChoice = GetLocalInt(oCaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- if(nChoice == 7) {SetFirstName(oMislead, "Angel"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100);}
- else if(nChoice == 105) {SetFirstName(oMislead, "Night Hag"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100);}
- else if(nChoice == 107) {SetFirstName(oMislead, "Xorn"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100);}
- else if(nChoice == 201) {SetFirstName(oMislead, "Succubus"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- else if(nChoice == 202) {SetFirstName(oMislead, "Hezrou"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- else if(nChoice == 203) {SetFirstName(oMislead, "Balor"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- else if(nChoice == 301) {SetFirstName(oMislead, "Erinyes"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- else if(nChoice == 302) {SetFirstName(oMislead, "Horned Devil"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- else if(nChoice == 303) {SetFirstName(oMislead, "Pit Fiend"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100);}
- }
- }
- else if(iID == 476) //summon shadow
- {
- ApplyShadow(oMislead); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100);
- }
- else if(iID == 69 || iID == 96 || iID == 451
- || iID == 128) //planar binding
- {
- nChoice = GetLocalInt(oCaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- //GOOD
- if(nChoice == 1) {SetCreatureAppearanceType(oMislead, 2326); SetFirstName(oMislead, "Celestial Lion"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); ApplySizeIncrease(oMislead,3.0);}
- else if(nChoice == 2) {SetCreatureAppearanceType(oMislead, 37); SetFirstName(oMislead, "Celestial Stag"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); ApplySizeIncrease(oMislead,3.0);}
- else if(nChoice == 3) {SetCreatureAppearanceType(oMislead, 1055); SetFirstName(oMislead, "Celestial Wolf"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 4) {SetCreatureAppearanceType(oMislead, 1053); SetFirstName(oMislead, "Celestial Bear"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 5) {SetCreatureAppearanceType(oMislead, 1061); SetFirstName(oMislead, "Celestial Dire Bear"); ApplyGood(oMislead); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); ApplySizeIncrease(oMislead,1.0);}
- //NEUTRAL
- else if(nChoice == 100) {SetFirstName(oMislead, "Fire Mephit"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 101) {SetFirstName(oMislead, "Ice Mephit"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 102) {SetFirstName(oMislead, "Sylph"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 103) {SetFirstName(oMislead, "Djinn"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 104) {SetCreatureAppearanceType(oMislead, 1303); SetFirstName(oMislead, "Gibberling"); AdjustAlignment(oMislead, ALIGNMENT_CHAOTIC, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 106) {SetFirstName(oMislead, "Shadow Mastiff"); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); ApplySizeIncrease(oMislead,1.0);}
- //Demon
- else if(nChoice == 201) {SetFirstName(oMislead, "Succubus"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 202) {SetFirstName(oMislead, "Hezrou"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- //Devil
- else if(nChoice == 300) {SetFirstName(oMislead, "Imp"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 301) {SetFirstName(oMislead, "Erinyes"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 302) {SetFirstName(oMislead, "Horned Devil"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 304) {SetFirstName(oMislead, "Hell Hound"); ApplyEvil(oMislead); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); ApplySizeIncrease(oMislead,1.0);}
- }
- }
- else if(iID == 174 || iID == 175 || iID == 176
- || iID == 177 || iID == 179 || iID == 180
- || iID == 181 || iID == 182 || iID == 178 ) //summon Cr
- {
- nChoice = GetLocalInt(oCaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- //nature
- if(nChoice == 13) {SetCreatureAppearanceType(oMislead, 181); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Wolf"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 1) {SetCreatureAppearanceType(oMislead, 175); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Dire Wolf"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 2) {SetCreatureAppearanceType(oMislead, 387); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Dire Rat"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 3) {SetCreatureAppearanceType(oMislead, 37); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Stag"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 4) {SetCreatureAppearanceType(oMislead, 499); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Rabbit"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 5) {SetCreatureAppearanceType(oMislead, 503); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Weasel"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 6) {SetCreatureAppearanceType(oMislead, 159); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Giant Spider"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 7) {SetCreatureAppearanceType(oMislead, 2326); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Lion"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 8) {SetCreatureAppearanceType(oMislead, 1502); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Snake"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 9) {SetCreatureAppearanceType(oMislead, 13); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Brown Bear"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 10) {SetCreatureAppearanceType(oMislead, 9); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Dire Badger"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 11) {SetCreatureAppearanceType(oMislead, 10); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Bat"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 12) {SetCreatureAppearanceType(oMislead, 21); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Boar"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 14) {SetCreatureAppearanceType(oMislead, 15); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Dire Bear"); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 15) {SetCreatureAppearanceType(oMislead, 22); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Dire Boar"); ApplySizeIncrease(oMislead,1.0);}
- //astral
- else if(nChoice == 100) {SetCreatureAppearanceType(oMislead, 10); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Bat Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 101) {SetCreatureAppearanceType(oMislead, 181); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Wolf Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 102) {SetCreatureAppearanceType(oMislead, 37); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Stag Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 103) {SetCreatureAppearanceType(oMislead, 2326); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Lion Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 104) {SetCreatureAppearanceType(oMislead, 159); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Spider Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 105) {SetCreatureAppearanceType(oMislead, 1062); AdjustAlignment(oMislead, ALIGNMENT_NEUTRAL, 100); SetFirstName(oMislead, "Ant Spirit"); ApplySpirit(oMislead); ApplySizeIncrease(oMislead,1.0);}
- //celestial
- else if(nChoice == 200) {SetCreatureAppearanceType(oMislead, 8); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Badger"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 201) {SetCreatureAppearanceType(oMislead, 9); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Dire Badger"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 202) {SetCreatureAppearanceType(oMislead, 19); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Beetle"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 203) {SetCreatureAppearanceType(oMislead, 37); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Stag"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 204) {SetCreatureAppearanceType(oMislead, 503); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Weasel"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 205) {SetCreatureAppearanceType(oMislead, 2326); AdjustAlignment(oMislead, ALIGNMENT_GOOD, 100); SetFirstName(oMislead, "Celestial Lion"); ApplyGood(oMislead); ApplySizeIncrease(oMislead,1.0);}
- //fiendish
- else if(nChoice == 300) {SetCreatureAppearanceType(oMislead, 387); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Dire Rat"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 301) {SetCreatureAppearanceType(oMislead, 181); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Wolf"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 302) {SetCreatureAppearanceType(oMislead, 1003); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Wolverine"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 303) {SetCreatureAppearanceType(oMislead, 21); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Boar"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 304) {SetCreatureAppearanceType(oMislead, 1502); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Snake"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- else if(nChoice == 305) {SetCreatureAppearanceType(oMislead, 159); AdjustAlignment(oMislead, ALIGNMENT_EVIL, 100); SetFirstName(oMislead, "Fiendish Spider"); ApplyEvil(oMislead); ApplySizeIncrease(oMislead,1.0);}
- }
- }
- else if(iID == 1618) //bladedance
- {
- int iBABa = GetTRUEBaseAttackBonus(oCaster);
- int iBABb = GetTRUEBaseAttackBonus(oMislead);
- int nBABc = iBABa - iBABb;
- if(nBABc != 0)
- {
- effect eBABm = EffectBABMinimum(nBABc);
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(eBABm), oMislead, 0.0f);
- }
- SetBaseAbilityScore(oMislead, ABILITY_STRENGTH, GetAbilityScore(oCaster, ABILITY_STRENGTH));
- SetBaseAbilityScore(oMislead, ABILITY_CONSTITUTION, GetAbilityScore(oCaster, ABILITY_CONSTITUTION));
- SetBaseAbilityScore(oMislead, ABILITY_DEXTERITY, GetAbilityScore(oCaster, ABILITY_DEXTERITY));
- SetBaseAbilityScore(oMislead, ABILITY_WISDOM, GetAbilityScore(oCaster, ABILITY_WISDOM));
- ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAbilityIncrease(ABILITY_STRENGTH, 2), oMislead, 6.0f);
- SetWillSavingThrow(oMislead, GetWillSavingThrow(oCaster));
- SetReflexSavingThrow(oMislead, GetReflexSavingThrow(oCaster));
- SetFortitudeSavingThrow(oMislead, GetFortitudeSavingThrow(oCaster));
- FeatAdd(oMislead, FEAT_WEAPON_PROFICIENCY_EXOTIC, FALSE, FALSE, FALSE);
- object oItem = GetLocalObject(oCaster, "bladedance_item");
- object oNewItem = CopyItem(oItem, oMislead, TRUE);
- SetDroppableFlag(oNewItem, FALSE);
- SetLocalInt(oNewItem, "item_no_trade", 1);
- AssignCommand(oMislead, ClearAllActions());
- AssignCommand(oMislead, ActionEquipItem(oNewItem, INVENTORY_SLOT_RIGHTHAND));
- DelayCommand(1.0f, SetBaseAttackBonus(1, oMislead));
- DelayCommand(6.0f, BladeDance(oCaster, oMislead, oItem));
- }
- else if(iID == 1633) //army of death
- {
- SetLocalString(oMislead, "slot", sSpellName);
- DelayCommand(5.0f, SetEventHandler(oMislead, 10, "bg_spell_conjdmarmy1"));
- }
- else if(iID == 1595)
- {
- int iMyParry = ((iCL * 2) - 10);
- if(iMyParry < 5)
- iMyParry = 5;
- SetBaseSkillRank(oMislead, SKILL_PARRY, iMyParry, TRUE);
- SetActionMode(oMislead, ACTION_MODE_PARRY, TRUE);
- }
- //Do not buff called creatures. Done in cmi_ginc_spells.
- BuffSummons(oCaster, 0, 0, ASSOCIATE_TYPE_SUMMONED, oMislead, iCompetative, iID);
- //SendMessageToPC(oCaster, "ID == "+IntToString(iID)+" nChoice == "+IntToString(nChoice));
- AssignCommand(oCaster, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SetEffectSpellId(SupernaturalEffect(EffectCutsceneDominated()), SUMMON_DOMINATE), oMislead, fDuration));
- SetIsCompanionPossessionBlocked(oMislead, FALSE);
- if(GetRacialType(oMislead) == RACIAL_TYPE_OUTSIDER)
- {
- int nEvil = GetAlignmentGoodEvil(oMislead);
- if(nEvil == ALIGNMENT_EVIL)
- {
- SetEventHandler(oMislead, 1, "inc_demon_devil_behavior1"); //behave like a proper evil summon
- }
- }
- SetDescription(oMislead, "This is a "+GetName(oMislead)+".");
- DestroyObject(oMaster, 2.0);
- AssignCommand(oMislead, DelayCommand(fDuration, RemoveSummon(oMislead)));
- //DelayCommand(2.0f, AttackNearest(oMislead, lTarget, oCaster));
- }
- void NodeDoSummon(object oNode, string sBlueprint, int iDuration, float fDuration, int iVisual, location lTarget, string sSpellName, int iCompetative = FALSE, int iNoSummon = FALSE, int iID = -1)
- {
- //SendMessageToPC(GetPrimaryPlayer(),"Debug: Found ID = "+IntToString(iID));
- if(iID == 63) //gate
- {
- object oMaster = GetLocalObject(oNode, "caster");
- int nChoice = GetLocalInt(oMaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- iCompetative = 10; //scale up to level 20
- if(nChoice == 7) {sBlueprint = "gate_summon_angel"; iCompetative = 0;}
- else if(nChoice == 107) {sBlueprint = "gate_summon_xorn"; iCompetative = 0;}
- else if(nChoice == 105) {sBlueprint = "c_night_hag";}
- else if(nChoice == 103) {sBlueprint = "c_djinni";}
- else if(nChoice == 200) {sBlueprint = "bg_shadowdemon";}
- else if(nChoice == 201) {sBlueprint = "c_summ_succubus";}
- else if(nChoice == 202) {sBlueprint = "c_hezrou";}
- else if(nChoice == 203) {sBlueprint = "c_balor";}
- else if(nChoice == 301) {sBlueprint = "c_erinyes";}
- else if(nChoice == 302) {sBlueprint = "c_devilhorn";}
- else if(nChoice == 303) {sBlueprint = "c_fiend";}
- else if(nChoice == 304) {sBlueprint = "gate_summon_devil"; iCompetative = 0;}
- else if(nChoice == 403) {sBlueprint = "c_elmairelder";}
- else if(nChoice == 413) {sBlueprint = "c_elmfireelder";}
- else if(nChoice == 423) {sBlueprint = "c_elmwaterelder";}
- else if(nChoice == 433) {sBlueprint = "c_elmearthelder";}
- }
- }
- else if(iID == 69 || iID == 96 || iID == 451
- || iID == 128) //planar binding & ally
- {
- object oMaster = GetLocalObject(oNode, "caster");
- int nChoice = GetLocalInt(oMaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- //GOOD
- if(nChoice == 1) {sBlueprint = "c_celestialbear";} //lion
- else if(nChoice == 2) {sBlueprint = "c_celestialwolf";} //stag
- else if(nChoice == 3) {sBlueprint = "c_celestialwolf";}
- else if(nChoice == 4) {sBlueprint = "c_celestialbear";}
- else if(nChoice == 5) {sBlueprint = "c_celestialdbear";}
- //NEUTRAL
- else if(nChoice == 100) {sBlueprint = "c_firemephit";}
- else if(nChoice == 101) {sBlueprint = "c_impice";}
- else if(nChoice == 102) {sBlueprint = "c_summ_sylph";}
- else if(nChoice == 103) {sBlueprint = "c_djinni";}
- else if(nChoice == 104) {sBlueprint = "c_djinni";} //gibberling
- else if(nChoice == 106) {sBlueprint = "c_dogshadow";}
- //Demon
- else if(nChoice == 200) {sBlueprint = "bg_shadowdemon";}
- else if(nChoice == 201) {sBlueprint = "c_summ_succubus";}
- else if(nChoice == 202) {sBlueprint = "c_hezrou";}
- //Devil
- else if(nChoice == 300) {sBlueprint = "c_summ_imp";}
- else if(nChoice == 301) {sBlueprint = "c_erinyes";}
- else if(nChoice == 302) {sBlueprint = "c_devilhorn";}
- else if(nChoice == 303) {sBlueprint = "c_fiend";}
- else if(nChoice == 304) {sBlueprint = "c_doghell";}
- //Elemental
- else if(nChoice == 400) {sBlueprint = "c_elmair";}
- else if(nChoice == 401) {sBlueprint = "c_elmairhuge";}
- else if(nChoice == 410) {sBlueprint = "c_elmfire";}
- else if(nChoice == 411) {sBlueprint = "c_elmfirehuge";}
- else if(nChoice == 420) {sBlueprint = "c_elmwater";}
- else if(nChoice == 421) {sBlueprint = "c_elmwaterhuge";}
- else if(nChoice == 430) {sBlueprint = "c_elmearth";}
- else if(nChoice == 431) {sBlueprint = "c_elmearthhuge";}
- }
- }
- else if(iID == 180 || iID == 181 ||
- iID == 182 || iID == 178 ) //summon creature VI to IX
- {
- object oMaster = GetLocalObject(oNode, "caster");
- int nChoice = GetLocalInt(oMaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- //elemental
- if(nChoice == 400) {sBlueprint = "c_elmair";}
- else if(nChoice == 401) {sBlueprint = "c_elmairhuge";}
- else if(nChoice == 402) {sBlueprint = "c_elmairgreater";}
- else if(nChoice == 403) {sBlueprint = "c_elmairelder";}
- else if(nChoice == 410) {sBlueprint = "c_elmfire";}
- else if(nChoice == 411) {sBlueprint = "c_elmfirehuge";}
- else if(nChoice == 412) {sBlueprint = "c_elmfiregreater";}
- else if(nChoice == 413) {sBlueprint = "c_elmfireelder";}
- else if(nChoice == 420) {sBlueprint = "c_elmwater";}
- else if(nChoice == 421) {sBlueprint = "c_elmwaterhuge";}
- else if(nChoice == 422) {sBlueprint = "c_elmwatergreater";}
- else if(nChoice == 423) {sBlueprint = "c_elmwaterelder";}
- else if(nChoice == 430) {sBlueprint = "c_elmearth";}
- else if(nChoice == 431) {sBlueprint = "c_elmearthhuge";}
- else if(nChoice == 432) {sBlueprint = "c_elmearthgreater";}
- else if(nChoice == 433) {sBlueprint = "c_elmearthelder";}
- else {sBlueprint = "c_beardire";}
- }
- }
- else if(iID == 29 || iID == 30) //create undead
- {
- object oMaster = GetLocalObject(oNode, "caster");
- int nChoice = GetLocalInt(oMaster, "BGC_"+IntToString(iID));
- if(nChoice > 0)
- {
- //normal
- if(nChoice == 1) {sBlueprint = "c_s_mummy";}
- else if(nChoice == 2) {sBlueprint = "c_s_wraith";}
- else if(nChoice == 3) {sBlueprint = "c_s_ghast";}
- //greater
- else if(nChoice == 4) {sBlueprint = "c_s_vampire_warrior";}
- else if(nChoice == 5) {sBlueprint = "c_s_vampire_warlock";}
- }
- }
- SetAILevel(oNode, AI_LEVEL_HIGH );
- lTarget = CalcSafeLocation(OBJECT_SELF, lTarget, 8.0f, FALSE, FALSE);
- effect eCopy = EffectSummonCreature(sBlueprint, iVisual, 0.0f);
- if(iDuration == DURATION_TYPE_PERMANENT)
- fDuration = 0.0f;
- else
- fDuration = fDuration + 30.0f;
- ApplyEffectAtLocation(iDuration, eCopy, lTarget, fDuration);
- DelayCommand(0.5f, Control(oNode, sSpellName, fDuration, sBlueprint, lTarget, iCompetative, iNoSummon, iID));
- }
- //This hook function spawns a summon using BGTSCC's replacement summoning code.
- //The new creature is summoned via a spellhook and then dominated by the caster, and assigned a new tag.
- //existing creatures by that tag are first removed.
- void SpawnSummon(object oMaster, string sBlueprint, int iDuration, float fDuration, int iCL, string sSpellName, int iVisual, location lTarget, int iCompetative = FALSE, int iNoSummon = FALSE, int iID = -1)
- {
- if(GetIsPC(oMaster) != TRUE)
- {
- effect eSummon = EffectSummonCreature(sBlueprint, iVisual, 1.0f, 0);
- ApplyEffectAtLocation(iDuration, eSummon, lTarget, fDuration);
- return;
- }
- if(iID < 1)
- iID = GetSpellId();
- object oPrevSummon = GetObjectByTag(ObjectToString(oMaster)+sSpellName);
- if(GetIsObjectValid(oPrevSummon) == TRUE)
- RemoveSummon(oPrevSummon);
- object oNode = CreateObject(OBJECT_TYPE_CREATURE, "c_attachspellnode", lTarget, FALSE, "");
- SetLocalObject(oNode, "caster", oMaster);
- SetLocalInt(oNode, "mislead_casterlevel", iCL);
- SetFirstName(oNode, GetName(oMaster));
- SetCombatOverrides(oNode, oNode, 0, 0, OVERRIDE_ATTACK_RESULT_MISS, 0, 0, TRUE, TRUE, TRUE, TRUE);
- SetScriptHidden(oNode, TRUE);
- DelayCommand(1.0f, AssignCommand(oNode, NodeDoSummon(oNode, sBlueprint, iDuration, fDuration, iVisual, lTarget, sSpellName, iCompetative, iNoSummon, iID)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement