diff --git a/.gitignore b/.gitignore index 9f8f7f87..dba8fdd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.hak _haks/output/poa_dev.md5 +Compiler - 35spells.bat diff --git a/35expandedspells/disease.2da b/35expandedspells/disease.2da new file mode 100644 index 00000000..e1ca039d --- /dev/null +++ b/35expandedspells/disease.2da @@ -0,0 +1,66 @@ +2DA V2.0 + + Label Name First_Save Subs_Save Incu_Hours Dice_1 Dam_1 Type_1 Dice_2 Dam_2 Type_2 Dice_3 Dam_3 Type_3 Type End_Incu_Script 24_Hour_Script +0 Blinding_Sickness 4689 26 26 1 4 1 0 **** **** **** **** **** **** EXTRA **** NW_S3_BlindSick +1 Cackle_Fever 4690 26 26 1 6 1 4 **** **** **** **** **** **** EXTRA **** **** +2 Demon_Fever 4691 28 28 1 6 1 2 **** **** **** **** **** **** SUPER **** Nw_S3_DemonFev +3 Devil_Chills 4692 24 24 1 4 1 0 **** **** **** **** **** **** SUPER **** **** +4 Filth_Fever 4693 22 22 1 3 1 3 3 1 2 **** **** **** EXTRA **** **** +5 Mindfire 4694 22 22 1 4 1 3 **** **** **** **** **** **** EXTRA **** **** +6 Mummy_Rot 4695 30 30 1 6 1 2 **** **** **** **** **** **** SUPER **** **** +7 Red_Ache 4696 25 25 1 6 1 0 **** **** **** **** **** **** EXTRA **** **** +8 Shakes 4697 23 23 1 6 1 0 **** **** **** **** **** **** EXTRA **** **** +9 Slimy_Doom 4698 24 24 1 4 1 1 **** **** **** **** **** **** EXTRA **** **** +10 Red_Slaad_Eggs 4699 27 27 1 6 2 1 6 2 0 6 2 2 EXTRA NW_S3_SlaadEgg **** +11 Ghoul_Rot 4700 28 28 1 6 1 2 6 1 0 **** **** **** SUPER **** **** +12 Zombie_Creep 4701 25 25 1 4 1 2 4 1 1 **** **** **** SUPER **** **** +13 Dread_Blisters 4702 23 23 1 4 1 2 4 1 5 **** **** **** SUPER **** **** +14 Burrow_Maggots 4703 27 27 1 4 1 3 4 1 4 **** **** **** SUPER **** **** +15 Soldier_Shakes 4704 35 35 1 **** **** **** **** **** **** **** **** **** **** **** Nw_S3_SoldShake +16 Vermin_Madness 4705 23 13 1 1 1 3 1 1 4 1 1 5 EXTRA **** **** +17 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +18 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +19 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +20 Contagion_Blinding_Sickness 4689 127 16 1 4 1 0 **** **** **** **** **** **** EXTRA **** NW_S3_BlindSick +21 Contagion_Cackle_Fever 4690 127 16 1 6 1 4 **** **** **** **** **** **** EXTRA **** **** +22 Contagion_Filth_Fever 4693 127 12 1 3 1 3 3 1 2 **** **** **** EXTRA **** **** +23 Contagion_Mindfire 4694 127 12 1 4 1 3 **** **** **** **** **** **** EXTRA **** **** +24 Contagion_Red_Ache 4696 127 15 1 6 1 0 **** **** **** **** **** **** EXTRA **** **** +25 Contagion_Shakes 4697 127 13 1 6 1 0 **** **** **** **** **** **** EXTRA **** **** +26 Contagion_Slimy_Doom 4698 127 14 1 4 1 1 **** **** **** **** **** **** EXTRA **** **** +27 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +28 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +29 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +30 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +31 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +32 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +33 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +34 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +35 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +36 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +37 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +38 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +39 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +40 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +41 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +42 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +43 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +44 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +45 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +46 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +47 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +48 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +49 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +50 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +51 Pestilence_disease 16826251 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** sp_pest_aux +52 Talonas_Blight 16824947 127 127 2 1 4 2 1 4 5 **** **** **** SUPER **** prc_talona +53 Blue_guts 16829286 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_blue_guts +54 Soul_Rot 16829287 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_soul_rot +55 Agony_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_ag +56 Baccaran_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_bac +57 Devilweed_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_dw +58 Luhix_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_lhx +59 Mushroom_powder_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_msh +60 Sannish_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_snh +61 Terran_Brandy_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_tb +62 Vodare_Addiction **** 127 127 0 **** **** **** **** **** **** **** **** **** SUPER **** prc_addct_vdr diff --git a/35expandedspells/magias alteradas.txt b/35expandedspells/magias alteradas.txt new file mode 100644 index 00000000..980182f5 --- /dev/null +++ b/35expandedspells/magias alteradas.txt @@ -0,0 +1,949 @@ +- alteracoes de magias: nw_s0_ (primeira leva de magias do nwn) + +fireball- caster lvl ate 20 ao inves de 10 +meteor swarm - ao inves de 20d6 de dano agora eh d6(casterlvl) de dano +aberrate- +1 de ac a cada 3 caster lvls sem o cap em 5 de ac +Searing Light- caster lvl max era 10 passou a ser 20 +shadow shield- soak +3/10 alterada para +3/caster lvl +sleep- caster lvl 20 +virtue- ao inves de 1 de hp acima do maximo agora a spell da o seu nivel de caster como hp acima do maximo +Chain Lightning- caster lvl ate 40 ao inves de 20 +Lightning Bolt- era 10 o cap foi para 20 +Phantasmal Killer- ao inves dos 3d6 de dano alterado para 7d6 +Aid/Mass Aid- aumento do maximo de bonus de hp +nw_s0_awaken- aumento nos buffs da criatura ao inves de 4 mudou para 4d4 +Barkskin- removido cap de +5 podendo chegar ate +20 +Blade Barrier b c- maximo 40d6 de dano +Burning Hands- caster maximo de 5 para 20 +Call Lightning- caster maximo de 10 para 20 +Circle of Death- maximo hd afetado subiu de 10 para 40 +Cloudkill a c- hd menor q 20 morre direto, hd entre 21-40 teste contra morte, hd41+ dano +Color Spray- hd 1 a 20 para sleep, 20 a 30 para blind, 40+ para stun +Cone of Cold- cap era 15 passou para 40 caster lvls +daze- adicionado casterlvl/2 ao cap +Delayed Blast Fireball- cap era 20 foi para 60 +Destruction- dano era 10d6 subi para 60d6 +Enervation- hp para undead com cap em 125hp +Energy Drain- hp para undead alem do valor normal da magia + casterlvl+spellpenetration/2 +Fire Storm- cap era 20 agora é 60 caster lvls +Flame Strike- cap era 15d6, agora é 40d6 +Hammer of the Gods- cap era 15 agora é 40 caster lvls +Healing Circle- o cap era 20 caster lvls agora é 40 +Heal/Harm- cap era 150hp e o caster lvl era capado em 20, agora o hp é 150+casterlvl e o lvl 40 de caster +Horrid Wilting- cap era 25 agora é 60 +Incendiary Cloud abc- dano (casterlvl)d6 ao inves de 4d6 +Magic Missile- cap de 5 misseis alterado para ate 20 misseis, classe force missle magic ganha mais misseis a cada 5 levels, dano era 1d4 por missel agora é (casterlvl/4)d4+1 +Power Word Stun- minimo um round de stun +Ray of Frost- sem cap +regeneration- 6+ casterlvl/2 de pontos de hp regenerados a cada 6 segundos +soundburst- dano antes era d8, agora d8() +(casterlvl + spell penetration/4) +Storm of Vengeance- sem cap d6(casterlvl) +Sunbeam= caster cap de 20 para 60 +nw_s0_vamptch- cap estaa em 10 agora esta em 20 +Wall of Fire- adicionado casterlvl/2 ao dano original +Weird- adicionado o caster lvl ao dano original +Word of Faith- hd menor q 20 morre direto, 20a 30 stun ou confusion ou blind, 30 a 40 stun ou blind, 41+ blind + +- nao alteradas (ou nao precisavam, ou ja estao com o cap removido pelo prc, ou necessitam alteracoes em summons, ou muito complicadas para este primeiro lançamento) +convert wand +create tatoo +dimension door +dimension lock +heart ripper +protection from spells +powerword kill +remove fear +Remove Paralysis +sanctuary +see invisibility +Shapechange +spell resist +stoneskin +tenser transformation +time stop +true seeing +warcry +web +contagion +Control Undead +deathward +dmgred +Dominate Animal +Dominate Monster +Dominate Person +doom +elements +energy buffer +Ethereal Visage +Ghostly Visage +Potion of Extra Theiving NW_S0_ExtraThf +Freedom of Movement +Elemental Shield +nw_s0_protection +NW_S0_EvardsB +Flame Lash +Greater Bull's Strength +Greater Cat's Grace +Greater Eagles Splendor +Greater Endurance +Greater Fox's Cunning +Greater Owl's Wisdom +Lesser Spell Breach +Greater Spell Breach +Lesser Spell Mantle +spell mantle +Greater Spell Mantle +Greater Spell Turning +Haste +Hold Animal +Hold Monster +Hold Person +Identify +Knock +Legend Lore +Mass Haste +Polymorph Self +nw_s0_negprot +Minor Globe of Invulnerability +Globe of Invulnerability +Mage Armor +Mordenkainen's Disjunction +Lesser Dispel +Dispel Magic +Greater Dispelling +NW_S0_2PitFiend +nw_s0_abilbuff +Melf's Acid Arrow +Acid Fog +NW_S0_AcidFoga +NW_S0_AcidFogB +NW_S0_AcidFogC +Aura of Vitality +Bestow Curse +NW_S0_BladeBar +Bless +Blindness/Deafness +Charm Person or Animal +Charm Monster +Charm Person +Magic Cirle Against Good a b +Magic Cirle Against Evil a b +clairadvorance +Clarity +Confusion +Create Undead +Create Greater Undead +Summon Shadow +NW_S0_SummShad02 +Creeping Doom a b c +darkness abc +Dismissal +Divine Power +Elemental Swarm +Entangle a b c +Evards Black Tentacles a b c +Fear +Feeblemind +Find Traps +Finger of Death +Flame Arrow +Gate +nw_s0_ghoultch +Grease a b c +Lesser Planar Binding +Planar Binding +Greater Planar Binding +Holy Aura +Unholy Aura +Ice Storm +nw_s0_imprinvis +nw_s0_invisib +Invisibility Purge ab +Invisibility Sphere ab +Lesser Mind Blank +Mind Blank +Mind Fog abc +Mordenkainen's Sword +nw_s0_poison +Ray of EnFeeblement +nw_s0_resis +Scare +Silence abc +nw_s0_slaylive +Slow +Stinking Cloud +Wail of the Banshee +Web abc + +------------------------------------------------------------------------------------------------------------------- +feats/magias alteradas nw_s1_ + +NW_S1_DragWeak - Dragon Breath Weaken - evolutiva ate hd 180 +NW_S1_DragAcid - evolutiva ate hd 180 +NW_S1_DragCold - evolutiva ate hd 180 +NW_S1_DragGas - evolutiva ate hd 180 +NW_S1_Dragfire- evolutiva ate hd 180 +NW_S1_DragLightn- evolutiva ate hd 180 +NW_S1_Dragparal- evolutiva ate hd 180 +NW_S1_Dragsleep- evolutiva ate hd 180 +NW_S1_Dragslow- evolutiva ate hd 180 +Barbarian Rage- comba com todos os rages de classes de prestigio e é evolutiva ate o nivel 180 caso o servidor suporte + +nao alteradas + +Dragon Aura of Fear +Aura of Fire +Aura of Menace +Aura of Protection +Aura of Stunning +Aura of Electricity +Aura of Cold +Aura of Blinding +Howl of Doom +Aura Unearthly Visage +Aura of Unnatural + +---------------------------------------------------------------------------------------------------------------------- +magias/feats alteradas nw_s2_ + + +Vampiric Drain- cap era 5hd foi para 20 +Lay_On_Hands- adicionado healer e combat mdic ao stack de lvls para o bonus de pontos de cura +bard song - evolutiva ate o hitdice 180 caso o servidor suporte, todas as classes bardicas combam no somatorios dos levels + + + +nao alteradas + +Summon Animal Companion +Summon Familiar +Wild Shape +Elemental Shape +Wholeness of Body +Divine Trickery +Divine Strength +Turn Undead + + +------------------------------------------------------------------------------------------------------------------------------- + +magias alteradas x0_s0 + + + +Acid Splash - sem cap +Bigby's Forceful Hand bigby2- adicionado casterlvl/2 ao dc da magia +Bombardment- cap era 20 casterlvls agora eh 60 +Divine Favor- cap de+5 removido evolutivo ate 20 +Earthquake- adicionado casterlvl nos danos e saves +Electric Jolt- sem cap +Firebrand- o cap era 15 agora eh casterlvl/2 +Flare- antes era 1 de attack descrease, agora eh 1+(casterlvl/4) de penalidade +magicfang e greatermagicfang- evolutivas ate+20 ao inves de +5 +Inferno- ao inves de 2d6 de dano, random entre 2 e (casterlvl/2) de dano +Isaacs Lesser Missile Storm- adicionado casterlvl/6 no dano e casterlvl/5 na quantidade de misseis +Isaacs Greater Missile Storm- adicionado casterlvl/5 no dano e casterlvl/5 na quantidade de misseis +Quillfire- cap era 5 agora eh 20 +x0_s0_shieldfait- cap era+5 agora o cap eh +20 respeitando a regra original do buff (2 + (nCasterLevel)/6;) +Spike Growth- cap era 4 agora eh 20 +Sunburst- cap era 25 agora eh 60 e ainda + spell penetration combando com os 60 contra undeads +Bigby's Clenched Fist bigby4- adicionado casterlvl ao dano +Bigby's Crushing Hand bigby5- adicionado casterlvl ao dano + + +nao alteradas + +x0_s0_amplify +Aura of Glory +Bane +Banishment +Bigby's Interposing Hand bigby1 +Bigby's Grasping Hand bigby3 +Blood Frenzy +Camoflage +Continual Flame +Dirge abc +displace +Drown +x0_s0_entEN +x0_s0_entEX +Entropic Shield +Etherealness +Expeditious retreat +Flesh to Stone +Gust of Wind +Balagarn's Iron Horn +Tasha's Hideous Laughter +Mass Camoflage +One with the Land +x0_s0_owlins +Planar Ally +Shield +Stone To Flesh +True Strike +Undeath's Eternal Foe +Wounding Whispers + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +feats/ magias alteradas x0_s1_ x0_s2_ x0_s3_ + + + + + +nao alteradas + +X0_S1_PETRGAZE +X0_S1_PETRtouch +x0_s2_blkdead +Divine Might +Divine Shield +Holy Water +X0_S2_RODWONDER +X0_S1_PETRBREATH +x1_s2_imbuearrow + +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias alteradas x2_s0_ + +Mestil's Acid Breath- cap era 10 agora eh 20 +Mestil's Acid Sheath- cap de 30 foi para 40 +ball lighting- cap era 15 foi para 40 +x2_s0_combust- cap era 10 foi para 20 +Crumble- cap era 15 agora eh 40 +x2_s0_cureother- cap era 20 agora eh 40 +Death Armor- cap era+5 agora +20 +Gedlee's Electric Loop- cap era+5 agora +20 +Horizikaul's Boom- cap era+5 agora +20 +Ice Dagger- cap era+5 agora +20 +magic vestiment- cap era 5 agora 21 +Scintillating Sphere- cap era 10 agora 20 +Tide of Battle- minimo 60 de dano, maximo casterlvl+d100 +Undeath to Death- cap era 20 agora 40 + + + +nao alteradas + +Vine Mine, Camouflage abc +Vine Mine, Entangle abc +Vine Mine, Hamper Movement abc +Aura of Glory +Battletide abc +Black blade of disaster +Cloud of Bewilderment abc +Create Undead +x2_s0_enhweap +Evil Blight +Glyph of Warding abc +Great Thunderclap +Haste or Slow +x2_s0_healstng +hellfire abc +Hellish Inferno +x2_s0_infestmag +x2_s0_ironguts +Shelgarn's Persistent Blade +Restoration +x2_s0_stnbones +Stonehold abc + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +feats/magias alteradas x2_s1_ x2_s2_ x2_s3_ + + +Breath Weapon for Dragon Disciple Class- evolutiva ate 60 lvls da classe caso o servidor suporte +curse song- igual a bardsong so que com debuffs +Dragon Breath Negative Energy- evolutivo ate 180 hd +Epic Ward- ao inves de 50/+20, 10+(casterlvl/2)/+20 +Epic Mage Armor- ao inves de 5 de ac de cada tipo da casterlvl/4 de ac de cada tipo + + + + + + +nao alteradas + +Slaad Chaos Spittle +x2_s1_petrgaze +Psionic Inertial Barrier +Dragon Knight +Mummy Dust +Greater Wild Shape, Humanoid Shape +Summon Greater Undead +Summon Undead +Wild Shape +X2_S2_WildShpeDK +OnHit Darkfire +OnHitCastSpell Deafening Clang +OnHit Firedamage +x2_s3_sequencer +Slay Rakshasa + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias alteradas sp_a* + +Ayailla's Radiant Burst- cap era+5 agora +20 +acid storm- cap era 15 agora 40 +Agannazzar's Scorcher- cap era 5 agora 20 +Apocalypse from the Sky- d8(casterlvl) sem cap +sp_armordark- cap de ac era 8 agora 25 + +nao alteradas + +Absorb Strength +Abyssal Might +Acidic Fire +acidorb +Addiction +Agony +Alchemist's Frost +Alchemical Sleep Gas +Alchemist's Spark +Amber Sarcophagus +Angry Ache +Animalistic Power +Animal Trance +Animate Objects +Antimagic Field +Antitoxin +Arcane Eye +Arrow of Bone +Arrow Storm +Arrowsplit +Augment Familiar +Avascular Mass abc +Avasculate + + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias sp_b* + +Bigby's Striking Fist- cap era 5 agora 20 +Bibgy's Tripping Hand- cap era 5 agora 20 +Blast of Force- cap era 5 agora 20 +Blessing of Bahamut- adicionado o casterlvl/2 na reducao de dano +Blast of Flame- cap era 10 agora 40 +Bolt of Glory- cap era 15 e 7, agora 40 e 30 + + +nao alteradas + +Brilliant Emanation abc +Brilliant Energy Arrow +Brittlebone +Break Enchantment +Burning Bolt +Baccaran +Baleful Polymorph +Baleful Transposition +Benign Transposition +Bestow Wound +Bile Droppings +blacklight abc +Blade of Blood +Blades of Fire +blasphemy +Bloodfreeze Arrow +Blend Cream +Bless Water +Blink +Blinding Glory abc +Blood of the Martyr +Blur +Bodak Birth +Bone Blade +Bones of the Earth ab +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias sp_c* + +Celestial blood adicionado casterlvl/2 nas resistencias originais da magia +Chaav's Laugh- cap era 20 em bonus de hp agora 40 +Channeled Pyroburst- cap era 10 agora 40 +close wounds- d4(nCasterLvl)+8 ao inves de 2d4 de heal +Cloud of the Achaierai- caster lvl adicionado ao dano +Clutch of Orcus- casterlvl/4 adicionado ao dano +Curse of Impending Blades- cap era 5 agora 20 +Curse of Petty Failing-cap era 5 agora 20 + + +nao alteradas + +Curse Water +Call Dretch Horde +Call Faithful Servants +Call Lemure Horde +Calm Emotions abc +Changestaff +prc_chilltouch +Change Shape use +Change Shape +sp_clarityofmind +Claws of the Bebilith +Claws of the Savage +True Resurrection +coldorb +sp_comm_undead +Command +Consecrate abc +sp_contagious +Control Weather +Convert Wand +sp_convict +Crackle Powder ab +Crafter's Blessing +Crafter's Curse +sp_createtatoo +Crown of Might +Crown of Protection +Crushing Despair +Crushing Fist of Spite +Curse of the Putrid Husk + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias sp_d* + +Dispelling Touch- cap era 10 agora 20 +Disrupt Undead/Greater Disrupt Undead- adicionado casterlvl/4 ecasterlvl/3 ao dano respectivamente +Diamond Spray-cap era 10 agora 40 +Doom Scarabs-cap era 10 agora 40 +Damning Darkness- casterlvl/2 adicionado ao dano +Dancing Web-cap era 10 agora 40 +darkbolt- cap era 7 agora 40 +Deep Slumber-cap era 9 agora 20 +Deflect cap era 5 agora 20 + +nao alteradas + +Discern Location +Disintegrate +Divine Inspiration +Divine Sacrifice +Divine Protection +Draconic Might +OnHit Firedamage +Dread Word +Dragon Ally +Dragon Cloud +Darkflame Arrow +Drug Resistance +Death by Thorns +Dancing Lights +Daylight +Doublestrike Arrow +Death Knell +deepdarkness +Demoncall +Demonflesh +Desecrate +Despoil +Detect Favored Enemy +sp_det_undead +Detect Evil +detectchaos +detectgood +detectlaw +detectmagic +Devil's Ego +Devil's Eye +Devil Weed +Dimensional Anchor +Dimension Door +Dimension Hop +Dimensional Lock +dictum +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +magias sp_e* + + +Elemental Strike- cap era 15 agora 40 +Energize Potion- cap era 3 agora 20 +Exalted Fury- adicionado casterlvl ao dano +Exalted Raiment- maximo de ac era+4 agora eh +8 no lvl 40, ainda continua alterando tendencia de alinhamento +Extract Water Elemental- cap era 20 agora 40 + + + +nao alteradas + +Ectoplasmic Enhancement +sp_eiacid,cold,elec... +energy immunity +Elation +elecorb +Elemental Comflaguration spellscript +Embalming Fire +Energy Ebb +Energy Surge +Enlarge Person +Energy Aegis +Enthrall +eterCharm Monster +eterCharm Person +Eternity of Torture +Evil Eye +Evil Weather +Extract Drug +Eye of the Beholder +Eyebite +Eyes of the Avoral + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +magias sp_f* + +Forceblast- cap era 10 agora 20 +Force Orb- cap era 10 agora 40 +False Life- cap era 10 agora 20 +Song of Festering Death- cap era 2 agora 20 +Fire Trap- cap era 20 agora 40 +fireburst- cap era 5 agora 20 +Flesh Armor- adicionado casterlvl/2 ao soak resistence +Flesh Ripper-cap era 10 agora 20 + +nao alteradas + +Fog Cloud +Foresight +Rain of Frogs or Fish +Faerie Fire +Fareye Oil +Fiendish Clarity +Festering Bomb +Fire in the Blood +fireorb +FIST OF STONE +flashburst +Flash Pellet +flensing +Tenser's Floating Disk + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +magias alteradas sp_g_* + +Greater Heroism- cap era 20 agora 40 +Gutwrench- adicionado o casterlvl ao dano +Greater Fireburst- cap era 15 agora 40 + +nao alteradas + +Ghoul Gauntlet +Glibness +Greater Command +greenfire +Grim Revenge +Greater Scrying +sp_green_fogC +Greater Teleport +Gaseous Form +Glitterdust +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +magias alteradas sp_h_* + +hellfire- ao inves de 3d6 de dano d6(nCasterLvl/2)+3 +sp_heroism-unificada com a spell greater heroism +hellfirestorm- ao inves de 5d6 dano é d6(nCasterLvl)+5 +Hail of Stone- cap era 5 agora 20 +Healer's Balm- 5pontos de skill heal ao inves de 1 + +nao alteradas + +Heartclutch +Hide from Animals +Hide from Undead +Holy Aura +Holy Word +Hound of Doom +Halt +Halt Undead +Hammer of Righteousness +Heal Animal Companion +Heart Ripper +Heartache +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +magias alteradas sp_i_* j k + +Ice Knife- adicionado casterlvl/4 ao dano +Ice Burst- cap era 10 agora 20 +Improved Mage Armor- cap em 13 de ac ao inves de 8 +Kelgore's Fire Bolt- cap era 5 agora 20 + + +nao alteradas + +Ilyykur's Mantle +Insanity +Iron Body +Jump +Keenear Powder + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +magias alteradas sp_l_* + +Legion's Curse of Impending Blades- cap do save bonus era 5 agora 15 +Legion's Curse of Petty Failing- cap do save bonus era 5 agora 15 +Leonal's Roar- adicionado casterlvl ao dano +lower spell resistence- cap era 15 agora 40 +Lahm's Finger Darts- caster lvl adicionado ao dano +Legion's Conviction- cap do save bonus era 5 agora 15 + + + + +nao alteradas + +Lesser Shivering Touch +Life Bolt +sp_lionheart +Liquid Pain +Living Undeath +Locate Creature +Lockslip Grease +Locate Object +Longstrider +Last Judgment +Luhix +Luminous Armor +Lantern Light + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +magias alteradas sp_m_n_o* + +Necrotic Bloat- cap era 10 agora 20 +Necrotic Burst-cap era 15 agora 40 +Necrotic Eruption-cap era 15 agora 60 +Necrotic Termination-cap era 25 agora 80 +sp_nght_caress-cap era 15 agora 40 +Otiluke's Freezing Sphere- cap era 15 agora 40 +Mass Fire Shield- cap era 15 agora 40 + + + + +nao alteradas + +Morality Undone +Necrotic Cyst +Necrotic Domination +Necrotic Empowerment +sp_nondetection +Obscuring Mist +Otiluke's Resilient Sphere abc +sp_magehand +Magic Stone +Masochism +Mass Contagion +mass drown +mass hold monster +mass hold person +Mirror Image +Mislead x + +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +magias alteradas sp_p_* + +Phoenix Fire- cap era 40 agora 60 +pnp Fire Shield-cap era 15 agora 40 +Polar Ray-cap era 25 agora 60 +Prismatic Wall-adicionado casterlvl+spell penetration ao dano +Prismatic Ray- adicionado casterlvl/2 ao dano +Prismatic Sphere-adicionado casterlvl+spell penetration ao dano +Protection from Arrows- adicionado (casterlvl/4) aos 10/ de reducao de dano piercing +Panacea- cap era 20 agora 40 + + +nao alteradas + +Pestilence abc +Phantom Steed +Phieran's Resolve +Plague of Undead +Power Leech +Pox +Power Word Blind +Pyrotechnics abc +sp_pattern + +================================================================================================================================================================================ + +magias alteradas sp_r_* + + +Ring of Blades abc- cap era 10 agora 20 +Rain of Black Tulips- adicionado caster lvl ao dano +Rain of Embers- adicionado caster lvl ao dano +Rainbow Blast-cap ate casterlvl 20 +Rapture of Rupture-adicionado casterlvl+spell penetration ao dano +Righteous Smite- removido o cap que era 20 +Righteous Might-damage reduction evolutivo a cada 2 casterlvls ate lvl 41 com um total de +2 soak 28 + +nao alteradas + +Rotting Curse of Urfestra +Rouse +Rage +Rain of Blood +Rain of Roses abc +Rain of Frogs or Fish +sp_ray_charmm.nss beholder +sp_ray_charmp.nss beholder +sp_ray_disint.nss beholder +Ray of Exhaustion +sp_ray_fear.nss beholder +sp_ray_flshstn beholder +sp_ray_fingdth beholder +Ray of Hope +Eye of the Beholder: Inlfict Moderate Wounds beholder +sp_ray_sleep.nss beholder +sp_ray_slow.nss beholder +Read Magic +Reality Blind +Recitation +Red Fester +Regroup +Repel Vermin +Repulsion abc +Resonating Resistance +Revivify + + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +magias alteradas sp_s_* + +Sudden Stalagmite- cap era 10 agora 40 +Storm of Shards -cap era 20 agora 40 +Sunmantle- adicionado casterlvl/4 nas resistencias a dano +Scorching Ray-adicionado casterlvl e spell penetration ao dano e mais raios +Seeking Ray-adicionado casterlvl+spellpenetration/4 +Seething Eyebane- adicionado casterlvl/4 ao dano +Serpent's Sigh-cap era 10 agora 20 +Shocking Grasp-cap era 5 agora 20 +Shout/greater series adicionado casterlvl +spell/2 penetration ao dano +Shriveling-cap era 10 agora 20 +Slashing Dispell-cap era 10 agora 40 +Slashing Darkness-cap era 5 agora 20 +Snilloc's Snowball-cap era 5 agora 20 +Spiderskin-maximo +8 de buff ao inves de 5 no lvl21 + +nao alteradas + + +Starmantle +Stunning Screech +Stop Heart +Summon Undead Series +Sure Strike +Sword of Conscience +sp_symbol abc series +Sannish +Sarcophagus of Stone +Scintillating Pattern +Screaming Flask +Scrying +Sequester +Serpent Arrow +Shadow Arrow +Shadow Spray +Shedden +Shield Other +Shivering Touch +Sicken Evil abc +Sinsabur's Baleful Bolt +Sleet Storm abc +Snare abc +Sobriety +Softfoot +Solid Fog abc +Song of Discord +Sonic Shield +sonic orb +sorrow +sp_soulscour +Spell Turning +sphere of ultimate destruction +Spell Resistance +Spores of the Vrock +Spellslayer Arrow + + + +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +magias alteradas sp_ t u v w * + +Thousand Needles-adicionado casterlvl/2 ao dano +Touch of Fatigue-cap era 5 agora 20 +Unliving Weapon- cap era 10 agora 20 +Wall of Frost abc-adicionado casterlvl/2 ao dano +Wretched Blight- cap era 15 agora 60 + +nao alteradas + +Touch of Idiocy +Touch of Juiblex +Teleportation Circle +Teleport +Terran Brandy +Throw energized potion +Tongue of Baalzebul +Tomb of Light +Towering Oak +Transport via Plants +Tree Shape +sp_tru_truefrnd +True Resurrection +True Casting +Twilight Luck +Undetectable alignment +Unheavened +Unnerving Gaze +unyieldroots +Utterdark +sp_vigor series +sp_vigor_mass +Vile Death +Violet Rain +Viscid Globe +Vision of Heaven +Vodare +sp_walldispel a b c +Water Breathing +Wave of Exhaustion +Wave of Grief +Wave of Pain +Waves of Fatigue +Weeping Stone +Whirling Blade +Wolfskin +Wrack +Word of Recall +Word of Balance +Word of Chaos + + + + + + + + + + + + + diff --git a/35expandedspells/nw_s0_aid.ncs b/35expandedspells/nw_s0_aid.ncs new file mode 100644 index 00000000..c11623f0 Binary files /dev/null and b/35expandedspells/nw_s0_aid.ncs differ diff --git a/35expandedspells/nw_s0_aid.nss b/35expandedspells/nw_s0_aid.nss new file mode 100644 index 00000000..7fc39750 --- /dev/null +++ b/35expandedspells/nw_s0_aid.nss @@ -0,0 +1,131 @@ +//:://///////////////////////////////////////////// +//:: Name Aid/Mass Aid +//:: FileName nw_s0_aid.nss +/*::////////////////////////////////////////////// +Aid +Enchantment (Compulsion) [Mind-Affecting] +Level: Clr 2, Good 2, Luck 2 +Components: V, S, DF +Casting Time: 1 standard action +Range: Touch +Target: Living creature touched +Duration: 1 min./level +Saving Throw: None +Spell Resistance: Yes (harmless) + +Aid grants the target a +1 morale bonus on attack +rolls and saves against fear effects, plus +temporary hit points equal to 1d8 + caster level +(to a maximum of 1d8 + 10 temporary hit points at +caster level 10th). + +Mass Aid +Enchantment (Compulsion) [Mind-Affecting] +Level: Clr 3 +Range: Close (25 ft. + 5 ft./2 levels) +Targets: One or more creatures within a 30 ft. range. +Components: V, S, DF +Casting Time: 1 standard action +Duration: 1 min./level +Saving Throw: None +Spell Resistance: Yes (harmless) + +Subjects gain +1 morale bonus on attack rolls and +saves against fear effects, plus temporary hit +points equal to 1d8 + caster level (to a maximum +of 1d8 + 15 at caster level 15). +//::*///////////////////////////////////////////// + +#include "prc_sp_func" + +void StripBuff(object oTarget, int nBuffSpellID, int nMassBuffSpellID) +{ + effect eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + int nSpellID = GetEffectSpellId(eEffect); + if (nBuffSpellID == nSpellID || nMassBuffSpellID == nSpellID) + RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } +} + +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nSpellID) +{ + //Declare major variables + location lTarget; + int nMetaMagic = PRCGetMetaMagicFeat(); + int bMass = nSpellID == SPELL_MASS_AID; + int nBonusLimit = bMass ? 20 : 15; + float fDuration = TurnsToSeconds(nCasterLevel); + if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2; + + effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eAttack = EffectAttackIncrease(1); + effect eSave = EffectSavingThrowIncrease(SAVING_THROW_ALL, 1, SAVING_THROW_TYPE_FEAR); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eAttack, eSave); + eLink = EffectLinkEffects(eLink, eDur); + + if(bMass) + { + lTarget = PRCGetSpellTargetLocation(); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + while(GetIsObjectValid(oTarget)) + { + if(((!bMass) || (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))) && PRCGetIsAliveCreature(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE)); + + int nBonus = d8(1); + if(nMetaMagic & METAMAGIC_MAXIMIZE) nBonus = 8; + if(nMetaMagic & METAMAGIC_EMPOWER) nBonus += (nBonus / 2); + nBonus += nBonusLimit > nCasterLevel ? nCasterLevel : nBonusLimit; + + effect eHP = EffectTemporaryHitpoints(nBonus); + + // Remove pervious castings of it + StripBuff(oTarget, SPELL_AID, SPELL_MASS_AID); + + //Apply the VFX impact and effects + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel, oCaster); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, fDuration); + } + if(!bMass) break; + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nSpellID = PRCGetSpellId(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget && IsTouchSpell(nSpellID)) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nSpellID); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nSpellID)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_awaken.ncs b/35expandedspells/nw_s0_awaken.ncs new file mode 100644 index 00000000..c9acdba6 Binary files /dev/null and b/35expandedspells/nw_s0_awaken.ncs differ diff --git a/35expandedspells/nw_s0_awaken.nss b/35expandedspells/nw_s0_awaken.nss new file mode 100644 index 00000000..17d25acc --- /dev/null +++ b/35expandedspells/nw_s0_awaken.nss @@ -0,0 +1,92 @@ +/* + nw_s0_awaken + + This spell makes an animal ally more + powerful, intelligent and robust for the + duration of the spell. Requires the caster to + make a Will save to succeed. + + By: Preston Watamaniuk + Created: Aug 10, 2001 + Modified: Jun 12, 2006 +*/ + +#include "prc_sp_func" +#include "inc_npc" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + //Declare major variables + effect eStr = EffectAbilityIncrease(ABILITY_STRENGTH, d4(4)); + effect eCon = EffectAbilityIncrease(ABILITY_CONSTITUTION, d4(4)); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eInt; + effect eAttack = EffectAttackIncrease(d4(2)); + effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); + int nInt = d10(); + //int nDuration = 24; + int nMetaMagic = PRCGetMetaMagicFeat(); + + if(GetAssociateTypeNPC(oTarget) == ASSOCIATE_TYPE_ANIMALCOMPANION && GetMasterNPC(oTarget) == oCaster) + { + if(!GetHasSpellEffect(SPELL_AWAKEN)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_AWAKEN, FALSE)); + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nInt = 10;//Damage is at max + if(nMetaMagic & METAMAGIC_EMPOWER) + nInt += (nInt/2); //Damage/Healing is +50% + //if(nMetaMagic & METAMAGIC_EXTEND) + // nDuration *= 2; //Duration is +100% + + eInt = EffectAbilityIncrease(ABILITY_WISDOM, nInt); + + effect eLink = EffectLinkEffects(eStr, eCon); + eLink = EffectLinkEffects(eLink, eAttack); + eLink = EffectLinkEffects(eLink, eInt); + eLink = EffectLinkEffects(eLink, eDur); + eLink = SupernaturalEffect(eLink); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0f, TRUE, SPELL_AWAKEN, nCasterLevel); + } + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + if(!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_barkskin.ncs b/35expandedspells/nw_s0_barkskin.ncs new file mode 100644 index 00000000..c8326cfd Binary files /dev/null and b/35expandedspells/nw_s0_barkskin.ncs differ diff --git a/35expandedspells/nw_s0_barkskin.nss b/35expandedspells/nw_s0_barkskin.nss new file mode 100644 index 00000000..9e899b43 --- /dev/null +++ b/35expandedspells/nw_s0_barkskin.nss @@ -0,0 +1,95 @@ +//:://///////////////////////////////////////////// +//:: Barkskin +//:: nw_s0_barkskin.nss +//:://///////////////////////////////////////////// +/* +Transmutation +Level: Drd 2, Rgr 2, Plant 2 +Components: V, S, DF +Casting Time: 1 standard action +Range: Touch +Target: Living creature touched +Duration: 10 min./level +Saving Throw: None +Spell Resistance: Yes (harmless) + +Barkskin toughens a creature’s skin. The effect +grants a +2 enhancement bonus to the creature’s +existing natural armor bonus. This enhancement +bonus increases by 1 for every three caster levels +above 3rd, to a maximum of +5 at caster level 12th. + +The enhancement bonus provided by barkskin stacks +with the target’s natural armor bonus, but not with +other enhancement bonuses to natural armor. A +creature without natural armor has an effective +natural armor bonus of +0. +*/ +//::////////////////////////////////////////////// +//:: By: Preston Watamaniuk +//:: Created: Feb 21, 2001 +//:: Modified: Jun 12, 2006 +//::////////////////////////////////////////////// + +#include "prc_sp_func" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel) +{ + if(!PRCGetIsAliveCreature(oTarget)) + { + FloatingTextStringOnCreature("Selected target is not a living creature.", oCaster, FALSE); + return FALSE; + } + + float fDuration = TurnsToSeconds(nCasterLevel) * 10; + //Enter Metamagic conditions + int nMetaMagic = PRCGetMetaMagicFeat(); + if(nMetaMagic & METAMAGIC_EXTEND) //Duration is +100% + fDuration *= 2; + + //Determine AC Bonus based Level. + int nBonus = (nCasterLevel / 3) + 1; + if(nBonus > 20) + nBonus = 20; + + //Make sure the Armor Bonus is of type Natural + effect eLink = EffectACIncrease(nBonus, AC_NATURAL_BONUS); + eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN)); + eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + effect eHead = EffectVisualEffect(VFX_IMP_HEAD_NATURE); + + //Signal spell cast at event + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BARKSKIN, FALSE)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, SPELL_BARKSKIN, nCasterLevel); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHead, oTarget); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(); + int nEvent = GetLocalInt(OBJECT_SELF, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(OBJECT_SELF, PRC_SPELL_HOLD) && OBJECT_SELF == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(OBJECT_SELF, 1); //change 1 to number of charges + return; + } + DoSpell(OBJECT_SELF, oTarget, nCasterLevel); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(OBJECT_SELF, oTarget, nCasterLevel)) + DecrementSpellCharges(OBJECT_SELF); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_bladebara.ncs b/35expandedspells/nw_s0_bladebara.ncs new file mode 100644 index 00000000..f1bfdf07 Binary files /dev/null and b/35expandedspells/nw_s0_bladebara.ncs differ diff --git a/35expandedspells/nw_s0_bladebara.nss b/35expandedspells/nw_s0_bladebara.nss new file mode 100644 index 00000000..0e9e10f0 --- /dev/null +++ b/35expandedspells/nw_s0_bladebara.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: On Enter +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oTarget = GetEnteringObject(); + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + object aoeCreator = GetAreaOfEffectCreator(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nLevel = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level"); + int CasterLvl = nLevel; + + int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl); + + //Make level check + if (nLevel > 40) + { + nLevel = 40; + } + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator)) + { + //Fire spell cast at event + SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_BLADE_BARRIER)); + //Roll Damage + int nDamage = d6(nLevel); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nLevel * 6;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Make SR Check + if (!PRCDoResistSpell(aoeCreator, oTarget,nPenetr) ) + { + // 1.69 change + //Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget,aoeCreator),SAVING_THROW_TYPE_SPELL); + + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SLASHING); + //Apply damage and VFX + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + diff --git a/35expandedspells/nw_s0_bladebarc.ncs b/35expandedspells/nw_s0_bladebarc.ncs new file mode 100644 index 00000000..df75279d Binary files /dev/null and b/35expandedspells/nw_s0_bladebarc.ncs differ diff --git a/35expandedspells/nw_s0_bladebarc.nss b/35expandedspells/nw_s0_bladebarc.nss new file mode 100644 index 00000000..da49e69f --- /dev/null +++ b/35expandedspells/nw_s0_bladebarc.nss @@ -0,0 +1,102 @@ +//:://///////////////////////////////////////////// +//:: Blade Barrier: Heartbeat +//:: NW_S0_BladeBarA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a wall 10m long and 2m thick of whirling + blades that hack and slice anything moving into + them. Anything caught in the blades takes + 2d6 per caster level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 20, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oTarget; + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); + object aoeCreator = GetAreaOfEffectCreator(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level"); + int nLevel = CasterLvl; + //Make level check + if (nLevel > 40) + { + nLevel = 40; + } + + int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl); + + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // Add damage to placeables/doors now that the command support bit fields + //-------------------------------------------------------------------------- + oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR); + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // When the caster is no longer there, all functions calling + // GetAreaOfEffectCreator will fail. Its better to remove the barrier then + //-------------------------------------------------------------------------- + if (!GetIsObjectValid(aoeCreator)) + { + DestroyObject(OBJECT_SELF); + return; + } + + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator)) + { + //Fire spell cast at event + SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_BLADE_BARRIER)); + //Make SR Check + if (!PRCDoResistSpell(aoeCreator, oTarget,CasterLvl) ) + { + int nDC = PRCGetSaveDC(oTarget,aoeCreator); + //Roll Damage + int nDamage = d6(nLevel); + //Enter Metamagic conditions + if((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nLevel * 6;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + // 1.69 change + //Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget,aoeCreator),SAVING_THROW_TYPE_SPELL); + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SLASHING); + //Apply damage and VFX + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name + +} + diff --git a/35expandedspells/nw_s0_burnhand.ncs b/35expandedspells/nw_s0_burnhand.ncs new file mode 100644 index 00000000..7f1de769 Binary files /dev/null and b/35expandedspells/nw_s0_burnhand.ncs differ diff --git a/35expandedspells/nw_s0_burnhand.nss b/35expandedspells/nw_s0_burnhand.nss new file mode 100644 index 00000000..95ec18c5 --- /dev/null +++ b/35expandedspells/nw_s0_burnhand.nss @@ -0,0 +1,98 @@ +//:://///////////////////////////////////////////// +//:: Burning Hands +//:: NW_S0_BurnHand +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +Evocation [Fire] +Level: Fire 1, Sor/Wiz 1 +Components: V, S +Casting Time: 1 standard action +Range: 15 ft. +Area: Cone-shaped burst +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +A cone of searing flame shoots from your fingertips. +Any creature in the area of the flames takes 1d4 +points of fire damage per caster level (maximum 5d4). +Flammable materials burn if the flames touch them. +A character can extinguish burning items as a +full-round action. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 5, 2001 +//::////////////////////////////////////////////// +//:: Last Updated On: April 5th, 2001 +//:: VFX Pass By: Preston W, On: June 20, 2001 +//:: Update Pass By: Preston W, On: July 23, 2001 +//:: modified by mr_bumpkin Dec 4, 2003 + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE); + int nSaveType = ChangedSaveType(EleDmg); + int nDice = min(20, nCasterLevel); + int nDamage; + float fDist; + + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 10.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Signal spell cast at event to fire. + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_BURNING_HANDS)); + //Calculate the delay time on the application of effects based on the distance + //between the caster and the target + fDist = GetDistanceBetween(oCaster, oTarget)/20; + //Make SR check, and appropriate saving throw. + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDist) && oTarget != oCaster) + { + nDamage = d4(nDice); + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 4 * nDice;//Damage is at max + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage / 2; //Damage/Healing is +50% + + //Run the damage through the various reflex save and evasion feats + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, oCaster), nSaveType); + if(nDamage > 0) + { + effect eFire = PRCEffectDamage(oTarget, nDamage, EleDmg); + + // Apply effects to the currently selected target. + DelayCommand(fDist, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDist, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 10.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_calllghtn.ncs b/35expandedspells/nw_s0_calllghtn.ncs new file mode 100644 index 00000000..9da5075d Binary files /dev/null and b/35expandedspells/nw_s0_calllghtn.ncs differ diff --git a/35expandedspells/nw_s0_calllghtn.nss b/35expandedspells/nw_s0_calllghtn.nss new file mode 100644 index 00000000..513e2770 --- /dev/null +++ b/35expandedspells/nw_s0_calllghtn.nss @@ -0,0 +1,112 @@ +//:://///////////////////////////////////////////// +//:: Call Lightning +//:: NW_S0_CallLghtn.nss +//:: Copyright (c) 2001 Bioware Corp. +//:://///////////////////////////////////////////// +/* +Evocation [Electricity] +Level: Drd 3 +Components: V, S +Casting Time: 1 round +Range: Medium (100 ft. + 10 ft./level) +Effect: One or more 30-ft.-long vertical lines of lightning +Duration: 1 min./level +Saving Throw: Reflex half +Spell Resistance: Yes + +Immediately upon completion of the spell, and once +per round thereafter, you may call down a 5-foot-wide, +30-foot-long, vertical bolt of lightning that deals +3d6 points of electricity damage. The bolt of lightning +flashes down in a vertical stroke at whatever target +point you choose within the spell’s range (measured +from your position at the time). Any creature in the +target square or in the path of the bolt is affected. + +You need not call a bolt of lightning immediately; +other actions, even spellcasting, can be performed. +However, each round after the first you may use a +standard action (concentrating on the spell) to call +a bolt. You may call a total number of bolts equal to +your caster level (maximum 10 bolts). + +If you are outdoors and in a stormy area—a rain shower, +clouds and wind, hot and cloudy conditions, or even a +tornado (including a whirlwind formed by a djinni or an +air elemental of at least Large size)—each bolt deals +3d10 points of electricity damage instead of 3d6. + +This spell functions indoors or underground but not +underwater. + +*/ +//::////////////////////////////////////////////// +//:: Notes: totally not like PnP version, +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 20, 2001 +//:: modified by mr_bumpkin Dec 4, 2003 + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDice = min(20, nCasterLvl); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ELECTRICAL); + int nSaveType = ChangedSaveType(EleDmg); + + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_M); + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CALL_LIGHTNING)); + //Get the distance between the explosion and the target to calculate delay + float fDelay = PRCGetRandomDelay(0.4, 1.75); + if (!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay)) + { + //Roll damage for each target + int nDamage = d6(nDice); + //Resolve metamagic + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage / 2; + + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, oCaster), nSaveType); + if(nDamage > 0) + { + //Set the damage effect + effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_chlightn.ncs b/35expandedspells/nw_s0_chlightn.ncs new file mode 100644 index 00000000..8f2ee8c4 Binary files /dev/null and b/35expandedspells/nw_s0_chlightn.ncs differ diff --git a/35expandedspells/nw_s0_chlightn.nss b/35expandedspells/nw_s0_chlightn.nss new file mode 100644 index 00000000..b98fa9d4 --- /dev/null +++ b/35expandedspells/nw_s0_chlightn.nss @@ -0,0 +1,204 @@ +//:://///////////////////////////////////////////// +//:: Chain Lightning +//:: NW_S0_ChLightn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The primary target is struck with 1d6 per caster, + 1/2 with a reflex save. 1 secondary target per + level is struck for 1d6 / 2 caster levels. No + repeat targets can be chosen. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brennon Holmes +//:: Created On: March 8, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: April 26, 2001 +//:: Update Pass By: Preston W, On: July 26, 2001 + +/* +bugfix by Kovi 2002.07.28 +- successful saving throw and (improved) evasion was ignored for + secondary targets, +- all secondary targets suffered exactly the same damage +2002.08.25 +- primary target was not effected +*/ + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nCasterLevel = CasterLvl; + //Limit caster level + // June 2/04 - Bugfix: Cap the level BEFORE the damage calculation, not after. Doh. + if (nCasterLevel > 40) //alterado cap de 20 para 40 rafael + { + nCasterLevel = 40; + } + + int nDamage = d6(nCasterLevel); + int nDamStrike; + int nNumAffected = 0; + int nMetaMagic = PRCGetMetaMagicFeat(); + //Declare lightning effect connected the casters hands + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF, BODY_NODE_HAND);; + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + effect eDamage; + object oFirstTarget = PRCGetSpellTargetObject(); + object oHolder; + object oTarget; + location lSpellLocation; + + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * nCasterLevel;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + + CasterLvl +=SPGetPenetr(); + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ELECTRICAL); + + //Damage the initial target + if (spellsIsTarget(oFirstTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oFirstTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING)); + //Make an SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oFirstTarget,CasterLvl)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Adjust damage via Reflex Save or Evasion or Improved Evasion + nDamStrike = PRCGetReflexAdjustedDamage(nDamage, oFirstTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY); + //Set the damage effect for the first target + eDamage = PRCEffectDamage(oTarget, nDamStrike, EleDmg); + //Apply damage to the first target and the VFX impact. + if(nDamStrike > 0) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oFirstTarget); + PRCBonusDamage(oFirstTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oFirstTarget); + } + } + } + //Apply the lightning stream effect to the first target, connecting it with the caster + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oFirstTarget,0.5,FALSE); + + + //Reinitialize the lightning effect so that it travels from the first target to the next target + eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oFirstTarget, BODY_NODE_CHEST); + + + float fDelay = 0.2; + int nCnt = 0; + + + // * + // * Secondary Targets + // * + + + //Get the first target in the spell shape + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while (GetIsObjectValid(oTarget) && nCnt < nCasterLevel) + { + //Make sure the caster's faction is not hit and the first target is not hit + if (oTarget != oFirstTarget && spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) + { + //Connect the new lightning stream to the older target and the new target + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,0.5,FALSE)); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHAIN_LIGHTNING)); + //Do an SR check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + nDamage = d6(nCasterLevel) ; + + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * nCasterLevel;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/is +50% + } + //Adjust damage via Reflex Save or Evasion or Improved Evasion + nDamStrike = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY); + //Apply the damage and VFX impact to the current target + eDamage = PRCEffectDamage(oTarget, nDamStrike /2, EleDmg); + if(nDamStrike > 0) //age > 0) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget)); + } + } + oHolder = oTarget; + + //change the currect holder of the lightning stream to the current target + if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) + { + eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST); + } + else + { + // * April 2003 trying to make sure beams originate correctly + effect eNewLightning = EffectBeam(VFX_BEAM_LIGHTNING, oHolder, BODY_NODE_CHEST); + if(GetIsEffectValid(eNewLightning)) + { + eLightning = eNewLightning; + } + } + + fDelay = fDelay + 0.1f; + } + //Count the number of targets that have been hit. + if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) + { + nCnt++; + } + + // April 2003: Setting the new origin for the beam + // oFirstTarget = oTarget; + + //Get the next target in the shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(oFirstTarget), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + + } diff --git a/35expandedspells/nw_s0_circdeath.ncs b/35expandedspells/nw_s0_circdeath.ncs new file mode 100644 index 00000000..653a2124 Binary files /dev/null and b/35expandedspells/nw_s0_circdeath.ncs differ diff --git a/35expandedspells/nw_s0_circdeath.nss b/35expandedspells/nw_s0_circdeath.nss new file mode 100644 index 00000000..b933b3b8 --- /dev/null +++ b/35expandedspells/nw_s0_circdeath.nss @@ -0,0 +1,152 @@ +//:://///////////////////////////////////////////// +//:: Circle of Death +//:: NW_S0_CircDeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The caster slays a number of HD worth of creatures + equal to 1d4 times level. The creature gets a + Fort Save or dies. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: June 1, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Aidan Scanlan +//:: VFX Pass By: Preston W, On: June 20, 2001 +//:: Update Pass By: Preston W, On: July 25, 2001 + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget; + object oLowest; + effect eDeath = EffectDeath(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eFNF = EffectVisualEffect(VFX_FNF_LOS_EVIL_20); + int bContinueLoop = FALSE; //Used to determine if we have a next valid target + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nHD = d4(CasterLvl); //Roll to see how many HD worth of creature will be killed + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCurrentHD; + int bAlreadyAffected; + int nMax = 40;// maximun hd creature affected, set this to 9 so that a lower HD creature is chosen automatically + //Also 9 is the maximum HD a creature can have and still be affected by the spell + float fDelay; + string sIdentifier = GetTag(OBJECT_SELF); + + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nHD = 4 * CasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nHD = nHD + (nHD/2); //Damage/Healing is +50% + } + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, PRCGetSpellTargetLocation()); + //Check for at least one valid object to start the main loop + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + if (GetIsObjectValid(oTarget)) + { + bContinueLoop = TRUE; + } + // The above checks to see if there is at least one valid target. If no value target exists we do not enter + // the loop. + + + CasterLvl +=SPGetPenetr(); + + + while ((nHD > 0) && (bContinueLoop)) + { + int nLow = nMax; //Set nLow to the lowest HD creature in the last pass through the loop + bContinueLoop = FALSE; //Set this to false so that the loop only continues in the case of new low HD creature + //Get first target creature in loop + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + //Make sure the currect target is not an enemy + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) + { + //Get a local set on the creature that checks if the spell has already allowed them to save + bAlreadyAffected = GetLocalInt(oTarget, "bDEATH" + sIdentifier); + if (!bAlreadyAffected) + { + nCurrentHD = GetHitDice(oTarget); + //If the selected creature is of lower HD then the current nLow value and + //the HD of the creature is of less HD than the number of HD available for + //the spell to affect then set the creature as the currect primary target + if(nCurrentHD < nLow && nCurrentHD <= nHD) + { + nLow = nCurrentHD; + oLowest = oTarget; + bContinueLoop = TRUE; + } + } + } + //Get next target in shape to test for a new + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + } + //Check to make sure that oLowest has changed + if(bContinueLoop == TRUE) + { + //Fire cast spell at event for the specified target + SignalEvent(oLowest, EventSpellCastAt(OBJECT_SELF, SPELL_CIRCLE_OF_DEATH)); + fDelay = PRCGetRandomDelay(); + if(!PRCDoResistSpell(OBJECT_SELF, oLowest,CasterLvl, fDelay)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Make a Fort Save versus death effects + if(!PRCMySavingThrow(SAVING_THROW_FORT, oLowest, nDC, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay)) + { + DeathlessFrenzyCheck(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oLowest); + //DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oLowest)); + } + } + //Even if the target made their save mark them as having been affected by the spell + SetLocalInt(oLowest, "bDEATH" + sIdentifier, TRUE); + //Destroy the local after 1/4 of a second in case other Circles of Death are cast on + //the creature laster + DelayCommand(fDelay + 0.25, DeleteLocalInt(oLowest, "bDEATH" + sIdentifier)); + //Adjust the number of HD that have been affected by the spell + nHD = nHD - GetHitDice(oLowest); + oLowest = OBJECT_INVALID; + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_cloudkilla.ncs b/35expandedspells/nw_s0_cloudkilla.ncs new file mode 100644 index 00000000..23c7435e Binary files /dev/null and b/35expandedspells/nw_s0_cloudkilla.ncs differ diff --git a/35expandedspells/nw_s0_cloudkilla.nss b/35expandedspells/nw_s0_cloudkilla.nss new file mode 100644 index 00000000..fe0ca39f --- /dev/null +++ b/35expandedspells/nw_s0_cloudkilla.nss @@ -0,0 +1,115 @@ +//:://///////////////////////////////////////////// +//:: Cloudkill: On Enter +//:: NW_S0_CloudKillA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures with 3 or less HD die, those with + 4 to 6 HD must make a save Fortitude Save or die. + Those with more than 6 HD take 1d10 Poison damage + every round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +//:: modified by Ornedan Dec 22, 2004 to PnP rules +#include "prc_inc_spells" + +#include "prc_add_spell_dc" + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); + + + //Declare major variables + object oTarget = GetEnteringObject(); + int nHD = GetHitDice(oTarget); + effect eDeath = EffectDeath(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eNeg = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eConceal = EffectConcealment(20); + effect eVis2 = EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT); + effect eLink = EffectLinkEffects(eConceal, eVis2); + + //effect eDam; + int nDam = d4(); + int nMetaMagic = PRCGetMetaMagicFeat(); + + object aoeCreator = GetAreaOfEffectCreator(); + int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level"); + + //int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl); + + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 4;//Damage is at max + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam = nDam + (nDam/2); //Damage/Healing is +50% + } + + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL)); + + //Concealement by fog happens no matter what + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, oTarget, 0.0f, FALSE); + + //Determine spell effect based on the targets HD + if (nHD <= 20) + { + if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH)) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + } + } + else if (nHD >= 21 && nHD <= 40) + { + //Make a save or die + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, aoeCreator), SAVING_THROW_TYPE_DEATH, OBJECT_SELF)) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + else + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + return; + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget); + } + } + else + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, aoeCreator), SAVING_THROW_TYPE_SPELL, OBJECT_SELF)) + { + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget); + } + else + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + return; + // Halve the damage on succesfull save. + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDam / 2, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNeg, oTarget); + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_cloudkillc.ncs b/35expandedspells/nw_s0_cloudkillc.ncs new file mode 100644 index 00000000..c1348058 Binary files /dev/null and b/35expandedspells/nw_s0_cloudkillc.ncs differ diff --git a/35expandedspells/nw_s0_cloudkillc.nss b/35expandedspells/nw_s0_cloudkillc.nss new file mode 100644 index 00000000..9ca56a68 --- /dev/null +++ b/35expandedspells/nw_s0_cloudkillc.nss @@ -0,0 +1,109 @@ +//:://///////////////////////////////////////////// +//:: Cloudkill: Heartbeat +//:: NW_S0_CloudKillC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures with 3 or less HD die, those with + 4 to 6 HD must make a save Fortitude Save or die. + Those with more than 6 HD take 1d10 Poison damage + every round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +//:: modified by Ornedan Dec 22, 2004 to PnP rules +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); + + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage = d4(); + //effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + object oTarget; + int nHD; + float fDelay; + + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDamage = 4;//Damage is at max + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // When the caster is no longer there, all functions calling + // GetAreaOfEffectCreator will fail. Its better to remove the barrier then + //-------------------------------------------------------------------------- + if (!GetIsObjectValid(GetAreaOfEffectCreator())) + { + DestroyObject(OBJECT_SELF); + return; + } + + object aoeCreator = GetAreaOfEffectCreator(); + int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level"); + int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl); + + + //Set damage effect + //Get the first object in the persistant AOE + oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + fDelay = PRCGetRandomDelay(); + if(spellsIsTarget(oTarget,SPELL_TARGET_STANDARDHOSTILE , aoeCreator) ) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CLOUDKILL)); + + nHD = GetHitDice(oTarget); + + //Apply VFX impact and damage + //Creatures with less than 6 HD take full damage automatically + //Any with more than 6 get to save (Fortitued) for half + if (nHD < 40) + { + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + } + else + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,aoeCreator)), SAVING_THROW_TYPE_SPELL, OBJECT_SELF)) + { + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + } + else + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + nDamage = 0; + // Halve the damage on succesfull save. + AssignCommand(aoeCreator, ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nDamage / 2, DURATION_TYPE_TEMPORARY, TRUE, -1.0f)); + } + } + } + //Get the next target in the AOE + oTarget = GetNextInPersistentObject(); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_colspray.ncs b/35expandedspells/nw_s0_colspray.ncs new file mode 100644 index 00000000..a51fa626 Binary files /dev/null and b/35expandedspells/nw_s0_colspray.ncs differ diff --git a/35expandedspells/nw_s0_colspray.nss b/35expandedspells/nw_s0_colspray.nss new file mode 100644 index 00000000..74f19ec0 --- /dev/null +++ b/35expandedspells/nw_s0_colspray.nss @@ -0,0 +1,137 @@ +//:://///////////////////////////////////////////// +//:: Color Spray +//:: NW_S0_ColSpray.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A cone of sparkling lights flashes out in a cone + from the casters hands affecting all those within + the Area of Effect. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 25, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION); + +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 nMetaMagic = PRCGetMetaMagicFeat(); + int nHD; + int nDuration; + float fDelay; + object oTarget; + effect eSleep = EffectSleep(); + effect eStun = EffectStunned(); + effect eBlind = EffectBlindness(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + effect eLink1 = EffectLinkEffects(eSleep, eMind); + + effect eLink2 = EffectLinkEffects(eStun, eMind); + eLink2 = EffectLinkEffects(eLink2, eDur); + + effect eLink3 = EffectLinkEffects(eBlind, eMind); + + effect eVis1 = EffectVisualEffect(VFX_IMP_SLEEP); + effect eVis2 = EffectVisualEffect(VFX_IMP_STUN); + effect eVis3 = EffectVisualEffect(VFX_IMP_BLIND_DEAF_M); + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nPenetr = CasterLvl + SPGetPenetr(); + + + //Get first object in the spell cone + oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation(), TRUE); + //Cycle through the target until the current object is invalid + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) + && !PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, oTarget) + && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_COLOR_SPRAY)); + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/30; + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr, fDelay)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay)) + { + nDuration = 3 + d4(); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDuration = 7;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDuration = nDuration + (nDuration/2); //Damage/Healing is +50% + } + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + + nHD = GetHitDice(oTarget); + if(nHD <= 20) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); + } + else if(nHD > 20 && nHD < 30) + { + nDuration = nDuration - 1; + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis3, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink3, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); } + else + { + nDuration = nDuration - 2; + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); + } + } + } + } + //Get next target in spell area + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 10.0, PRCGetSpellTargetLocation(), TRUE); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + diff --git a/35expandedspells/nw_s0_conecold.ncs b/35expandedspells/nw_s0_conecold.ncs new file mode 100644 index 00000000..bfdb4d79 Binary files /dev/null and b/35expandedspells/nw_s0_conecold.ncs differ diff --git a/35expandedspells/nw_s0_conecold.nss b/35expandedspells/nw_s0_conecold.nss new file mode 100644 index 00000000..4cb3fa39 --- /dev/null +++ b/35expandedspells/nw_s0_conecold.nss @@ -0,0 +1,125 @@ +//:://///////////////////////////////////////////// +//:: Cone of Cold +//:: NW_S0_ConeCold +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// Cone of cold creates an area of extreme cold, +// originating at your hand and extending outward +// in a cone. It drains heat, causing 1d6 points of +// cold damage per caster level (maximum 15d6). +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel Borstad +//:: Created On: 10/18/02000 +//::////////////////////////////////////////////// +//:: Last Updated By: Aidan Scanlan On: April 11, 2001 +//:: Update Pass By: Preston W, On: July 25, 2001 + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +float SpellDelay (object oTarget, int nShape); + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nCasterLevel = CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + //Limit Caster level for the purposes of damage. + if (nCasterLevel > 40) + { + nCasterLevel = 40; + } + + CasterLvl +=SPGetPenetr(); + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_COLD); + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // March 2003. Removed this as part of the reputation pass + // if((PRCGetSpellId() == 340 && !GetIsFriend(oTarget)) || PRCGetSpellId() == 25) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CONE_OF_COLD)); + //Get the distance between the target and caster to delay the application of effects + fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20.0; + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay) && (oTarget != OBJECT_SELF)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Detemine damage + nDamage = d6(nCasterLevel); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * nCasterLevel;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, SAVING_THROW_TYPE_COLD); + + // Apply effects to the currently selected target. + effect eCold = PRCEffectDamage(oTarget, nDamage, EleDmg); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_L); + if(nDamage > 0) + { + //Apply delayed effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCold, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + diff --git a/35expandedspells/nw_s0_daze.ncs b/35expandedspells/nw_s0_daze.ncs new file mode 100644 index 00000000..a0764517 Binary files /dev/null and b/35expandedspells/nw_s0_daze.ncs differ diff --git a/35expandedspells/nw_s0_daze.nss b/35expandedspells/nw_s0_daze.nss new file mode 100644 index 00000000..ecbd25ff --- /dev/null +++ b/35expandedspells/nw_s0_daze.nss @@ -0,0 +1,140 @@ +/*:://///////////////////////////////////////////// +//:: [Daze] +//:: [NW_S0_Daze.nss] +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 15, 2001 +//:: Update Pass By: Preston W, On: July 27, 2001 +//:: modified by mr_bumpkin Dec 4, 2003 +//:: modified by xwarren Jul 22, 2010 +//::////////////////////////////////////////////// +//:: +//:: Daze +//:: +//:: Enchantment (Compulsion) [Mind-Affecting] +//:: Level: Brd 0, Sor/Wiz 0 +//:: Components: V, S, M +//:: Casting Time: 1 standard action +//:: Range: Close (25 ft. + 5 ft./2 levels) +//:: Target: One humanoid creature of 4 HD or less +//:: Duration: 1 round +//:: Saving Throw: Will negates +//:: Spell Resistance: Yes +//:: +//:: This enchantment clouds the mind of a humanoid +//:: creature with 4 or fewer Hit Dice so that it +//:: takes no actions. Humanoids of 5 or more HD are +//:: not affected. A dazed subject is not stunned, +//:: so attackers get no special advantage against it. +//:: +//:: Material Component +//:: A pinch of wool or similar substance. +//:: +//::////////////////////////////////////////////// +//:: +//:: Daze Monster +//:: +//:: Enchantment (Compulsion) [Mind-Affecting] +//:: Level: Beguiler 2, Brd 2, Sor/Wiz 2 +//:: Components: V, S, M +//:: Casting Time: 1 standard action +//:: Range: Medium (100 ft. + 10 ft./level) +//:: Target: One living creature of 6 HD or less +//:: Duration: 1 round +//:: Saving Throw: Will negates +//:: Spell Resistance: Yes +//:: +//:: This enchantment clouds the mind of +//:: a living creature with 6 or fewer Hit +//:: Dice so that it takes no actions. Creatures +//:: of 7 or more HD are not affected. A dazed +//:: subject is not stunned, so attackers get no +//:: special advantage against it. +//:: +//:: Material Component +//:: A pinch of wool or similar substance. +//:: +//::////////////////////////////////////////////*/ + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +#include "prc_sp_func" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + //Declare major variables + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDaze = EffectDazed(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + effect eLink = EffectLinkEffects(eMind, eDaze); + eLink = EffectLinkEffects(eLink, eDur); + + effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDuration = 2; + //check meta magic for extend + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = 4; + } + int nSpellID = GetSpellId(); + int nMaxHD = nSpellID == SPELL_DAZE ? 4+(nCasterLevel/2) : 6+(nCasterLevel/2); + int nPenetr = nCasterLevel + SPGetPenetr(); + + //Make sure the target of Daze spell is a humaniod + if(nSpellID == SPELL_DAZE && PRCAmIAHumanoid(oTarget) != TRUE) + return TRUE; + //Make sure the target of Daze Monster spell is a living creature + if(nSpellID == SPELL_DAZE_MONSTER && PRCGetIsAliveCreature(oTarget) != TRUE) + return TRUE; + if(GetHitDice(oTarget) <= nMaxHD) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID)); + //Make SR check + if (!PRCDoResistSpell(oCaster, oTarget,nPenetr)) + { + //Make Will Save to negate effect + if (!/*Will Save*/ PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_MIND_SPELLS)) + { + //Apply VFX Impact and daze effect + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,nCasterLevel); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + } + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); + if (!X2PreSpellCastCode()) return; + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_delfirea.ncs b/35expandedspells/nw_s0_delfirea.ncs new file mode 100644 index 00000000..7ad41f11 Binary files /dev/null and b/35expandedspells/nw_s0_delfirea.ncs differ diff --git a/35expandedspells/nw_s0_delfirea.nss b/35expandedspells/nw_s0_delfirea.nss new file mode 100644 index 00000000..a9b2d3b6 --- /dev/null +++ b/35expandedspells/nw_s0_delfirea.nss @@ -0,0 +1,97 @@ +//:://///////////////////////////////////////////// +//:: Delayed Blast Fireball: On Enter +//:: NW_S0_DelFireA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The caster creates a trapped area which detects + the entrance of enemy creatures into 3 m area + around the spell location. When tripped it + causes a fiery explosion that does 1d6 per + caster level up to a max of 20d6 damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: July 27, 2001 +//::////////////////////////////////////////////// +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + location lTarget = GetLocation(OBJECT_SELF); + int nDamage; + int nMetaMagic = PRCGetMetaMagicFeat(); + int CasterLvl = GetLocalInt(OBJECT_SELF, "X2_AoE_Caster_Level"); + + int nCasterLevel = CasterLvl; + //Limit caster level + if (nCasterLevel > 60) + nCasterLevel = 60; + + CasterLvl += SPGetPenetr(); + + int EleDmg = GetLocalInt(OBJECT_SELF, "DelayedBlastFireballDamage"); + int nSaveType = ChangedSaveType(EleDmg); + + effect eDam; + effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + //Check the faction of the entering object to make sure the entering object is not in the casters faction + if(!GetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL") && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + SetLocalInt(OBJECT_SELF, "NW_SPELL_DELAY_BLAST_FIREBALL",TRUE); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Cycle through the targets in the explosion area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DELAYED_BLAST_FIREBALL)); + //Make SR check + if (!PRCDoResistSpell(oCaster, oTarget,CasterLvl)) + { + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nCasterLevel;//Damage is at max + else + nDamage = d6(nCasterLevel); + + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage/2;//Damage/Healing is +50% + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Change damage according to Reflex, Evasion and Improved Evasion + int nDC = PRCGetSaveDC(oTarget, oCaster, -1); + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType, GetAreaOfEffectCreator()); + if(nDamage > 0) + { + //Set up the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + + //Apply VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Get next target in the sequence + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + DestroyObject(OBJECT_SELF, 1.0); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_destruc.ncs b/35expandedspells/nw_s0_destruc.ncs new file mode 100644 index 00000000..241ade03 Binary files /dev/null and b/35expandedspells/nw_s0_destruc.ncs differ diff --git a/35expandedspells/nw_s0_destruc.nss b/35expandedspells/nw_s0_destruc.nss new file mode 100644 index 00000000..4afafc8a --- /dev/null +++ b/35expandedspells/nw_s0_destruc.nss @@ -0,0 +1,101 @@ +//:://///////////////////////////////////////////// +//:: Destruction +//:: NW_S0_Destruc +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The target creature is destroyed if it fails a + Fort save, otherwise it takes 10d6 damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 13, 2001 +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY); + +/* + 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 + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDeath = EffectDeath(); + effect eDam; + effect eVis = EffectVisualEffect(234); + + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + CasterLvl +=SPGetPenetr(); + + if(!GetIsReactionTypeFriendly(oTarget) && PRCGetIsAliveCreature(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DESTRUCTION)); + //Make SR check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl)) + { + //Make a saving throw check + if(!/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF))) + { + DeathlessFrenzyCheck(oTarget); + + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + } + else if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + // This script does nothing if it has Mettle, bail + return; + } + else + { + nDamage = d6(60); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 360;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + //Apply VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_dismagic.ncs b/35expandedspells/nw_s0_dismagic.ncs new file mode 100644 index 00000000..2621928a Binary files /dev/null and b/35expandedspells/nw_s0_dismagic.ncs differ diff --git a/35expandedspells/nw_s0_dismagic.nss b/35expandedspells/nw_s0_dismagic.nss new file mode 100644 index 00000000..9325b041 --- /dev/null +++ b/35expandedspells/nw_s0_dismagic.nss @@ -0,0 +1,111 @@ +//:://///////////////////////////////////////////// +//:: Dispel Magic +//:: NW_S0_DisMagic.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +//:: Attempts to dispel all magic on a targeted +//:: object, or simply the most powerful that it +//:: can on every object in an area if no target +//:: specified. +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//:: Updated On: Oct 20, 2003, Georg Zoeller +//::////////////////////////////////////////////// + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "inc_dispel" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION); + + //-------------------------------------------------------------------------- + /* + Spellcast Hook Code + Added 2003-06-20 by Georg + If you want to make changes to all spells, + check x2_inc_spellhook.nss to find out more + */ + //-------------------------------------------------------------------------- + if (!X2PreSpellCastCode()) + { + return; + } + // End of Spell Cast Hook + + effect eVis = EffectVisualEffect(VFX_IMP_BREACH); + effect eImpact = EffectVisualEffect(VFX_FNF_DISPEL); + object oTarget = PRCGetSpellTargetObject(); + location lLocal = PRCGetSpellTargetLocation(); + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int iTypeDispel = GetLocalInt(GetModule(),"BIODispel"); + + //-------------------------------------------------------------------------- + // Dispel Magic is capped at caster level 10 + //-------------------------------------------------------------------------- + if(nCasterLevel > 10) + { + nCasterLevel = 10; + } + + if (GetIsObjectValid(oTarget)) + { + //---------------------------------------------------------------------- + // Targeted Dispel - Dispel all + //---------------------------------------------------------------------- + if (iTypeDispel) + spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact); + else + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact); + + } + else + { + //---------------------------------------------------------------------- + // Area of Effect - Only dispel best effect + //---------------------------------------------------------------------- + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE ); + while (GetIsObjectValid(oTarget)) + { + if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT) + { + //-------------------------------------------------------------- + // Handle Area of Effects + //-------------------------------------------------------------- + if (iTypeDispel) + spellsDispelAoE(oTarget, OBJECT_SELF,nCasterLevel); + else + spellsDispelAoEMod(oTarget, OBJECT_SELF,nCasterLevel); + + } + else if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + } + else + { + + if (iTypeDispel) + spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact, FALSE); + else + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact, FALSE); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE); + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + + + diff --git a/35expandedspells/nw_s0_enedrain.ncs b/35expandedspells/nw_s0_enedrain.ncs new file mode 100644 index 00000000..d61bb40f Binary files /dev/null and b/35expandedspells/nw_s0_enedrain.ncs differ diff --git a/35expandedspells/nw_s0_enedrain.nss b/35expandedspells/nw_s0_enedrain.nss new file mode 100644 index 00000000..3bc81689 --- /dev/null +++ b/35expandedspells/nw_s0_enedrain.nss @@ -0,0 +1,107 @@ +//:://///////////////////////////////////////////// +//:: Energy Drain +//:: NW_S0_EneDrain.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Target loses 2d4 levels. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff + +//::Added code to maximize for Faith Healing and Blast Infidel +//::Aaon Graywolf - Jan 7, 2003 + +//::Added hold ray functionality - HackyKid + +#include "prc_sp_func" +#include "prc_inc_function" +#include "prc_add_spell_dc" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDrain = d4(2); + + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + + //Undead Gain HP from Energy Drain + int nHP = d4(2) + (nPenetr/2); + nHP = nHP + nHP + nHP + nHP +nHP; + effect eHP = EffectTemporaryHitpoints(nHP); + + //Enter Metamagic conditions + int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, TRUE); + if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nDrain = 8;//Damage is at max + } + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDrain = nDrain + (nDrain/2); //Damage/Healing is +50% + } + effect eDrain = EffectNegativeLevel(nDrain); + eDrain = SupernaturalEffect(eDrain); + + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, HoursToSeconds(1),TRUE,-1,nCasterLevel); + } + else if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERGY_DRAIN)); + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr)) + { + + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget,OBJECT_SELF), SAVING_THROW_TYPE_NEGATIVE)) + { + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget,0.0f,TRUE,-1,nCasterLevel); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_enervat.ncs b/35expandedspells/nw_s0_enervat.ncs new file mode 100644 index 00000000..040d2d6e Binary files /dev/null and b/35expandedspells/nw_s0_enervat.ncs differ diff --git a/35expandedspells/nw_s0_enervat.nss b/35expandedspells/nw_s0_enervat.nss new file mode 100644 index 00000000..e4955882 --- /dev/null +++ b/35expandedspells/nw_s0_enervat.nss @@ -0,0 +1,125 @@ +//:://///////////////////////////////////////////// +//:: Enervation +//:: NW_S0_Enervat.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Target Loses 1d4 levels for 1 hour per caster + level +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff + +//::Added code to maximize for Faith Healing and Blast Infidel +//::Aaon Graywolf - Jan 7, 2003 + + +#include "prc_inc_sp_tch" +#include "prc_inc_function" +#include "prc_sp_func" +#include "prc_add_spell_dc" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDrain = d4(); + int nDuration = nCasterLevel; + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + + //Undead Gain HP from Enervation + int nHP = ((nCasterLevel/2) * 5); + if (nHP > 125) + { + nHP = 125; + } + + effect eHP = EffectTemporaryHitpoints(nHP); + + //Enter Metamagic conditions + int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_NEGATIVE, TRUE); + if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nDrain = 4;//Damage is at max + } + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDrain = nDrain + (nDrain/2); //Damage/Healing is +50% + } + if (nMetaMagic & METAMAGIC_EXTEND) + { + nDuration = nDuration *2; //Duration is +100% + } + + effect eDrain = EffectNegativeLevel(nDrain); + effect eLink = EffectLinkEffects(eDrain, eDur); + + int iAttackRoll = PRCDoRangedTouchAttack(oTarget);; + if(iAttackRoll > 0) + { + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHP, oTarget, HoursToSeconds(1),TRUE,-1,nCasterLevel); + } + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ENERVATION)); + //Resist magic check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_NEGATIVE)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration),TRUE,-1,nCasterLevel); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + + ApplyTouchAttackDamage(OBJECT_SELF, oTarget, iAttackRoll, 0, DAMAGE_TYPE_NEGATIVE); + } + } + } + + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_fireball.ncs b/35expandedspells/nw_s0_fireball.ncs new file mode 100644 index 00000000..f480a733 Binary files /dev/null and b/35expandedspells/nw_s0_fireball.ncs differ diff --git a/35expandedspells/nw_s0_fireball.nss b/35expandedspells/nw_s0_fireball.nss new file mode 100644 index 00000000..81d21fd1 --- /dev/null +++ b/35expandedspells/nw_s0_fireball.nss @@ -0,0 +1,96 @@ +//:://///////////////////////////////////////////// +//:: Fireball +//:: NW_S0_Fireball +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// A fireball is a burst of flame that detonates with +// a low roar and inflicts 1d6 points of damage per +// caster level (maximum of 10d6) to all creatures +// within the area. Unattended objects also take +// damage. The explosion creates almost no pressure. +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel Borstad +//:: Created On: Oct 18 , 2000 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: April 6, 2001 +//:: Last Updated By: AidanScanlan, On: April 11, 2001 +//:: Last Updated By: Preston Watamaniuk, On: May 25, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + effect eDam; + //Limit Caster level for the purposes of damage + int nDice = min(20, nCasterLvl); //alterado rafael era 10 mudei para 20 d6 + + nCasterLvl += SPGetPenetr(); + + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FIREBALL)); + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl, fDelay)) + { + //Resolve metamagic + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + nDamage = 6 * nDice; + else + //Roll damage for each target + nDamage = d6(nDice); + if ((nMetaMagic & METAMAGIC_EMPOWER)) + nDamage += nDamage / 2; + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget, oCaster)), SAVING_THROW_TYPE_FIRE); + if(nDamage > 0) + { + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + PRCSetSchool(); +} + diff --git a/35expandedspells/nw_s0_firestrm.ncs b/35expandedspells/nw_s0_firestrm.ncs new file mode 100644 index 00000000..086d939b Binary files /dev/null and b/35expandedspells/nw_s0_firestrm.ncs differ diff --git a/35expandedspells/nw_s0_firestrm.nss b/35expandedspells/nw_s0_firestrm.nss new file mode 100644 index 00000000..89a42f30 --- /dev/null +++ b/35expandedspells/nw_s0_firestrm.nss @@ -0,0 +1,98 @@ +//:://///////////////////////////////////////////// +//:: Fire Storm +//:: NW_S0_FireStm +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates a zone of destruction around the caster + within which all living creatures are pummeled + with fire. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 11, 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 21, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = GetLocation(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + int nDamage2; + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE); + + + int nCasterLevel = CasterLvl; + if(nCasterLevel > 60) + { + nCasterLevel = 60; //bugfix, was == 20 + } + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + effect eFireStorm = EffectVisualEffect(VFX_FNF_FIRESTORM); + float fDelay; + CasterLvl +=SPGetPenetr(); + + //Apply Fire and Forget Visual in the area; + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFireStorm, lTarget); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + //This spell smites everyone who is more than 2 meters away from the caster. + //if (GetDistanceBetween(oTarget, OBJECT_SELF) > 2.0) + //{ + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) + { + fDelay = PRCGetRandomDelay(1.5, 2.5); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIRE_STORM)); + //Make SR check, and appropriate saving throw(s). + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + //Roll Damage + nDamage = d6(nCasterLevel); + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nCasterLevel;//Damage is at max + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage = nDamage + (nDamage/2);//Damage/Healing is +50% + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Save versus both holy and fire damage + //nDamage2 += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + nDamage2 = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), SAVING_THROW_TYPE_DIVINE); + nDamage = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), SAVING_THROW_TYPE_FIRE); + if(nDamage) + { + // Apply effects to the currently selected target. For this spell we have used + //both Divine and Fire damage. + effect eDivine = PRCEffectDamage(oTarget, nDamage2, DAMAGE_TYPE_DIVINE); + effect eFire = PRCEffectDamage(oTarget, nDamage, EleDmg); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDivine, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + //} + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_flmstrike.ncs b/35expandedspells/nw_s0_flmstrike.ncs new file mode 100644 index 00000000..805b22e3 Binary files /dev/null and b/35expandedspells/nw_s0_flmstrike.ncs differ diff --git a/35expandedspells/nw_s0_flmstrike.nss b/35expandedspells/nw_s0_flmstrike.nss new file mode 100644 index 00000000..02417b36 --- /dev/null +++ b/35expandedspells/nw_s0_flmstrike.nss @@ -0,0 +1,96 @@ +//:://///////////////////////////////////////////// +//:: Flame Strike +//:: NW_S0_FlmStrike +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// A flame strike is a vertical column of divine fire +// roaring downward. The spell deals 1d6 points of +// damage per level, to a maximum of 15d6. Half the +// damage is fire damage, but the rest of the damage +// results directly from divine power and is therefore +// not subject to protection from elements (fire), +// fire shield (chill shield), etc. +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel Borstad +//:: Created On: Oct 19, 2000 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 20, 2001 +//:: Update Pass By: Preston W, On: Aug 1, 2001 +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE); + int nSaveType = ChangedSaveType(EleDmg); + int nDice = min(40, nCasterLvl); + + int nDamage, nDamage2; + effect eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + effect eHoly, eFire; + + //Apply the location impact visual to the caster location instead of caster target creature. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, lTarget); + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FLAME_STRIKE)); + + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, 0.6)) + { + nDamage = d6(nDice); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage = nDamage + (nDamage/2); + + //Adjust the damage based on Reflex Save, Evasion and Improved Evasion + int nDC = PRCGetSaveDC(oTarget, oCaster); + nDamage2 = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, nDC, nSaveType); + + //Make a faction check so that only enemies receieve the full brunt of the damage. + if(!GetIsFriend(oTarget)) + { + nDamage = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, nDC, SAVING_THROW_TYPE_DIVINE); + if(nDamage) + { + eHoly = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHoly, oTarget)); + } + } + // Apply effects to the currently selected target. + if(nDamage2) + { + eFire = PRCEffectDamage(oTarget, nDamage2, EleDmg); + DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget)); + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR); + } + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_grdispel.ncs b/35expandedspells/nw_s0_grdispel.ncs new file mode 100644 index 00000000..47ccc54e Binary files /dev/null and b/35expandedspells/nw_s0_grdispel.ncs differ diff --git a/35expandedspells/nw_s0_grdispel.nss b/35expandedspells/nw_s0_grdispel.nss new file mode 100644 index 00000000..828e2c3f --- /dev/null +++ b/35expandedspells/nw_s0_grdispel.nss @@ -0,0 +1,95 @@ +//:://///////////////////////////////////////////// +//:: Greater Dispelling +//:: NW_S0_GrDispel.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//:: Updated On: Oct 20, 2003, Georg Zoeller +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "inc_dispel" + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION); + + //-------------------------------------------------------------------------- + /* + Spellcast Hook Code + Added 2003-06-20 by Georg + If you want to make changes to all spells, + check x2_inc_spellhook.nss to find out more + */ + //-------------------------------------------------------------------------- + if (!X2PreSpellCastCode()) + { + return; + } + // End of Spell Cast Hook + + effect eVis = EffectVisualEffect( VFX_IMP_BREACH ); + effect eImpact = EffectVisualEffect( VFX_FNF_DISPEL_GREATER ); + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + object oTarget = PRCGetSpellTargetObject(); + location lLocal = PRCGetSpellTargetLocation(); + int iTypeDispel = GetLocalInt(GetModule(),"BIODispel"); + + //-------------------------------------------------------------------------- + // Greater Dispel Magic is capped at caster level 20 + //-------------------------------------------------------------------------- + if(nCasterLevel >20 ) + { + nCasterLevel = 20; + } + + if (GetIsObjectValid(oTarget)) + { + //---------------------------------------------------------------------- + // Targeted Dispel - Dispel all + //---------------------------------------------------------------------- + if (iTypeDispel) + spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact); + else + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact); + } + else + { + //---------------------------------------------------------------------- + // Area of Effect - Only dispel best effect + //---------------------------------------------------------------------- + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE); + while (GetIsObjectValid(oTarget)) + { + if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT) + { + //-------------------------------------------------------------- + // Handle Area of Effects + //-------------------------------------------------------------- + if (iTypeDispel) + spellsDispelAoE(oTarget, OBJECT_SELF,nCasterLevel); + else + spellsDispelAoEMod(oTarget, OBJECT_SELF,nCasterLevel); + + } + else if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + } + else + { + if (iTypeDispel) + spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact, FALSE); + else + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact, FALSE); + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE); + } + } +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_hammgods.ncs b/35expandedspells/nw_s0_hammgods.ncs new file mode 100644 index 00000000..ceb73f1e Binary files /dev/null and b/35expandedspells/nw_s0_hammgods.ncs differ diff --git a/35expandedspells/nw_s0_hammgods.nss b/35expandedspells/nw_s0_hammgods.nss new file mode 100644 index 00000000..0c045da6 --- /dev/null +++ b/35expandedspells/nw_s0_hammgods.nss @@ -0,0 +1,130 @@ +//:://///////////////////////////////////////////// +//:: Hammer of the Gods +//:: [NW_S0_HammGods.nss] +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +//:: Does 1d8 damage to all enemies within the +//:: spells 20m radius and dazes them if a +//:: Will save is failed. +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 12, 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 21, 2001 +//:: Update Pass By: Preston W, On: Aug 1, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + + int nCasterLvl = CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eDam; + effect eDaze = EffectDazed(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + effect eLink = EffectLinkEffects(eMind, eDaze); + eLink = EffectLinkEffects(eLink, eDur); + + effect eVis = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY); + effect eStrike = EffectVisualEffect(VFX_FNF_STRIKE_HOLY); + float fDelay; + int nDamageDice = nCasterLvl/2; + if(nDamageDice == 0) + { + nDamageDice = 1; + } + //Limit caster level + if (nDamageDice > 40) + { + nDamageDice = 40; + } + int nDamage; + int nPenetr = CasterLvl +SPGetPenetr(); + + //Apply the holy strike VFX + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, PRCGetSpellTargetLocation()); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + //Make faction checks + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HAMMER_OF_THE_GODS)); + //Make SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + fDelay = PRCGetRandomDelay(0.6, 1.3); + //Roll damage + nDamage = d8(nDamageDice); + //Make metamagic checks + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 8 * nDamageDice; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = FloatToInt( IntToFloat(nDamage) * 1.5 ); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + + //Make a will save for half damage and negation of daze effect + if (PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (nDC), SAVING_THROW_TYPE_DIVINE, OBJECT_SELF, 0.5)) + { + nDamage = nDamage / 2; + } + else if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects + { + nDamage = 0; + } + else + { + //Apply daze effect + DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(d6()),TRUE,-1,CasterLvl)); + } + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE ); + //Apply the VFX impact and damage effect + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + //Get next target in shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_healcirc.ncs b/35expandedspells/nw_s0_healcirc.ncs new file mode 100644 index 00000000..c6da632e Binary files /dev/null and b/35expandedspells/nw_s0_healcirc.ncs differ diff --git a/35expandedspells/nw_s0_healcirc.nss b/35expandedspells/nw_s0_healcirc.nss new file mode 100644 index 00000000..2f3120ee --- /dev/null +++ b/35expandedspells/nw_s0_healcirc.nss @@ -0,0 +1,160 @@ +//:://///////////////////////////////////////////// +//:: Healing Circle +//:: NW_S0_HealCirc +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// Positive energy spreads out in all directions +// from the point of origin, curing 1d8 points of +// damage plus 1 point per caster level (maximum +20) +// to nearby living allies. +// +// Like cure spells, healing circle damages undead in +// its area rather than curing them. +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel Borstad +//:: Created On: Oct 18,2000 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 20, 2001 +//:: Update Pass By: Preston W, On: Aug 1, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff + +//::Added code to maximize for Faith Healing and Blast Infidel +//::Aaon Graywolf - Jan 7, 2004 + +#include "prc_inc_function" +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget; + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + + int nCasterLvl = CasterLvl; + int nDamagen, nModify, nHP; + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eKill; + effect eHeal; + effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_M); + effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_20); + float fDelay; + //Limit caster level + if (nCasterLvl > 40) + { + nCasterLvl = 40; + } + + CasterLvl +=SPGetPenetr(); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + //Get first target in shape + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + fDelay = PRCGetRandomDelay(); + //Check if racial type is undead + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD + || (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE)); + //Make SR check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + nModify = d8() + nCasterLvl; + //Make metamagic check + int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, FALSE); + if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nModify = 8 + nCasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nModify += (nModify/2); //Damage/Healing is +50% + } + if (GetLevelByClass(CLASS_TYPE_HEALER, OBJECT_SELF)) + nModify += GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF); + //Make Fort save + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (nDC), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay)) + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + nModify = 0;; + nModify /= 2; + } + //Set damage effect + eKill = PRCEffectDamage(oTarget, nModify, DAMAGE_TYPE_POSITIVE); + //Apply damage effect and VFX impact + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + else + { + // * May 2003: Heal Neutrals as well + if(!GetIsReactionTypeHostile(oTarget) || GetFactionEqual(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HEALING_CIRCLE, FALSE)); + nHP = d8() + nCasterLvl; + //Enter Metamagic conditions + int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, FALSE); + if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nHP = 8 + nCasterLvl;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nHP = nHP + (nHP/2); //Damage/Healing is +50% + } + //Set healing effect + if (GetLevelByClass(CLASS_TYPE_HEALER, OBJECT_SELF)) + nHP += GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF); + eHeal = PRCEffectHeal(nHP, oTarget); + //Apply heal effect and VFX impact + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + } + } + //Get next target in the shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_healharm.ncs b/35expandedspells/nw_s0_healharm.ncs new file mode 100644 index 00000000..5dd20da8 Binary files /dev/null and b/35expandedspells/nw_s0_healharm.ncs differ diff --git a/35expandedspells/nw_s0_healharm.nss b/35expandedspells/nw_s0_healharm.nss new file mode 100644 index 00000000..871e2e38 --- /dev/null +++ b/35expandedspells/nw_s0_healharm.nss @@ -0,0 +1,194 @@ +/* + nw_s0_healharm + + Heal/Harm in the one script + + By: Flaming_Sword + Created: Jun 14, 2006 + Modified: Nov 21, 2006 + + Consolidation of heal/harm scripts + Mass Heal vfx on target looks like heal + added greater harm, mass harm +*/ + +#include "prc_sp_func" +#include "prc_inc_sp_tch" +#include "prc_inc_function" +#include "prc_add_spell_dc" +#include "inc_dispel" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nSpellID) +{ + int bIsHeal = IsHeal(nSpellID); //whether it is a heal or harm spell + int bMass = IsMassHealHarm(nSpellID); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nHealVFX, nHurtVFX, nEnergyType, nDice, iBlastFaith, nHeal; + float fRadius; + string nSwitch; + int nCap = 150 + nCasterLevel; + if(bIsHeal) + { + nHealVFX = VFX_IMP_HEALING_X; + nHurtVFX = VFX_IMP_SUNSTRIKE; + nEnergyType = DAMAGE_TYPE_POSITIVE; + nSwitch = PRC_BIOWARE_HEAL; + fRadius = RADIUS_SIZE_COLOSSAL; + if(nSpellID == SPELL_MASS_HEAL) + { + nSwitch = PRC_BIOWARE_MASS_HEAL; + nCap = 250 + nCasterLevel; + } + } + else + { + nHealVFX = VFX_IMP_HEALING_G; + nHurtVFX = 246; + nEnergyType = DAMAGE_TYPE_NEGATIVE; + nSwitch = PRC_BIOWARE_HARM; + fRadius = RADIUS_SIZE_HUGE; + } + int iHeal; + int iAttackRoll = 1; + if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM)) + { + nDice = (nCasterLevel > 40) ? 40 : nCasterLevel; + nHeal = d12(nDice); + if((nMetaMagic & METAMAGIC_MAXIMIZE) || BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE)) + nHeal = 12 * nDice; //in case higher level spell slots are available + } + else + { + nHeal = 10 * nCasterLevel; + } + if(nHeal > nCap && !GetPRCSwitch(nSwitch)) + nHeal = nCap; + location lLoc; + if(bMass) + { + lLoc = (nSpellID == SPELL_MASS_HARM) ? GetLocation(oCaster) : PRCGetSpellTargetLocation(); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lLoc); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(bIsHeal ? VFX_FNF_LOS_HOLY_30 : VFX_FNF_LOS_EVIL_20), lLoc); + } + float fDelay = 0.0; + + while(GetIsObjectValid(oTarget)) + { + if(bMass) fDelay = PRCGetRandomDelay(); + int iTombTainted = GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD; + + iHeal = GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && + ((!bIsHeal && (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD || iTombTainted)) || + (bIsHeal && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && !iTombTainted)); + if (GetLocalInt(oTarget, "AcererakHealing")) iHeal = TRUE; + + if(iHeal && (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster) || (GetIsDead(oTarget) && (GetCurrentHitPoints(oTarget) > -10)))) + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, FALSE)); + + //Warforged are only healed for half, none if they have Improved Fortification + if(GetIsWarforged(oTarget)) nHeal /= 2; + if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION, oTarget)) nHeal = 0; + + + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHealVFX), oTarget)); + // Code for FB to remove damage that would be caused at end of Frenzy + SetLocalInt(oTarget, "PC_Damage", 0); + } + else if((GetObjectType(oTarget) != OBJECT_TYPE_CREATURE && !bIsHeal) || + (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && !iHeal)) + { + if(!GetIsReactionTypeFriendly(oTarget) && oTarget != oCaster) + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID)); + iAttackRoll = PRCDoMeleeTouchAttack(oTarget); + if(iAttackRoll) + { + if (!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr())) + { + int nModify = d4(); + iBlastFaith = BlastInfidelOrFaithHeal(oCaster, oTarget, nEnergyType, TRUE); + if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nModify = 1; + } + if((nSpellID == SPELL_MASS_HARM) || (nSpellID == SPELL_GREATER_HARM)) + { + nHeal = d12(nDice); + if((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + nHeal = 12 * nDice; + } + else + { + nHeal = 10 * nCasterLevel; + } + if(nHeal > nCap && !GetPRCSwitch(nSwitch)) + nHeal = nCap; + + if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF))) + { + nHeal /= 2; + if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects + nHeal = 0; + } + int nHP = GetCurrentHitPoints(oTarget); + if (nHeal > nHP - nModify) + nHeal = nHP - nModify; + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nHeal, nEnergyType), oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nHurtVFX), oTarget)); + } + } + } + } + if(!bMass) break; + oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lLoc); + } + //Spell Removal Check + SpellRemovalCheck(oCaster, oTarget); + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (DEBUG) DoDebug("nw_s0_healharm running "+IntToString(GetIsPC(OBJECT_SELF))); + int nSpellID = PRCGetSpellId(); + PRCSetSchool(GetSpellSchool(nSpellID)); + + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if(X2PreSpellCastCode()) + { + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (DEBUG )DoDebug("nw_s0_healharm running normal casting"); + if(IsTouchSpell(nSpellID) && GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + if (DEBUG) DoDebug("nw_s0_healharm running returning"); + return; + } + if (DEBUG) DoDebug("nw_s0_healharm running DoSpell"); + DoSpell(oCaster, oTarget, nSpellID); + } + else + { + if (DEBUG) DoDebug("nw_s0_healharm running else casting"); + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nSpellID)) + DecrementSpellCharges(oCaster); + } + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_horrwilt.ncs b/35expandedspells/nw_s0_horrwilt.ncs new file mode 100644 index 00000000..e3f3bba6 Binary files /dev/null and b/35expandedspells/nw_s0_horrwilt.ncs differ diff --git a/35expandedspells/nw_s0_horrwilt.nss b/35expandedspells/nw_s0_horrwilt.nss new file mode 100644 index 00000000..f178533f --- /dev/null +++ b/35expandedspells/nw_s0_horrwilt.nss @@ -0,0 +1,121 @@ +//:://///////////////////////////////////////////// +//:: Horrid Wilting +//:: NW_S0_HorrWilt +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All living creatures (not undead or constructs) + suffer 1d8 damage per caster level to a maximum + of 25d8 damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Sept 12 , 2001 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_NECROMANCY); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oCaster = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oCaster); + + int CasterLvl = nCasterLvl; + + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + effect eExplode = EffectVisualEffect(VFX_FNF_HORRID_WILTING); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eDam; + //Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + //Limit Caster level for the purposes of damage + if (nCasterLvl > 60) + { + nCasterLvl = 60; + } + + CasterLvl +=SPGetPenetr(); + + //Apply the horrid wilting explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + // GZ: Not much fun if the caster is always killing himself + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HORRID_WILTING)); + //Get the distance between the explosion and the target to calculate delay + fDelay = PRCGetRandomDelay(1.5, 2.5); + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + if(PRCGetIsAliveCreature(oTarget)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Roll damage for each target + nDamage = d8(nCasterLvl); + //Resolve metamagic + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 8 * nCasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + nDamage / 2; + } + if(/*Fort Save*/ PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (nDC), SAVING_THROW_TYPE_NONE, OBJECT_SELF, fDelay)) + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + nDamage = 0; + nDamage = nDamage/2; + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL); + // Apply effects to the currently selected target. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_imprinvis.ncs b/35expandedspells/nw_s0_imprinvis.ncs new file mode 100644 index 00000000..d08ef2c1 Binary files /dev/null and b/35expandedspells/nw_s0_imprinvis.ncs differ diff --git a/35expandedspells/nw_s0_imprinvis.nss b/35expandedspells/nw_s0_imprinvis.nss new file mode 100644 index 00000000..fe193826 --- /dev/null +++ b/35expandedspells/nw_s0_imprinvis.nss @@ -0,0 +1,90 @@ +/* + nw_s0_imprinvis + + Target creature can attack and cast spells while + invisible + + By: Preston Watamaniuk + Created: Jan 7, 2002 + Modified: Jun 12, 2006 +*/ + +void ReapplyInvis(object oTarget, effect eInvis, float fDur, int CasterLvl); + +#include "prc_sp_func" + +void ReapplyInvis(object oTarget, effect eInvis, float fDur, int CasterLvl) +{ + if(!PRCGetHasEffect(EFFECT_TYPE_INVISIBILITY, oTarget) && GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY)) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oTarget, fDur,TRUE,-1,CasterLvl); + DelayCommand(1.0, ReapplyInvis(oTarget, eInvis, fDur-1.0, CasterLvl)); +} + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int bBio = GetPRCSwitch(PRC_BIOWARE_INVISIBILITY); + float fDur; + effect eImpact = EffectVisualEffect(VFX_IMP_HEAD_MIND); + effect eVis = EffectVisualEffect(VFX_DUR_INVISIBILITY); + effect eInvis = EffectInvisibility(bBio ? INVISIBILITY_TYPE_NORMAL : INVISIBILITY_TYPE_IMPROVED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eCover = EffectConcealment(25 + (nCasterLevel/10) ); //era 50 diminui para 25 +castrlvl/10 + effect eLink = EffectLinkEffects(eDur, eCover); + eLink = EffectLinkEffects(eLink, eVis); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_IMPROVED_INVISIBILITY, FALSE)); + int CasterLvl = nCasterLevel; + int nDuration = CasterLvl/4; //alterei aqui para metade da duracao + if (GetHasFeat(FEAT_INSIDIOUSMAGIC,OBJECT_SELF) && GetHasFeat(FEAT_SHADOWWEAVE,oTarget)) + nDuration = nDuration*2; + int nMetaMagic = PRCGetMetaMagicFeat(); + //Enter Metamagic conditions + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + fDur = bBio ? TurnsToSeconds(nDuration) : RoundsToSeconds(nDuration); + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur,TRUE,-1,CasterLvl); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oTarget, fDur,TRUE,-1,CasterLvl); + DelayCommand(1.0, ReapplyInvis(oTarget, eInvis, fDur, CasterLvl)); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_incclouda.ncs b/35expandedspells/nw_s0_incclouda.ncs new file mode 100644 index 00000000..89ea90bb Binary files /dev/null and b/35expandedspells/nw_s0_incclouda.ncs differ diff --git a/35expandedspells/nw_s0_incclouda.nss b/35expandedspells/nw_s0_incclouda.nss new file mode 100644 index 00000000..83e30973 --- /dev/null +++ b/35expandedspells/nw_s0_incclouda.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Incendiary Cloud +//:: NW_S0_IncCloud.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Person within the AoE take 4d6 fire damage + per round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// +//:: March 2003: Removed movement speed penalty + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + // effect eSpeed = EffectMovementSpeedDecrease(50); + effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = eVis2; //EffectLinkEffects(eSpeed, eVis2); + float fDelay; + //Capture the first target object in the shape. + oTarget = GetEnteringObject(); + + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); +int CasterLvl = PRCGetCasterLevel(); + + //Declare the spell shape, size and the location. + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_INCENDIARY_CLOUD)); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr, fDelay)) + { + fDelay = PRCGetRandomDelay(0.5, 2.0); + //Roll damage. + nDamage = d6(CasterLvl); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * CasterLvl;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Adjust damage for Reflex Save, Evasion and Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, GetAreaOfEffectCreator(), SPELL_INCENDIARY_CLOUD), SAVING_THROW_TYPE_FIRE, GetAreaOfEffectCreator()); + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, GetLocalInt(OBJECT_SELF, "IC_Damage")); + if(nDamage > 0) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + // SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpeed, oTarget); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_inccloudc.ncs b/35expandedspells/nw_s0_inccloudc.ncs new file mode 100644 index 00000000..fceef55b Binary files /dev/null and b/35expandedspells/nw_s0_inccloudc.ncs differ diff --git a/35expandedspells/nw_s0_inccloudc.nss b/35expandedspells/nw_s0_inccloudc.nss new file mode 100644 index 00000000..73e8fd82 --- /dev/null +++ b/35expandedspells/nw_s0_inccloudc.nss @@ -0,0 +1,100 @@ +//:://///////////////////////////////////////////// +//:: Incendiary Cloud +//:: NW_S0_IncCloudC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Objects within the AoE take 4d6 fire damage + per round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// +//:: Updated By: GeorgZ 2003-08-21: Now affects doors and placeables as well + + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + float fDelay; + //Capture the first target object in the shape. + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // When the caster is no longer there, all functions calling + // GetAreaOfEffectCreator will fail. Its better to remove the barrier then + //-------------------------------------------------------------------------- + object aoeCreator = GetAreaOfEffectCreator(); + if (!GetIsObjectValid(aoeCreator)) + { + DestroyObject(OBJECT_SELF); + return; + } + + int CasterLvl = PRCGetCasterLevel(aoeCreator); + + int nPenetr = SPGetPenetrAOE(aoeCreator,CasterLvl); + + int EleDmg = GetLocalInt(OBJECT_SELF, "IC_Damage"); + + + oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Declare the spell shape, size and the location. + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, aoeCreator)) + { + fDelay = PRCGetRandomDelay(0.5, 2.0); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(aoeCreator, oTarget,nPenetr, fDelay)) + { + SignalEvent(oTarget, EventSpellCastAt(aoeCreator, SPELL_INCENDIARY_CLOUD)); + //Roll damage. + nDamage = d6(CasterLvl); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * CasterLvl;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + int nDC = PRCGetSaveDC(oTarget,aoeCreator); + //Adjust damage for Reflex Save, Evasion and Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE, aoeCreator); + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + if(nDamage > 0) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_lghtnbolt.ncs b/35expandedspells/nw_s0_lghtnbolt.ncs new file mode 100644 index 00000000..28530568 Binary files /dev/null and b/35expandedspells/nw_s0_lghtnbolt.ncs differ diff --git a/35expandedspells/nw_s0_lghtnbolt.nss b/35expandedspells/nw_s0_lghtnbolt.nss new file mode 100644 index 00000000..9246dd2b --- /dev/null +++ b/35expandedspells/nw_s0_lghtnbolt.nss @@ -0,0 +1,132 @@ +//:://///////////////////////////////////////////// +//:: Lightning Bolt +//:: NW_S0_LightnBolt +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Does 1d6 per level in a 5ft tube for 30m +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel Borstad +//:: Created On: March 8, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: May 2, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ELECTRICAL); + + int nCasterLevel = CasterLvl; + //Limit caster level + if (nCasterLevel > 20) // cap era 10 mudei para 20 + { + nCasterLevel = 20; + } + int nDamage; + int nMetaMagic = PRCGetMetaMagicFeat(); + //Set the lightning stream to start at the caster's hands + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, OBJECT_SELF, BODY_NODE_HAND); + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + effect eDamage; + object oTarget = PRCGetSpellTargetObject(); + location lTarget = GetLocation(oTarget); + object oNextTarget, oTarget2; + float fDelay; + int nCnt = 1; + + CasterLvl +=SPGetPenetr(); + + oTarget2 = GetNearestObject(OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt); + while(GetIsObjectValid(oTarget2) && GetDistanceToObject(oTarget2) <= 30.0) + { + //Get first target in the lightning area by passing in the location of first target and the casters vector (position) + oTarget = MyFirstObjectInShape(SHAPE_SPELLCYLINDER, 30.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetPosition(OBJECT_SELF)); + while (GetIsObjectValid(oTarget)) + { + //Exclude the caster from the damage effects + if (oTarget != OBJECT_SELF && oTarget2 == oTarget) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_LIGHTNING_BOLT)); + //Make an SR check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Roll damage + nDamage = d6(nCasterLevel); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * nCasterLevel;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Adjust damage based on Reflex Save, Evasion and Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY); + //Set damage effect + eDamage = PRCEffectDamage(oTarget, nDamage, EleDmg); + if(nDamage > 0) + { + fDelay = PRCGetSpellEffectDelay(GetLocation(oTarget), oTarget); + //Apply VFX impcat, damage effect and lightning effect + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget)); + } + } + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLightning,oTarget,1.0,FALSE); + //Set the currect target as the holder of the lightning effect + oNextTarget = oTarget; + eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oNextTarget, BODY_NODE_CHEST); + } + } + //Get the next object in the lightning cylinder + oTarget = MyNextObjectInShape(SHAPE_SPELLCYLINDER, 30.0, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetPosition(OBJECT_SELF)); + } + nCnt++; + oTarget2 = GetNearestObject(OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + diff --git a/35expandedspells/nw_s0_magmiss.ncs b/35expandedspells/nw_s0_magmiss.ncs new file mode 100644 index 00000000..1ca4b1fd Binary files /dev/null and b/35expandedspells/nw_s0_magmiss.ncs differ diff --git a/35expandedspells/nw_s0_magmiss.nss b/35expandedspells/nw_s0_magmiss.nss new file mode 100644 index 00000000..b78075fe --- /dev/null +++ b/35expandedspells/nw_s0_magmiss.nss @@ -0,0 +1,109 @@ + //:://///////////////////////////////////////////// +//:: Magic Missile +//:: NW_S0_MagMiss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// A missile of magical energy darts forth from your +// fingertip and unerringly strikes its target. The +// missile deals 1d4+1 points of damage. +// +// For every two extra levels of experience past 1st, you +// gain an additional missile. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 10, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: May 8, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + if (!X2PreSpellCastCode()) + return; + + //Declare major variables ( fDist / (3.0f * log( fDist ) + 2.0f) ) + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nCasterLvl = CasterLvl; + int nDamage = 0; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCnt; + effect eMissile = EffectVisualEffect(VFX_IMP_MIRV); + effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE); + int nMissiles = (nCasterLvl + 1)/2; + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + float fDelay2, fTime; + + CasterLvl +=SPGetPenetr(); + int nClass = GetLevelByClass(CLASS_TYPE_FMM); + if (GetIsObjectValid(PRCGetSpellCastItem())) nClass = 0; // The FMM boosts don't apply to wands/scrolls/etc. + if (nClass >= 3) + CasterLvl += 2; + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE)); + //Limit missiles to five + if (nMissiles > 20) + nMissiles = 20; + + // Force missile mage adds a bonus missile at 1st and 5th levels + if (nClass) nMissiles++; + if (nClass >= 5) nMissiles++; + if (nClass >= 10) nMissiles++; + if (nClass >= 15) nMissiles++; + if (nClass >= 20) nMissiles++; + if (nClass >= 25) nMissiles++; + if (nClass >= 30) nMissiles++; + if (nClass >= 35) nMissiles++; + if (nClass >= 40) nMissiles++; + if (nClass >= 45) nMissiles++; + if (nClass >= 50) nMissiles++; + if (nClass >= 55) nMissiles++; + if (nClass >= 60) nMissiles++; + //Make SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + //Apply a single damage hit for each missile instead of as a single mass + for (nCnt = 1; nCnt <= nMissiles; nCnt++) + { + //Roll damage + int nDam = d4(nMissiles/4) + 1; + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + nDam = 4*(nMissiles/4)+1;//Damage is at max + if ((nMetaMagic & METAMAGIC_EMPOWER)) + nDam = nDam + nDam/2; //Damage/Healing is +50% + + fTime = fDelay; + fDelay2 += 0.1; + fTime += fDelay2; + + //Apply the MIRV and damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0f,FALSE)); + DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget)); + } + } + else + { + for (nCnt = 1; nCnt <= nMissiles; nCnt++) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget); + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} diff --git a/35expandedspells/nw_s0_metswarm.ncs b/35expandedspells/nw_s0_metswarm.ncs new file mode 100644 index 00000000..cd8947ee Binary files /dev/null and b/35expandedspells/nw_s0_metswarm.ncs differ diff --git a/35expandedspells/nw_s0_metswarm.nss b/35expandedspells/nw_s0_metswarm.nss new file mode 100644 index 00000000..47bde87c --- /dev/null +++ b/35expandedspells/nw_s0_metswarm.nss @@ -0,0 +1,112 @@ +//:://///////////////////////////////////////////// +//:: Meteor Swarm +//:: NW_S0_MetSwarm +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Everyone in a 50ft radius around the caster + takes 20d6 fire damage. Those within 6ft of the + caster will take no damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 24 , 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 22, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + CasterLvl +=SPGetPenetr(); + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE); + + + //Declare major variables + int nMetaMagic; + int nDamage; + effect eFire; + effect eMeteor = EffectVisualEffect(VFX_FNF_METEOR_SWARM); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + //Apply the meteor swarm VFX area impact + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMeteor, GetLocation(OBJECT_SELF)); + //Get first object in the spell area + float fDelay; + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) && oTarget != OBJECT_SELF) + { + fDelay = PRCGetRandomDelay(); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_METEOR_SWARM)); + //Make sure the target is outside the 2m safe zone + if (GetDistanceBetween(oTarget, OBJECT_SELF) > 2.0) + { + //Make SR check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, 0.5)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Roll damage + nDamage = d6(CasterLvl); //alterado rafael antes era 20 troquei pelo caster lvl + + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * CasterLvl;//Damage is at max //alterado rafael antes era 20 troquei pelo caster lvl + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (nDC),SAVING_THROW_TYPE_FIRE); + //Set the damage effect + eFire = PRCEffectDamage(oTarget, nDamage, EleDmg); + if(nDamage > 0) + { + //Apply damage effect and VFX impact. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + } + //Get next target in the spell area + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF)); + } + + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the local integer storing the spellschool name +} + diff --git a/35expandedspells/nw_s0_phankill.ncs b/35expandedspells/nw_s0_phankill.ncs new file mode 100644 index 00000000..dcf76173 Binary files /dev/null and b/35expandedspells/nw_s0_phankill.ncs differ diff --git a/35expandedspells/nw_s0_phankill.nss b/35expandedspells/nw_s0_phankill.nss new file mode 100644 index 00000000..0abbafeb --- /dev/null +++ b/35expandedspells/nw_s0_phankill.nss @@ -0,0 +1,161 @@ +//:://///////////////////////////////////////////// +//:: Phantasmal Killer +//:: NW_S0_PhantKill +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Target of the spell must make 2 saves or die. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 14 , 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 22, 2001 +//:: Update Pass By: Preston W, On: Aug 3, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +int PRCMySavingThrow2(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0); + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION); +/* + 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 nDamage = d6(7); + int nMetaMagic = PRCGetMetaMagicFeat(); + object oTarget = PRCGetSpellTargetObject(); + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eVis2 = EffectVisualEffect(VFX_IMP_SONIC); + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PHANTASMAL_KILLER)); + //Make an SR check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget) && !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS)) + { + //Make a Will save + // Feb 17, 2004 + // !MySavingThrow does not work here, because it does not take into account whether + // the creature is immune to the effect. If immune, it still does the fort save, so + // the target will still take damage or die. To avoid messing with things too much, + // I've made a copy of the function in this script, with an edit to return the proper + // value if the spell was resisted. + //Make a Will save + if (!PRCMySavingThrow2(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_MIND_SPELLS)) + { + // Immunity to fear, makes you immune to Phantasmal Killer. + if ( GetIsImmune( oTarget, IMMUNITY_TYPE_FEAR ) == FALSE ) + { + //Make a Fort save + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF),SAVING_THROW_TYPE_DEATH)) + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + return; + //Check for metamagic + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 42; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = FloatToInt( IntToFloat(nDamage) * 1.5 ); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + //Set the damage property + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL); + //Apply the damage effect and VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + } + else + { + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(); + if(!GetPRCSwitch(PRC_165_DEATH_IMMUNITY)) + eDeath = SupernaturalEffect(eDeath); + //Apply the death effect and VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + //SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} + +int PRCMySavingThrow2(int nSavingThrow, object oTarget, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus = OBJECT_SELF, float fDelay = 0.0) +{ + + object oCaster = GetLastSpellCaster(); + int iRW = GetLevelByClass(CLASS_TYPE_RED_WIZARD, oCaster); + int iTK = GetLevelByClass(CLASS_TYPE_THAYAN_KNIGHT, oTarget); + int iRedWizard = GetLevelByClass(CLASS_TYPE_RED_WIZARD, oTarget); + int nSpell = PRCGetSpellId(); + + // Handle the target having Force of Will and being targeted by a psionic power + if(nSavingThrow != SAVING_THROW_WILL && + nSpell > 14000 && nSpell < 14360 && + GetHasFeat(FEAT_FORCE_OF_WILL, oTarget) && + !GetLocalInt(oTarget, "ForceOfWillUsed") && + // Only use will save if it's better + (nSavingThrow == SAVING_THROW_FORT ? GetFortitudeSavingThrow(oTarget) : GetReflexSavingThrow(oTarget)) > GetWillSavingThrow(oTarget) + ) + { + nSavingThrow = SAVING_THROW_WILL; + SetLocalInt(oTarget, "ForceOfWillUsed", TRUE); + DelayCommand(6.0f, DeleteLocalInt(oTarget, "ForceOfWillUsed")); + SendMessageToPC(oTarget, "Force Of Will used"); + } + + if (iRW > 0 && iTK > 0 && nSaveType == SAVING_THROW_TYPE_MIND_SPELLS) + { + return 0; + } + + + //racial pack code + if(nSaveType == SAVING_THROW_TYPE_FIRE && GetHasFeat(FEAT_HARD_FIRE, oTarget) ) + { nDC -= 1+(GetHitDice(oTarget)/5); } + else if(nSaveType == SAVING_THROW_TYPE_COLD && GetHasFeat(FEAT_HARD_WATER, oTarget) ) + { nDC -= 1+(GetHitDice(oTarget)/5); } + else if(nSaveType == SAVING_THROW_TYPE_ELECTRICITY ) + { + if(GetHasFeat(FEAT_HARD_AIR, oTarget)) + nDC -= 1+(GetHitDice(oTarget)/5); + else if(GetHasFeat(FEAT_HARD_ELEC, oTarget)) + nDC -= 2; + } + else if(nSaveType == SAVING_THROW_TYPE_POISON && GetHasFeat(FEAT_POISON_3, oTarget) ) + { nDC -= 3; } + else if(nSaveType == SAVING_THROW_TYPE_ACID && GetHasFeat(FEAT_HARD_EARTH, oTarget) ) + { nDC -= 1+(GetHitDice(oTarget)/5); } + + return BWSavingThrow(nSavingThrow, oTarget, nDC, nSaveType, oSaveVersus, fDelay); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_pwstun.ncs b/35expandedspells/nw_s0_pwstun.ncs new file mode 100644 index 00000000..f06a8188 Binary files /dev/null and b/35expandedspells/nw_s0_pwstun.ncs differ diff --git a/35expandedspells/nw_s0_pwstun.nss b/35expandedspells/nw_s0_pwstun.nss new file mode 100644 index 00000000..f339d54f --- /dev/null +++ b/35expandedspells/nw_s0_pwstun.nss @@ -0,0 +1,125 @@ +//:://///////////////////////////////////////////// +//:: [Power Word Stun] +//:: [NW_S0_PWStun.nss] +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +/* + The creature is stunned for a certain number of + rounds depending on its HP. No save. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Feb 4, 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 22, 2001 + +/* +bugfix by Kovi 2002.07.28 +- =151HP stunned for 4d4 rounds +- >151HP sometimes stunned for indefinit duration +*/ + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +#include "prc_inc_spells" + + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_DIVINATION); +/* + 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 CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + object oTarget = PRCGetSpellTargetObject(); + int nHP = GetCurrentHitPoints(oTarget); + effect eStun = EffectStunned(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eMind, eStun); + effect eVis = EffectVisualEffect(VFX_IMP_STUN); + effect eWord = EffectVisualEffect(VFX_FNF_PWSTUN); + int nDuration; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nMeta; + //Apply the VFX impact + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eWord, PRCGetSpellTargetLocation()); + //Determine the number rounds the creature will be stunned + if (nHP >= 201) + { + nDuration = 1; + nMeta = 1; + } + else if (nHP >= 151 && nHP <= 200) + { + nDuration = d2(1); + nMeta = 2; + } + else if (nHP >= 101 && nHP <= 150) + { + nDuration = d4(1); + nMeta = 4; + } + else if (nHP >= 51 && nHP <= 100) + { + nDuration = d4(2); + nMeta = 8; + } + else + { + nDuration = d4(4); + nMeta = 16; + } + + //Enter Metamagic conditions + if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE)) + { + nDuration = nMeta;//Damage is at max + } + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER)) + { + nDuration = nDuration + (nDuration/2); //Damage/Healing is +50% + } + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration = nDuration * 2; //Duration is +100% + } + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_POWER_WORD_STUN)); + //Make an SR check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget)) + { + if (nDuration>0) + { + //Apply linked effect and the VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + } + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} + diff --git a/35expandedspells/nw_s0_rayfrost.ncs b/35expandedspells/nw_s0_rayfrost.ncs new file mode 100644 index 00000000..b306aea5 Binary files /dev/null and b/35expandedspells/nw_s0_rayfrost.ncs differ diff --git a/35expandedspells/nw_s0_rayfrost.nss b/35expandedspells/nw_s0_rayfrost.nss new file mode 100644 index 00000000..5dd1a2a6 --- /dev/null +++ b/35expandedspells/nw_s0_rayfrost.nss @@ -0,0 +1,99 @@ +//:://///////////////////////////////////////////// +//:: Ray of Frost +//:: [NW_S0_RayFrost.nss] +//:: Copyright (c) 2000 Bioware Corp. +//:://///////////////////////////////////////////// +/* +Evocation [Cold] +Level: Sor/Wiz 0 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: Ray +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +A ray of freezing air and ice projects from your +pointing finger. You must succeed on a ranged +touch attack with the ray to deal damage to a +target. The ray deals 1d3 points of cold damage. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: feb 4, 2001 +//::////////////////////////////////////////////// +//:: Bug Fix: Andrew Nobbs, April 17, 2003 +//:: Notes: Took out ranged attack roll. +//::////////////////////////////////////////////// +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff +//:: added hold ray functionality - HackyKid + +#include "prc_inc_sp_tch" +#include "prc_sp_func" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel) +{ + //Declare major variables + int nPenetr = nCasterLevel + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_COLD); + int iAttackRoll = 0;//placeholder + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_RAY_OF_FROST)); + + iAttackRoll = PRCDoRangedTouchAttack(oTarget); + if(iAttackRoll > 0) + { + //Make SR Check + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + int nDamage = PRCMaximizeOrEmpower(nPenetr, 1, nMetaMagic); //alterei o 3 para nPenetr + + //Apply the VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + // perform ranged touch attack and apply sneak attack if any exists + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, EleDmg); + PRCBonusDamage(oTarget); + } + } + effect eRay = EffectBeam(VFX_BEAM_COLD, oCaster, BODY_NODE_HAND, !iAttackRoll); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7, FALSE); + } + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_regen.ncs b/35expandedspells/nw_s0_regen.ncs new file mode 100644 index 00000000..79a497dc Binary files /dev/null and b/35expandedspells/nw_s0_regen.ncs differ diff --git a/35expandedspells/nw_s0_regen.nss b/35expandedspells/nw_s0_regen.nss new file mode 100644 index 00000000..5f49ece3 --- /dev/null +++ b/35expandedspells/nw_s0_regen.nss @@ -0,0 +1,78 @@ +/* + nw_s0_regen + + Grants the selected target 6 HP of regeneration + every round. + + By: Preston Watamaniuk + Created: Oct 22, 2001 + Modified: Jun 16, 2006 +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nDur = PRCGetCasterLevel(OBJECT_SELF); + effect eRegen = EffectRegenerate(6 + (nDur/2), 6.0); + effect eVis = EffectVisualEffect(VFX_IMP_HEAD_NATURE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eRegen, eDur); + int nMeta = PRCGetMetaMagicFeat(); + + //Meta-Magic Checks + if (nMeta & METAMAGIC_EXTEND) + nDur *= 2; + + PRCRemoveEffectsFromSpell(oTarget, SPELL_REGENERATE); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_REGENERATE, FALSE)); + //Apply effects and VFX + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDur),TRUE,-1,nCasterLevel); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Regrow fingers + if(GetPersistantLocalInt(OBJECT_SELF, "FINGERS_LEFT_HAND")) + { + SetPersistantLocalInt(OBJECT_SELF, "FINGERS_LEFT_HAND", 6); + SetPersistantLocalInt(OBJECT_SELF, "FINGERS_RIGHT_HAND", 6); + DeletePersistantLocalInt(OBJECT_SELF, "LEFT_HAND_USELESS"); + DeletePersistantLocalInt(OBJECT_SELF, "RIGHT_HAND_USELESS"); + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_sanctuary.ncs b/35expandedspells/nw_s0_sanctuary.ncs new file mode 100644 index 00000000..be8c30d5 Binary files /dev/null and b/35expandedspells/nw_s0_sanctuary.ncs differ diff --git a/35expandedspells/nw_s0_sanctuary.nss b/35expandedspells/nw_s0_sanctuary.nss new file mode 100644 index 00000000..8dd9f0f1 --- /dev/null +++ b/35expandedspells/nw_s0_sanctuary.nss @@ -0,0 +1,109 @@ +/* + nw_s0_sanctuary + + Makes the target creature invisible to hostile + creatures unless they make a Will Save to ignore + the Sanctuary Effect + + By: Preston Watamaniuk + Created: Jan 7, 2002 + Modified: Jun 29, 2006 + + Flaming_Sword: added greater sanctuary + cleaned up +*/ + +#include "prc_sp_func" +#include "prc_inc_teleport" +#include "prc_add_spell_dc" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nSpellID = PRCGetSpellId(); + int bSanc = (nSpellID == SPELL_SANCTUARY); + effect eSanc = bSanc ? EffectSanctuary((PRCGetSaveDC(oTarget,oCaster))) : EffectEthereal(); + effect eLink = EffectLinkEffects(EffectVisualEffect(VFX_DUR_SANCTUARY), eSanc); + eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + float fDuration = bSanc ? RoundsToSeconds(1+(nCasterLevel/10)) : TurnsToSeconds(1+(nCasterLevel/10)); + int nMetaMagic = PRCGetMetaMagicFeat(); + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + fDuration *= 2; //Duration is +100% + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE)); + if(bSanc || GetCanTeleport(oTarget, GetLocation(oTarget), FALSE, TRUE)) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration,TRUE,-1,nCasterLevel); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + //teste cooldown + //Spell Time Lock duration (in seconds, use float values) + float iLockTimer = 240.0; + //Defining time variables + float f120togo = ( 120 - iLockTimer ) * -1; + float f60togo = ( 60 - iLockTimer ) * -1; + float f10togo = ( 10 - iLockTimer ) * -1; + + //Checking spell's caster + object oTarget = PRCGetSpellTargetObject(); + //Checking if he used GS recently + int iTimer = GetLocalInt(oTarget, "GSTimer"); + + + + +if (iTimer == 0) //teste + { + SetLocalInt(oTarget, "GSTimer", 1); + //Change: Checking target's area + object oArea = GetArea(oTarget); + + + + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + //object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); + + + SendMessageToAllDMs("Player "+ObjectToString(oCaster)+" has just cast Greater Sanctuary. He is currently in "+ObjectToString(oArea)+"."); + SendMessageToPC(oTarget, "Greater Sanctuary has a timer of "+FloatToString(iLockTimer, 3, 1)+" seconds. You may not use GS again for this period of time. Attempting to do so will spend the spell while producing no effect."); + DelayCommand(f120togo, SendMessageToPC(oTarget, "You have two minutes left on your Greater Sanctuary Lock Timer.")); + DelayCommand(f60togo, SendMessageToPC(oTarget, "You have one minute left on your Greater Sanctuary Lock Timer.")); + DelayCommand(f10togo, SendMessageToPC(oTarget, "You have 10 seconds left on your Greater Sanctuary Lock Timer.")); + DelayCommand(iLockTimer, SendMessageToPC(oTarget, "Greater Sanctuary is once again available for use.")); + DelayCommand(iLockTimer, SetLocalInt(oTarget, "GSTimer", 0)); + } + else + { + SendMessageToPC(oTarget, "You have used Greater Sanctuary too recently, the effect has been cancelled"); + } + +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_searlght.ncs b/35expandedspells/nw_s0_searlght.ncs new file mode 100644 index 00000000..0f66175f Binary files /dev/null and b/35expandedspells/nw_s0_searlght.ncs differ diff --git a/35expandedspells/nw_s0_searlght.nss b/35expandedspells/nw_s0_searlght.nss new file mode 100644 index 00000000..13fc472d --- /dev/null +++ b/35expandedspells/nw_s0_searlght.nss @@ -0,0 +1,139 @@ +//:://///////////////////////////////////////////// +//:: Searing Light +//:: s_SearLght.nss +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +//:: Focusing holy power like a ray of the sun, you project +//:: a blast of light from your open palm. You must succeed +//:: at a ranged touch attack to strike your target. A creature +//:: struck by this ray of light suffers 1d8 points of damage +//:: per two caster levels (maximum 5d8). Undead creatures suffer +//:: 1d6 points of damage per caster level (maximum 10d6), and +//:: undead creatures particularly vulnerable to sunlight, such +//:: as vampires, suffer 1d8 points of damage per caster level +//:: (maximum 10d8). Constructs and inanimate objects suffer only +//:: 1d6 points of damage per two caster levels (maximum 5d6). +//::////////////////////////////////////////////// +//:: Created By: Keith Soleski +//:: Created On: 02/05/2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 25, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 for PRC stuff + +//:: Added hold ray functionality - HackyKid + +#include "prc_sp_func" +#include "prc_add_spell_dc" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDamage; + int nMax; + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eRay = EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SEARING_LIGHT)); + eRay = EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND); + //Make an SR Check + if (!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + //Limit caster level + if (nCasterLevel > 20) + { + nCasterLevel = 20; + } + //Check for racial type undead + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + nDamage = d8(nCasterLevel); + nMax = 8; + } + //Check for racial type construct + else if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT) + { + nCasterLevel /= 2; + if(nCasterLevel == 0) + { + nCasterLevel = 1; + } + nDamage = d6(nCasterLevel); + nMax = 6; + } + else + { + nCasterLevel = nCasterLevel/2; + if(nCasterLevel == 0) + { + nCasterLevel = 1; + } + nDamage = d8(nCasterLevel); + nMax = 8; + } + + //Make metamagic checks + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nMax * nCasterLevel; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); + } + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + //Apply the damage effect and VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + //SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.0); + } + } + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7,FALSE); + + return !GetIsReactionTypeFriendly(oTarget); //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} + diff --git a/35expandedspells/nw_s0_shadshld.ncs b/35expandedspells/nw_s0_shadshld.ncs new file mode 100644 index 00000000..57936c79 Binary files /dev/null and b/35expandedspells/nw_s0_shadshld.ncs differ diff --git a/35expandedspells/nw_s0_shadshld.nss b/35expandedspells/nw_s0_shadshld.nss new file mode 100644 index 00000000..f7f3c7ce --- /dev/null +++ b/35expandedspells/nw_s0_shadshld.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Shadow Shield +//:: NW_S0_ShadShld.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Grants the caster +5 AC and 10 / +3 Damage + Reduction and immunity to death effects + and negative energy damage for 3 Turns per level. + Makes the caster immune Necromancy Spells + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 22, 2001 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION); +/* + 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 + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + //Do metamagic extend check + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration *= 2; //Duration is +100% + } + effect eStone = EffectDamageReduction(CasterLvl, DAMAGE_POWER_PLUS_THREE); + effect eAC = EffectACIncrease(5, AC_NATURAL_BONUS); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH_WARD); + effect eShadow = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + effect eSpell = EffectSpellLevelAbsorption(9, 0, SPELL_SCHOOL_NECROMANCY); + effect eImmDeath = EffectImmunity(IMMUNITY_TYPE_DEATH); + effect eImmNeg = EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + //Link major effects + effect eLink = EffectLinkEffects(eStone, eAC); + eLink = EffectLinkEffects(eLink, eVis); + eLink = EffectLinkEffects(eLink, eShadow); + eLink = EffectLinkEffects(eLink, eImmDeath); + eLink = EffectLinkEffects(eLink, eImmNeg); + eLink = EffectLinkEffects(eLink, eDur); + eLink = EffectLinkEffects(eLink, eSpell); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SHADOW_SHIELD, FALSE)); + //Apply linked effect + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl); + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} + diff --git a/35expandedspells/nw_s0_sleep.ncs b/35expandedspells/nw_s0_sleep.ncs new file mode 100644 index 00000000..e333f4a0 Binary files /dev/null and b/35expandedspells/nw_s0_sleep.ncs differ diff --git a/35expandedspells/nw_s0_sleep.nss b/35expandedspells/nw_s0_sleep.nss new file mode 100644 index 00000000..221f3731 --- /dev/null +++ b/35expandedspells/nw_s0_sleep.nss @@ -0,0 +1,172 @@ +//:://///////////////////////////////////////////// +//:: Sleep +//:: NW_S0_Sleep +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Goes through the area and sleeps the lowest 4+d4 + HD of creatures first. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: March 7 , 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001 +//:: VFX Pass By: Preston W, On: June 25, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget; + object oLowest; + effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20); + effect eSleep = EffectSleep(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eVis = EffectVisualEffect(VFX_IMP_SLEEP); + + effect eLink = EffectLinkEffects(eSleep, eMind); + eLink = EffectLinkEffects(eLink, eDur); + + // * Moved the linking for the ZZZZs into the later code + // * so that they won't appear if creature immune + + int bContinueLoop; + int nHD = 1 + d20(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCurrentHD; + int bAlreadyAffected; + int nMax = 21;// maximun hd creature affected + int nLow; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + int nDuration = CasterLvl; + int nScaledDuration; + nDuration = 3 + nDuration; + int nPenetr = CasterLvl + SPGetPenetr(); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + string sSpellLocal = "BIOWARE_SPELL_LOCAL_SLEEP_" + ObjectToString(OBJECT_SELF); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nHD = 21;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nHD = nHD + (nHD/2); //Damage/Healing is +50% + } + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + nDuration += 2; + //Get the first target in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + //If no valid targets exists ignore the loop + if (GetIsObjectValid(oTarget)) + { + bContinueLoop = TRUE; + } + // The above checks to see if there is at least one valid target. + while ((nHD > 0) && (bContinueLoop)) + { + nLow = nMax; + bContinueLoop = FALSE; + //Get the first creature in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + //Make faction check to ignore allies + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) + && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT + && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + //Get the local variable off the target and determined if the spell has already checked them. + bAlreadyAffected = GetLocalInt(oTarget, sSpellLocal); + if (!bAlreadyAffected) + { + //Get the current HD of the target creature + nCurrentHD = GetHitDice(oTarget); + //Check to see if the HD are lower than the current Lowest HD stored and that the + //HD of the monster are lower than the number of HD left to use up. + if(nCurrentHD < nLow + && nCurrentHD <= nHD + && (nCurrentHD < 2 || GetPRCSwitch(PRC_SLEEP_NO_HD_CAP))) + { + nLow = nCurrentHD; + oLowest = oTarget; + bContinueLoop = TRUE; + } + } + } + //Get the next target in the shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + } + //Check to see if oLowest returned a valid object + if(oLowest != OBJECT_INVALID) + { + //Fire cast spell at event for the specified target + SignalEvent(oLowest, EventSpellCastAt(OBJECT_SELF, SPELL_SLEEP)); + //Make SR check + if (!PRCDoResistSpell(OBJECT_SELF, oLowest,nPenetr)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Make Fort save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oLowest, (nDC), SAVING_THROW_TYPE_MIND_SPELLS)) + { + //SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oLowest); + if (GetIsImmune(oLowest, IMMUNITY_TYPE_SLEEP) == FALSE) + { + effect eLink2 = EffectLinkEffects(eLink, eVis); + nScaledDuration = PRCGetScaledDuration(nDuration, oLowest); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oLowest, RoundsToSeconds(nScaledDuration)); + } + else + // * even though I am immune apply just the sleep effect for the immunity message + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSleep, oLowest, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + } + + } + } + } + //Set a local int to make sure the creature is not used twice in the pass. Destroy that variable in + //.3 seconds to remove it from the creature + SetLocalInt(oLowest, sSpellLocal, TRUE); + DelayCommand(0.5, SetLocalInt(oLowest, sSpellLocal, FALSE)); + DelayCommand(0.5, DeleteLocalInt(oLowest, sSpellLocal)); + //Remove the HD of the creature from the total + nHD = nHD - GetHitDice(oLowest); + oLowest = OBJECT_INVALID; + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_sndburst.ncs b/35expandedspells/nw_s0_sndburst.ncs new file mode 100644 index 00000000..80e39159 Binary files /dev/null and b/35expandedspells/nw_s0_sndburst.ncs differ diff --git a/35expandedspells/nw_s0_sndburst.nss b/35expandedspells/nw_s0_sndburst.nss new file mode 100644 index 00000000..61c04d3a --- /dev/null +++ b/35expandedspells/nw_s0_sndburst.nss @@ -0,0 +1,104 @@ +//:://///////////////////////////////////////////// +//:: [Sound Burst] +//:: [NW_S0_SndBurst.nss] +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +/* +Evocation [Sonic] +Level: Brd 2, Clr 2 +Components: V, S, F/DF +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Area: 10-ft.-radius spread +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: Yes + +You blast an area with a tremendous cacophony. +Every creature in the area takes 1d8 points of +sonic damage and must succeed on a Fortitude save +to avoid being stunned for 1 round. + +Creatures that cannot hear are not stunned but +are still damaged. + +Arcane Focus +A musical instrument. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 31, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Georg Z, Oct. 2003 +//:: modified by mr_bumpkin Dec 4, 2003 + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_SONIC); + int nSaveType = ChangedSaveType(EleDmg); + + effect eFNF = EffectVisualEffect(VFX_FNF_SOUND_BURST); + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + + effect eStun = EffectStunned(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eStun, eMind); + eLink = EffectLinkEffects(eLink, eDur); + + //Apply the FNF to the spell location + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, lLoc); + + //Get the first target in the spell area + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc); + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_SOUND_BURST)); + //Make a SR check + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + // Should not work on creatures already deafened or silenced + if(!PRCGetHasEffect(EFFECT_TYPE_DEAF, oTarget) && !PRCGetHasEffect(EFFECT_TYPE_SILENCE, oTarget)) + { + int nDC = PRCGetSaveDC(oTarget, oCaster); + //Make a Fortitude roll to avoid being stunned + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, nSaveType)) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2), TRUE, SPELL_SOUND_BURST, nCasterLevel); + } + + //Roll damage + int nDamage = d8() +(nPenetr/4) ; + //Make meta magic checks + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 8 +(nPenetr/4) ; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage / 2; + + //Set the damage effect + effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + //Apply the VFX impact and damage effect + DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + //Get the next target in the spell area + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc); + } + PRCSetSchool(); +} diff --git a/35expandedspells/nw_s0_spmantle.ncs b/35expandedspells/nw_s0_spmantle.ncs new file mode 100644 index 00000000..2bd31604 Binary files /dev/null and b/35expandedspells/nw_s0_spmantle.ncs differ diff --git a/35expandedspells/nw_s0_spmantle.nss b/35expandedspells/nw_s0_spmantle.nss new file mode 100644 index 00000000..9212a935 --- /dev/null +++ b/35expandedspells/nw_s0_spmantle.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Spell Turning +//:: NW_S0_SpTurn.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Absorbes 1d8 + 8 spell levels before disapearing. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION); +/* + 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 + object oTarget = PRCGetSpellTargetObject(); + effect eVis = EffectVisualEffect(VFX_DUR_SPELLTURNING); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + int nAbsorb = d8() + 8; + int nMetaMagic = PRCGetMetaMagicFeat(); + + PRCRemoveEffectsFromSpell(oTarget, GetSpellId()); + PRCRemoveEffectsFromSpell(oTarget, SPELL_LESSER_SPELL_MANTLE); + PRCRemoveEffectsFromSpell(oTarget, SPELL_GREATER_SPELL_MANTLE); + + //Enter Metamagic conditions + if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE)) + { + nAbsorb = 16;//Damage is at max + } + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER)) + { + nAbsorb = nAbsorb + (nAbsorb/2); //Damage/Healing is +50% + } + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + //Link Effects + effect eAbsob = EffectSpellLevelAbsorption(9, nAbsorb); + effect eLink = EffectLinkEffects(eVis, eAbsob); + eLink = EffectLinkEffects(eLink, eDur); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SPELL_MANTLE, FALSE)); + + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} + + diff --git a/35expandedspells/nw_s0_stormvenc.ncs b/35expandedspells/nw_s0_stormvenc.ncs new file mode 100644 index 00000000..99f9a5dc Binary files /dev/null and b/35expandedspells/nw_s0_stormvenc.ncs differ diff --git a/35expandedspells/nw_s0_stormvenc.nss b/35expandedspells/nw_s0_stormvenc.nss new file mode 100644 index 00000000..2a436115 --- /dev/null +++ b/35expandedspells/nw_s0_stormvenc.nss @@ -0,0 +1,100 @@ +//:://///////////////////////////////////////////// +//:: Storm of Vengeance: Heartbeat +//:: NW_S0_StormVenC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creates an AOE that decimates the enemies of + the cleric over a 30ft radius around the caster +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 8, 2001 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 +//:: Elemental Damage note: Only made the lightning aspect variable, the acid aspect is always acid. +//:: the Lightning part seemed like the better of the 2 to go with because it accounts for more +//:: of the total damage than the acid does. + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); + + //Declare major variables + effect eStun = EffectStunned(); + effect eVisAcid = EffectVisualEffect(VFX_IMP_ACID_S); + effect eVisElec = EffectVisualEffect(VFX_IMP_LIGHTNING_M); + effect eVisStun = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eStun, eVisStun); + eLink = EffectLinkEffects(eLink, eDur); + float fDelay; + + int CasterLvl = PRCGetCasterLevel(GetAreaOfEffectCreator()); + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator(),CasterLvl); + + + + //Get first target in spell area + object oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE); + while(GetIsObjectValid(oTarget)) + { + int nDamage = d6(CasterLvl) + ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + effect eElec = PRCEffectDamage(oTarget, nDamage, ChangedElementalDamage(GetAreaOfEffectCreator(), DAMAGE_TYPE_ELECTRICAL)); + + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELL_STORM_OF_VENGEANCE)); + //Make an SR Check + fDelay = PRCGetRandomDelay(0.5, 2.0); + if(PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr, fDelay) == 0) + { + int nDC = PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()); + int nAcid = d6(CasterLvl/2); + // Acid Sheath adds +1 damage per die to acid descriptor spells + if (GetHasDescriptor(SPELL_STORM_OF_VENGEANCE, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, GetAreaOfEffectCreator())) + nAcid += 3; + effect eAcid = PRCEffectDamage(oTarget, nAcid, DAMAGE_TYPE_ACID); + + //Make a saving throw check + // * if the saving throw is made they still suffer acid damage. + // * if they fail the saving throw, they suffer Electrical damage too + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (nDC), SAVING_THROW_TYPE_ELECTRICITY, GetAreaOfEffectCreator(), fDelay)) + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget)); + if (d2()==1) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget)); + } + } + else + { + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisAcid, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget)); + //Apply the VFX impact and effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisElec, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eElec, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(2))); + } + } + } + //Get next target in spell area + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_sunbeam.ncs b/35expandedspells/nw_s0_sunbeam.ncs new file mode 100644 index 00000000..c7e97e4e Binary files /dev/null and b/35expandedspells/nw_s0_sunbeam.ncs differ diff --git a/35expandedspells/nw_s0_sunbeam.nss b/35expandedspells/nw_s0_sunbeam.nss new file mode 100644 index 00000000..99a459bf --- /dev/null +++ b/35expandedspells/nw_s0_sunbeam.nss @@ -0,0 +1,147 @@ +//:://///////////////////////////////////////////// +//:: Sunbeam +//:: s_Sunbeam.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +//:: All creatures in the beam are struck blind and suffer 4d6 points of damage. (A successful +//:: Reflex save negates the blindness and reduces the damage by half.) Creatures to whom sunlight +//:: is harmful or unnatural suffer double damage. +//:: +//:: Undead creatures caught within the ray are dealt 1d6 points of damage per caster level +//:: (maximum 20d6), or half damage if a Reflex save is successful. In addition, the ray results in +//:: the total destruction of undead creatures specifically affected by sunlight if they fail their saves. +//::////////////////////////////////////////////// +//:: Created By: Keith Soleski +//:: Created On: Feb 22, 2001 +//::////////////////////////////////////////////// +//:: Last Modified By: Keith Soleski, On: March 21, 2001 +//:: VFX Pass By: Preston W, On: June 25, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 nMetaMagic = PRCGetMetaMagicFeat(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eVis2 = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eStrike = EffectVisualEffect(VFX_FNF_SUNBEAM); + effect eDam; + effect eBlind = EffectBlindness(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eBlind, eDur); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDamage; + int nOrgDam; + int nMax; + float fDelay; + int nBlindLength = 3; + + + int nPenetr = CasterLvl + SPGetPenetr(); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, PRCGetSpellTargetLocation()); + //Get the first target in the spell area + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation()); + while(GetIsObjectValid(oTarget)) + { + + int nCasterLevel= CasterLvl; + //Limit caster level + if (nCasterLevel > 60) + { + nCasterLevel = 60; + } + + // Make a faction check + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + fDelay = PRCGetRandomDelay(1.0, 2.0); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SUNBEAM)); + //Make an SR check + if ( ! PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr, 1.0)) + { + //Check if the target is an undead + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + //Roll damage and save + nDamage = d6(nCasterLevel); + nMax = 360; + } + else + { + //Roll damage and save + nDamage = d6(nCasterLevel/3); + nOrgDam = nDamage; + nMax = 160; + nCasterLevel = 3; + //Get the adjusted damage due to Reflex Save, Evasion or Improved Evasion + } + + //Do metamagic checks + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nMax * nCasterLevel; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); + } + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + + //Check that a reflex save was made. + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, (nDC), SAVING_THROW_TYPE_DIVINE, OBJECT_SELF, 1.0) == 0) + { + DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nBlindLength),TRUE,-1,CasterLvl)); + } + else + { + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, 0, SAVING_THROW_TYPE_DIVINE); + } + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + if(nDamage > 0) + { + //Apply the damage effect and VFX impact + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Get the next target in the spell area + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation()); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_vamptch.ncs b/35expandedspells/nw_s0_vamptch.ncs new file mode 100644 index 00000000..f942c70d Binary files /dev/null and b/35expandedspells/nw_s0_vamptch.ncs differ diff --git a/35expandedspells/nw_s0_vamptch.nss b/35expandedspells/nw_s0_vamptch.nss new file mode 100644 index 00000000..bcca6423 --- /dev/null +++ b/35expandedspells/nw_s0_vamptch.nss @@ -0,0 +1,127 @@ +/* + nw_s0_vamptch + + drain 1d6 + HP per 2 caster levels from the target. + + By: Preston Watamaniuk + Created: Oct 29, 2001 + Modified: Jun 28, 2006 + + Cleaned up +*/ + +//------------------------------------------------------------------------------ +// GZ: gets rids of temporary hit points so that they will not stack +//------------------------------------------------------------------------------ +void PRCRemoveTempHitPoints() +{ + effect eProtection; + int nCnt = 0; + + eProtection = GetFirstEffect(OBJECT_SELF); + while (GetIsEffectValid(eProtection)) + { + if(GetEffectType(eProtection) == EFFECT_TYPE_TEMPORARY_HITPOINTS) + RemoveEffect(OBJECT_SELF, eProtection); + eProtection = GetNextEffect(OBJECT_SELF); + } +} + +#include "prc_sp_func" +#include "prc_inc_sp_tch" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDDice = nCasterLevel / 2; + if ((nDDice) == 0) + nDDice = 1; + else if (nDDice > 20) + nDDice = 20; + + int nDamage = PRCMaximizeOrEmpower(6,nDDice,nMetaMagic); + int nDuration = nCasterLevel/2; + + if ((nMetaMagic & METAMAGIC_EXTEND)) + nDuration *= 2; + + int nMax = GetCurrentHitPoints(oTarget) + 10; + if(nMax < nDamage) + nDamage = nMax; + + + effect eHeal = EffectTemporaryHitpoints(nDamage); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eHeal, eDur); + + //effect eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_NEGATIVE); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eVisHeal = EffectVisualEffect(VFX_IMP_HEALING_M); + + int nPenetr = nCasterLevel + SPGetPenetr(); + int iAttackRoll; + if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) + { + if(!GetIsReactionTypeFriendly(oTarget) && + MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD && + !(GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD) && + MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT && + !GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION, oTarget)) + { + SignalEvent(oCaster, EventSpellCastAt(OBJECT_SELF, SPELL_VAMPIRIC_TOUCH, FALSE)); + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_VAMPIRIC_TOUCH, TRUE)); + + iAttackRoll = PRCDoMeleeTouchAttack(oTarget); + + if (iAttackRoll > 0) + { + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, DAMAGE_TYPE_NEGATIVE); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisHeal, oCaster); + PRCRemoveTempHitPoints(); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, HoursToSeconds(nDuration),TRUE,-1,nCasterLevel); + } + } + } + } + + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_virtue.ncs b/35expandedspells/nw_s0_virtue.ncs new file mode 100644 index 00000000..7f2ab7dc Binary files /dev/null and b/35expandedspells/nw_s0_virtue.ncs differ diff --git a/35expandedspells/nw_s0_virtue.nss b/35expandedspells/nw_s0_virtue.nss new file mode 100644 index 00000000..18eb47cb --- /dev/null +++ b/35expandedspells/nw_s0_virtue.nss @@ -0,0 +1,60 @@ +/* + nw_s0_virtue + + Target gains 1 temporary HP + + By: Preston Watamaniuk + Created: Sept 6, 2001 + Modified: Jun 28, 2006 + + Cleaned up +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nDuration = nCasterLevel; + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eLink = EffectLinkEffects(EffectTemporaryHitpoints(nCasterLevel), EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) nDuration *= 2; //Duration is +100% + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_VIRTUE, FALSE)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,nCasterLevel); + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/nw_s0_wallfirea.ncs b/35expandedspells/nw_s0_wallfirea.ncs new file mode 100644 index 00000000..93c86547 Binary files /dev/null and b/35expandedspells/nw_s0_wallfirea.ncs differ diff --git a/35expandedspells/nw_s0_wallfirea.nss b/35expandedspells/nw_s0_wallfirea.nss new file mode 100644 index 00000000..6fa2385c --- /dev/null +++ b/35expandedspells/nw_s0_wallfirea.nss @@ -0,0 +1,71 @@ +//:://///////////////////////////////////////////// +//:: Wall of Fire: On Enter +//:: NW_S0_WallFireA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Person within the AoE take 4d6 fire damage + per round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); + int CasterLvl = PRCGetCasterLevel(GetAreaOfEffectCreator()); + //Capture the first target object in the shape. + oTarget = GetEnteringObject(); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WALL_OF_FIRE)); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr)) + { + //Roll damage. + nDamage = d6(4) + (CasterLvl/2); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 24 + (CasterLvl/2);//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget,GetAreaOfEffectCreator())), SAVING_THROW_TYPE_FIRE); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, GetLocalInt(OBJECT_SELF, "Wall_Fire_Damage")); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_wallfirec.ncs b/35expandedspells/nw_s0_wallfirec.ncs new file mode 100644 index 00000000..ffac5a5f Binary files /dev/null and b/35expandedspells/nw_s0_wallfirec.ncs differ diff --git a/35expandedspells/nw_s0_wallfirec.nss b/35expandedspells/nw_s0_wallfirec.nss new file mode 100644 index 00000000..339c63df --- /dev/null +++ b/35expandedspells/nw_s0_wallfirec.nss @@ -0,0 +1,98 @@ +//:://///////////////////////////////////////////// +//:: Wall of Fire: Heartbeat +//:: NW_S0_WallFireA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Person within the AoE take 4d6 fire damage + per round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: May 17, 2001 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + //Capture the first target object in the shape. + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // When the caster is no longer there, all functions calling + // GetAreaOfEffectCreator will fail. Its better to remove the barrier then + //-------------------------------------------------------------------------- + if (!GetIsObjectValid(GetAreaOfEffectCreator())) + { + DestroyObject(OBJECT_SELF); + return; + } + + int CasterLvl = PRCGetCasterLevel(GetAreaOfEffectCreator()); + + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator(),CasterLvl); + int EleDmg = GetLocalInt(OBJECT_SELF, "Wall_Fire_Damage"); + + oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Declare the spell shape, size and the location. + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WALL_OF_FIRE)); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr)) + { + //Roll damage. + nDamage = d6(4) + (CasterLvl/2); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 24 + (CasterLvl/2);//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + + int nDC = PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()); + + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (nDC), SAVING_THROW_TYPE_FIRE); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 1.0,FALSE); + } + } + } + //Select the next target within the spell shape. + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_weird.ncs b/35expandedspells/nw_s0_weird.ncs new file mode 100644 index 00000000..2937d38a Binary files /dev/null and b/35expandedspells/nw_s0_weird.ncs differ diff --git a/35expandedspells/nw_s0_weird.nss b/35expandedspells/nw_s0_weird.nss new file mode 100644 index 00000000..766324cf --- /dev/null +++ b/35expandedspells/nw_s0_weird.nss @@ -0,0 +1,156 @@ +//:://///////////////////////////////////////////// +//:: Weird +//:: NW_S0_Weird +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All enemies in LOS of the spell must make 2 saves or die. + Even IF the fortitude save is succesful, they will still take + 3d6 damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: DEc 14 , 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: April 10, 2001 +//:: VFX Pass By: Preston W, On: June 27, 2001 + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget; + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eWeird = EffectVisualEffect(VFX_FNF_WEIRD); + effect eAbyss = EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + + int nCasterLvl =CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + + CasterLvl +=SPGetPenetr(); + + //Apply the FNF VFX impact + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eWeird, PRCGetSpellTargetLocation()); + //Get the first target in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation(), TRUE); + while (GetIsObjectValid(oTarget)) + { + //Make a faction check + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + fDelay = PRCGetRandomDelay(3.0, 4.0); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WEIRD)); + //Make an SR Check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + if ( !GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS,OBJECT_SELF) && + !GetIsImmune(oTarget, IMMUNITY_TYPE_FEAR,OBJECT_SELF)) + { + if(GetHitDice(oTarget) >= 4) + { + int nDC =PRCGetSaveDC(oTarget,OBJECT_SELF); + //Make a Will save against mind-affecting + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (nDC), SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay)) + { + //Make a fortitude save against death + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (nDC), SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay)) + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + return; + + //Roll damage + nDamage = d6(3) + nCasterLvl; + //Make metamagic check + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 18 + nCasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = FloatToInt( IntToFloat(nDamage) * 1.5 ); + } + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + + //Set damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL); + //Apply VFX Impact and damage effect + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + } + else + { + // * I failed BOTH saving throws. Now I die. + + DeathlessFrenzyCheck(oTarget); + + //Apply VFX impact and death effect + //DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + effect eDeath = EffectDeath(); + if(!GetPRCSwitch(PRC_165_DEATH_IMMUNITY)) + eDeath = SupernaturalEffect(eDeath); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); + } + } // Will save + } + else + { + // * I have less than 4HD, I die. + + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(); + if(!GetPRCSwitch(PRC_165_DEATH_IMMUNITY)) + eDeath = SupernaturalEffect(eDeath); + + //Apply VFX impact and death effect + //DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); + } + } + } + } + //Get next target in spell area + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation(), TRUE); + } + + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/nw_s0_wordfaith.ncs b/35expandedspells/nw_s0_wordfaith.ncs new file mode 100644 index 00000000..1228a6cf Binary files /dev/null and b/35expandedspells/nw_s0_wordfaith.ncs differ diff --git a/35expandedspells/nw_s0_wordfaith.nss b/35expandedspells/nw_s0_wordfaith.nss new file mode 100644 index 00000000..ec4c70b7 --- /dev/null +++ b/35expandedspells/nw_s0_wordfaith.nss @@ -0,0 +1,166 @@ +//:://///////////////////////////////////////////// +//:: Word of Faith +//:: [NW_S0_WordFaith.nss] +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + A 30ft blast of divine energy rushs out from the + Cleric blasting all enemies with varying effects + depending on their HD. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Feb 5, 2001 +//::////////////////////////////////////////////// +//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001 +//:: Sep 2002: fixed the 'level 8' instantkill problem +//:: description is slightly inaccurate but I won't change it +//:: Georg: It's nerf time! oh yes. The spell now matches it's description. + + +//:: modified by mr_bumpkin Dec 4, 2003 +#include "prc_inc_spells" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + If you want to make changes to all spells, + check x2_inc_spellhook.nss to find out more + +*/ + + //DeleteLocalInt(OBJECT_SELF, "specific_spellschool_number"); + //SetLocalInt(OBJECT_SELF, "specific_spellschool_number", + + + 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 + object oTarget; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + effect eBlind = EffectBlindness(); + effect eStun = EffectStunned(); + effect eConfuse = PRCEffectConfused(); + effect eDeath = EffectDeath(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eSmite = EffectVisualEffect(VFX_FNF_WORD); + effect eSonic = EffectVisualEffect(VFX_IMP_SONIC); + effect eUnsummon = EffectVisualEffect(VFX_IMP_UNSUMMON); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eKill; + effect eLink; + int nHD; + float fDelay; + int nDuration = CasterLvl / 2; + + int nPenetr = CasterLvl + SPGetPenetr(); + + //Apply the FNF VFX impact to the target location + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eSmite, PRCGetSpellTargetLocation()); + //Get the first target in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + //Make a faction check + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + fDelay = PRCGetRandomDelay(0.5, 2.0); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WORD_OF_FAITH)); + //Make SR check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr, fDelay)) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eSonic, oTarget); + //---------------------------------------------------------- + //Check if the target is an outsider + //GZ: And do nothing anymore. This was not supposed to happen + //---------------------------------------------------------- + /*if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_OUTSIDER || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_ELEMENTAL) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eUnsummon, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); + }*/ + + ///---------------------------------------------------------- + // And this is the part where the divine power smashes the + // unholy summoned creature and makes it return to its homeplane + //---------------------------------------------------------- + if (GetIsObjectValid(GetMaster(oTarget))) + { + if (GetAssociateType(oTarget) == ASSOCIATE_TYPE_SUMMONED) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eUnsummon, oTarget)); + if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); + } + else + { + eKill = PRCEffectDamage(oTarget, GetCurrentHitPoints(oTarget)+10); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eKill, oTarget)); + } + } + } + else + { + //Check the HD of the creature + nHD = GetHitDice(oTarget); + //Apply the appropriate effects based on HD + if (nHD >= 40) + { + eLink = EffectLinkEffects(eStun, eDur); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBlind, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); + } + else if (nHD >= 30 && nHD < 40) + { + eLink = EffectLinkEffects(eStun, eMind); + eLink = EffectLinkEffects(eLink, eDur); + eLink = EffectLinkEffects(eLink, eBlind); + + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); + } + else if (nHD > 20 && nHD < 30) + { + eLink = EffectLinkEffects(eStun, eMind); + eLink = EffectLinkEffects(eLink, eDur); + eLink = EffectLinkEffects(eLink, eConfuse); + eLink = EffectLinkEffects(eLink, eBlind); + + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl)); + } + else + { + DeathlessFrenzyCheck(oTarget); + + if(!GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget)); + } + } + } + } + //Get the next target in the spell area + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, PRCGetSpellTargetLocation()); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/sp_aberrate.ncs b/35expandedspells/sp_aberrate.ncs new file mode 100644 index 00000000..68ef00b0 Binary files /dev/null and b/35expandedspells/sp_aberrate.ncs differ diff --git a/35expandedspells/sp_aberrate.nss b/35expandedspells/sp_aberrate.nss new file mode 100644 index 00000000..0bfdd68e --- /dev/null +++ b/35expandedspells/sp_aberrate.nss @@ -0,0 +1,141 @@ +//:://///////////////////////////////////////////// +//:: Name Aberrate +//:: FileName sp_aberrate.nss +//::////////////////////////////////////////////// +/**@file Aberrate +Transmutation [Evil] +Level: Sor/Wiz 1 +Components: V, S, Fiend +Casting Time: 1 action +Range: Touch +Target: One living creature +Duration: 10 minutes/level +Saving Throw: Fortitude negates +Spell Resistance: Yes + +The caster transforms one creature into an aberration. +The subject's form twists and mutates into a hideous +mockery of itself. The subject's type changes to +aberration, and it gains a +1 natural armor bonus to +AC (due to the toughening and twisting of the flesh) +for every four levels the caster has, up to a maximum +of +5. + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" + +int DoSpell(object oCaster, object oTarget, int nCasterLvl, int nEvent) +{ + object oSkin = GetPCSkin(oTarget); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDC = PRCGetSaveDC(oTarget, oCaster); + float fDur = (600.0f * nCasterLvl); + if(nMetaMagic & METAMAGIC_EXTEND) + fDur = fDur * 2; + int bFriendly = TRUE; + if(oCaster == oTarget) bFriendly = FALSE; + + //Signal spell firing + PRCSignalSpellEvent(oTarget, bFriendly, SPELL_ABERRATE, oCaster); + + //if friendly + if(GetIsReactionTypeFriendly(oTarget, oCaster) || + //or failed SR check + (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl + SPGetPenetr())) && PRCGetIsAliveCreature(oTarget)) + { + //if friendly + if(GetIsReactionTypeFriendly(oTarget, oCaster) || + //or failed save + (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL))) + { + int nBonus = 1; + + if(nCasterLvl > 7) nBonus = 2; + + if(nCasterLvl > 11) nBonus = 3; + + if(nCasterLvl > 15) nBonus = 4; + + if(nCasterLvl > 19) nBonus = 5; + //alteracao rafael 1/6/2021 adicionado progressao da magia ate nivel 79 de caster + if(nCasterLvl > 23) nBonus = 6; + + if(nCasterLvl > 27) nBonus = 7; + + if(nCasterLvl > 31) nBonus = 8; + + if(nCasterLvl > 35) nBonus = 9; + + if(nCasterLvl > 39) nBonus = 10; + + if(nCasterLvl > 43) nBonus = 11; + + if(nCasterLvl > 47) nBonus = 12; + + if(nCasterLvl > 51) nBonus = 13; + + if(nCasterLvl > 55) nBonus = 14; + + if(nCasterLvl > 59) nBonus = 15; + + if(nCasterLvl > 63) nBonus = 16; + + if(nCasterLvl > 67) nBonus = 17; + + if(nCasterLvl > 71) nBonus = 18; + + if(nCasterLvl > 75) nBonus = 19; + + if(nCasterLvl > 79) nBonus = 20; + + if(nCasterLvl > 83) nBonus = 21; + + itemproperty ipRace = PRCItemPropertyBonusFeat(FEAT_ABERRATION); + effect eArmor = EffectACIncrease(nBonus, AC_NATURAL_BONUS); + effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + AddItemProperty(DURATION_TYPE_TEMPORARY, ipRace, oSkin, fDur); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eArmor, oTarget, fDur, TRUE, SPELL_ABERRATE, nCasterLvl, oCaster); + } + } + //SPEvilShift(oCaster); + + return TRUE;// return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { + //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_acidstorm.ncs b/35expandedspells/sp_acidstorm.ncs new file mode 100644 index 00000000..bc05032e Binary files /dev/null and b/35expandedspells/sp_acidstorm.ncs differ diff --git a/35expandedspells/sp_acidstorm.nss b/35expandedspells/sp_acidstorm.nss new file mode 100644 index 00000000..faa04e9c --- /dev/null +++ b/35expandedspells/sp_acidstorm.nss @@ -0,0 +1,24 @@ + +#include "spinc_burst" +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDice = nCasterLvl; + if (nDice > 40) nDice = 40; + + // Acid storm is a huge burst doing 1d6 / lvl acid damage (15 cap) + DoBurst (nCasterLvl,6, 0, nDice, + VFX_FNF_ACIDSTORM, VFX_IMP_ACID_S, + RADIUS_SIZE_HUGE, DAMAGE_TYPE_ACID, DAMAGE_TYPE_ACID, SAVING_THROW_TYPE_ACID, + FALSE, SPELL_SCHOOL_EVOCATION, GetSpellId()); + + // Add some extra sfx. + //PlaySound("sco_swar3blue"); +} diff --git a/35expandedspells/sp_agnazscorch.ncs b/35expandedspells/sp_agnazscorch.ncs new file mode 100644 index 00000000..406e166c Binary files /dev/null and b/35expandedspells/sp_agnazscorch.ncs differ diff --git a/35expandedspells/sp_agnazscorch.nss b/35expandedspells/sp_agnazscorch.nss new file mode 100644 index 00000000..ce35a643 --- /dev/null +++ b/35expandedspells/sp_agnazscorch.nss @@ -0,0 +1,17 @@ +#include "prc_inc_spells" +#include "spinc_bolt" +#include "prc_add_spell_dc" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int nDice = (nCasterLevel + 1) / 2; + if (nDice > 20) nDice = 20; + + DoBolt (nCasterLevel,8, 0, nDice, VFX_BEAM_FIRE_LASH, VFX_IMP_FLAME_S, + DAMAGE_TYPE_FIRE, SAVING_THROW_TYPE_FIRE); +} diff --git a/35expandedspells/sp_apoc_sky.ncs b/35expandedspells/sp_apoc_sky.ncs new file mode 100644 index 00000000..b49961b3 Binary files /dev/null and b/35expandedspells/sp_apoc_sky.ncs differ diff --git a/35expandedspells/sp_apoc_sky.nss b/35expandedspells/sp_apoc_sky.nss new file mode 100644 index 00000000..f019711c --- /dev/null +++ b/35expandedspells/sp_apoc_sky.nss @@ -0,0 +1,117 @@ +//:://///////////////////////////////////////////// +//:: Name Apocalypse from the Sky +//:: FileName sp_apoc_sky.nss +//::////////////////////////////////////////////// +/**@file Apocalypse from the Sky +Conjuration (Creation) [Evil] +Level: Corrupt 9 +Components: V, S, M, Corrupt +Casting Time: 1 day +Range: Personal +Area: 10-mile radius/level, centered on caster +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +The caster calls upon the darkest forces in all +existence to rain destruction down upon the land. +All creatures and objects in the spell's area take +10d6 points of fire, acid, or sonic damage +(caster's choice). This damage typically levels +forests, sends mountains tumbling, and wipes out +entire populations of living creatures. The caster +is subject to the damage as well as the corruption +cost. + +Material Component: An artifact, usually one of good +perverted to this corrupt use. + +Corruption Cost: 3d6 points of Constitution damage +and 4d6 points of Wisdom drain. Just preparing this +spell deals 1d3 points of wisdom damage, with another +1d3 points of Wisdom damage for each day it remains +among the caster's prepared spells. + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_alterations" +#include "prc_inc_spells" +#include "prc_spell_const" +#include "prc_add_spell_dc" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + //define vars + object oPC = OBJECT_SELF; + object oArea = GetArea(oPC); + int nDam; + int nDamType; + int nSpell = GetSpellId(); + effect eVis; + int nCasterLevel = PRCGetCasterLevel(oPC); + //Handle damage types + if(nSpell == SPELL_APOCALYPSE_FROM_THE_SKY_FIRE) + { + nDamType = DAMAGE_TYPE_FIRE; + eVis = EffectVisualEffect(VFX_FNF_METEOR_SWARM); + } + + if(nSpell == SPELL_APOCALYPSE_FROM_THE_SKY_ACID) + { + nDamType = DAMAGE_TYPE_ACID; + eVis = EffectVisualEffect(VFX_FNF_STORM); + } + + if(nSpell == SPELL_APOCALYPSE_FROM_THE_SKY_SONIC) + { + nDamType = DAMAGE_TYPE_SONIC; + eVis = EffectVisualEffect(VFX_FNF_SOUND_BURST); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + object oObject = GetFirstObjectInArea(oArea); + + //Loop + while(GetIsObjectValid(oObject)) + { + nDam = d6(nCasterLevel); + + //if extra damage switch set, ndam=d4(40) + if(GetPRCSwitch("PRC_AFTS_EXTRA_DAMAGE")) + { + nDam = d8(nCasterLevel); + } + + effect eDam = PRCEffectDamage(oObject, nDam, nDamType); + + //Apply + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oObject); + + oObject = GetNextObjectInArea(); + } + + //SPEvilShift(oPC); + + //Corruption cost + int nDam1 = d6(3); + int nDam2 = d6(4); + + DoCorruptionCost(oPC, ABILITY_CONSTITUTION, nDam1, 0); + DoCorruptionCost(oPC, ABILITY_WISDOM, nDam2, 1); + + //Corrupt spells get mandatory 10 pt evil adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_EVIL, 10, FALSE); + + PRCSetSchool(); +} + diff --git a/35expandedspells/sp_armordark.ncs b/35expandedspells/sp_armordark.ncs new file mode 100644 index 00000000..ae81bb4b Binary files /dev/null and b/35expandedspells/sp_armordark.ncs differ diff --git a/35expandedspells/sp_armordark.nss b/35expandedspells/sp_armordark.nss new file mode 100644 index 00000000..68d438fe --- /dev/null +++ b/35expandedspells/sp_armordark.nss @@ -0,0 +1,80 @@ +/* + sp_armordark + + lvl 4 + +3 bonus to ac plus additional +1 per every 4 lvl of caster to max of +8 . + Gives Darkvision , +2 save against holy , light , or good spells. + + By: ??? + Created: ??? + Modified: Jul 1, 2006 +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nCasterLvl = nCasterLevel; + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDuration = PRCGetMetaMagicDuration(TenMinutesToSeconds(nCasterLvl)); + + int iAC = 3 + nCasterLvl/4; + if (iAC >25) iAC = 25; + + effect eAC=EffectACIncrease(iAC,AC_DEFLECTION_BONUS); + effect eUltravision = EffectUltravision(); + effect eSaveG=EffectSavingThrowIncrease(2,SAVING_THROW_ALL,SAVING_THROW_TYPE_GOOD); + effect eSaveD=EffectSavingThrowIncrease(2,SAVING_THROW_ALL,SAVING_THROW_TYPE_DIVINE); + + effect eLinks=EffectLinkEffects(eAC,eUltravision); + eLinks=EffectLinkEffects(eLinks,eSaveG); + eLinks=EffectLinkEffects(eLinks,eSaveD); + + object oTarget=PRCGetSpellTargetObject(); + + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget, FALSE); + + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + effect eTurn=EffectTurnResistanceIncrease(4); + eLinks=EffectLinkEffects(eLinks,eTurn); + } + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinks, oTarget, fDuration,TRUE,-1,nCasterLevel); + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_ayailla_rb.ncs b/35expandedspells/sp_ayailla_rb.ncs new file mode 100644 index 00000000..82a814f0 Binary files /dev/null and b/35expandedspells/sp_ayailla_rb.ncs differ diff --git a/35expandedspells/sp_ayailla_rb.nss b/35expandedspells/sp_ayailla_rb.nss new file mode 100644 index 00000000..e33383cb --- /dev/null +++ b/35expandedspells/sp_ayailla_rb.nss @@ -0,0 +1,107 @@ +//:://///////////////////////////////////////////// +//:: Name Ayailla's Radiant Burst +//:: FileName sp_ayaiila_rb.nss +//::////////////////////////////////////////////// +/**@file Ayailla's Radiant Burst +Evocation [Good] +Level: Sanctified 2 +Components: V, S, Sacrifice +Casting Time: 1 standard action +Range: 60 ft. +Area: Cone-shaped burst +Duration: Instantaneous +Saving Throw: Fortitude negates (blindness) and +Reflex half (shards) +Spell Resistance: Yes + +Shards of heavenly light spray from your fingertips, +blinding evil creatures in their path for 1 round. +A successful Fortitude save negates the blindness. +The luminous shards also sear the flesh of evil +creatures, dealing 1d6 points of damage per two +caster levels (maximum 5d6). A successful Reflex +save halves the damage, which is of divine origin. + +Sacrifice: 1d2 points of Strength damage. + +Author: Tenjac +Created: 6/1/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC; + int nDam; + int nMetaMagic = PRCGetMetaMagicFeat(); + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 18.28f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + float fDur = 6.0f; + + //Metamagic extend + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur = fDur * 2; + } + + while(GetIsObjectValid(oTarget)) + { + //make sure it's not the PC + if(oTarget != oPC) + { + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr()) && GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + nDC = PRCGetSaveDC(oTarget, oPC); + + if(PRCGetIsAliveCreature(oTarget)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), oTarget, fDur); + } + } + + //evil take damage, separate saving throw + nDam = d6(min(5, nCasterLvl/2)); + + //maximize + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(20, nCasterLvl/2)); + } + + //empower + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC)) nDam = (nDam/2); + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_DIVINE), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 18.28f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + //Bwahah... yes, it's secretly Corruption cost and not Sacrifice :P + DoCorruptionCost(oPC, ABILITY_STRENGTH, d2(), 0); + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_bigby_sf.ncs b/35expandedspells/sp_bigby_sf.ncs new file mode 100644 index 00000000..62f82c6d Binary files /dev/null and b/35expandedspells/sp_bigby_sf.ncs differ diff --git a/35expandedspells/sp_bigby_sf.nss b/35expandedspells/sp_bigby_sf.nss new file mode 100644 index 00000000..fe3314d7 --- /dev/null +++ b/35expandedspells/sp_bigby_sf.nss @@ -0,0 +1,199 @@ +//:://///////////////////////////////////////////// +//:: Name Bigby's Striking Fist +//:: FileName sp_bigby_sf.nss +//::////////////////////////////////////////////// +/**@file Bigby's Striking Fist +Evocation [Force] +Level: Duskblade 2, sorcerer/wizard 2 +Components: V,S,M +Casting Time: 1 standard action +Range: Medium +Target: One creature +Duration: Instantaneous +Saving Throw: Reflex partial +Spell Resistance: Yes + +The attack bonus of this striking fist equals your +caster level + your key ability modifier + 2 for the +hand's Strength score (14). The fist deals 1d6 points +of nonlethal damage per two caster levels (maximum 5d6) +and attempts a bull rush. The fist has a bonus of +4 +plus +1 per two caster levels on the bull rush attempt, +and if successful it knocks the subject back in a +direction of your choice. This movement does not +provoke attacks of opportunity. A subject that +succeeds on its Reflex save takes half damage and is +not subject to the bull rush attempt. + +Material Components: Three glass beads. +**/ +/////////////////////////////////////////////////////// +// Author: Tenjac +// Date: 27.9.06 +/////////////////////////////////////////////////////// + +int DoBullRushAttack(object oTarget, int nAttackBonus, int nCasterLevel); +void DoPush(object oTarget, object oCreator, int nReverse = FALSE); +int EvalSizeBonus(object oSubject); + +#include "prc_inc_combat" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCasterLevel = PRCGetCasterLevel(oPC); + int nDisplayFeedback; + + int nClassType = PRCGetLastSpellCastClass(); + + int nAbilityScore = GetAbilityScoreForClass(nClassType, oPC); + int nAttackBonus = (2 + nCasterLevel + (nAbilityScore - 10)/2); + + int iAttackRoll = GetAttackRoll(oTarget, OBJECT_INVALID, OBJECT_INVALID, 0, nAttackBonus,0,nDisplayFeedback, 0.0, TOUCH_ATTACK_MELEE_SPELL); + + if (iAttackRoll > 0) + { + int nDam = d6(min(20, (nCasterLevel/2))); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(20, (nCasterLevel/2))); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //save + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget, oPC), SAVING_THROW_TYPE_SPELL)) + { + //Bull Rush + if(DoBullRushAttack(oTarget, nAttackBonus, nCasterLevel)) + { + DoPush(oTarget, oPC); + } + } + + else + { + nDam = (nDam / 2); + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + } + PRCSetSchool(); +} + + +int DoBullRushAttack(object oTarget, int nAttackBonus, int nCasterLevel) +{ + int nSuccess = 0; + int nSizeBonus = EvalSizeBonus(oTarget); + int nBullRushFist = 14 + (4 + (nCasterLevel/2)); + int nBullRushOpposed = GetAbilityScore(oTarget, ABILITY_STRENGTH) + nSizeBonus; + + if(nBullRushFist > nBullRushOpposed) + { + nSuccess = 1; + } + return nSuccess; +} + +void DoPush(object oTarget, object oCreator, int nReverse = FALSE) +{ + // Calculate how far the creature gets pushed + float fDistance = FeetToMeters(10.0f); + // Determine if they hit a wall on the way + location lCreator = GetLocation(oCreator); + location lTargetOrigin = GetLocation(oTarget); + vector vAngle = AngleToVector(GetRelativeAngleBetweenLocations(lCreator, lTargetOrigin)); + vector vTargetOrigin = GetPosition(oTarget); + vector vTarget = vTargetOrigin + (vAngle * fDistance); + + if(!LineOfSightVector(vTargetOrigin, vTarget)) + { + // Hit a wall, binary search for the wall + float fEpsilon = 1.0f; // Search precision + float fLowerBound = 0.0f; // The lower search bound, initialise to 0 + float fUpperBound = fDistance; // The upper search bound, initialise to the initial distance + fDistance = fDistance / 2; // The search position, set to middle of the range + + do{ + // Create test vector for this iteration + vTarget = vTargetOrigin + (vAngle * fDistance); + + // Determine which bound to move. + if(LineOfSightVector(vTargetOrigin, vTarget)) + fLowerBound = fDistance; + else + fUpperBound = fDistance; + + // Get the new middle point + fDistance = (fUpperBound + fLowerBound) / 2; + }while(fabs(fUpperBound - fLowerBound) > fEpsilon); + } + + // Create the final target vector + vTarget = vTargetOrigin + (vAngle * fDistance); + + // Move the target + location lTargetDestination = Location(GetArea(oTarget), vTarget, GetFacing(oTarget)); + AssignCommand(oTarget, ClearAllActions(TRUE)); + AssignCommand(oTarget, JumpToLocation(lTargetDestination)); +} + +int EvalSizeBonus(object oSubject) +{ + int nSize = PRCGetCreatureSize(oSubject); + int nBonus; + + //Eval size + + if(nSize == CREATURE_SIZE_LARGE) + { + nBonus = 4; + } + else if(nSize == CREATURE_SIZE_HUGE) + { + nBonus = 8; + } + else if(nSize == CREATURE_SIZE_GARGANTUAN) + { + nBonus = 12; + } + else if(nSize == CREATURE_SIZE_COLOSSAL) + { + nBonus = 16; + } + else if(nSize == CREATURE_SIZE_SMALL) + { + nBonus = -4; + } + else if(nSize == CREATURE_SIZE_TINY) + { + nBonus = -8; + } + else if(nSize == CREATURE_SIZE_DIMINUTIVE) + { + nBonus = -12; + } + else if (nSize == CREATURE_SIZE_FINE) + { + nBonus = -16; + } + else + { + nBonus = 0; + } + + return nBonus; +} + diff --git a/35expandedspells/sp_bigby_trip.ncs b/35expandedspells/sp_bigby_trip.ncs new file mode 100644 index 00000000..67c60fed Binary files /dev/null and b/35expandedspells/sp_bigby_trip.ncs differ diff --git a/35expandedspells/sp_bigby_trip.nss b/35expandedspells/sp_bigby_trip.nss new file mode 100644 index 00000000..186a70ea --- /dev/null +++ b/35expandedspells/sp_bigby_trip.nss @@ -0,0 +1,128 @@ +//:://///////////////////////////////////////////// +//:: Name Bibgy's Tripping Hand +//:: FileName sp_bigby_trip.nss +//::////////////////////////////////////////////// +/**@file Bigby's Tripping Hand +Evocation[Force] +Level: Duskblade 1, sorcerer/wizard 1 +Components: V,S,M +Casting Time: 1 standard action +Range: Medium +Target: One creature +Duration: Intantaneous +Saving Throw: Reflex negates +Spell Resistance: Yes + +The large hand sweeps at the target creature's legs in +a tripping maneuver. This trip attempt does not provoke +attacks of opportunity. Its attack bonus equals your +caster level + your key ability modifier + 2 for the +hand's Strength score (14). The hand has a bonus of +1 +on the trip attempt for every three caster levels, to a +maximum of +5 at 15th level. + +Material component: Three glass beads +**/ + +int EvalSizeBonus(object oSubject); + +#include "prc_inc_combat" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nClassType = PRCGetLastSpellCastClass(); + int nDisplayFeedback; + + // Let the AI know + PRCSignalSpellEvent(oTarget, TRUE, SPELL_BIGBYS_TRIPPING_HAND, oPC); + + /*If your attack succeeds, make a Strength check opposed by the + defender’s Dexterity or Strength check (whichever ability score + has the higher modifier). A combatant gets a +4 bonus for every + size category he is larger than Medium or a -4 penalty for every + size category he is smaller than Medium. The defender gets a +4 + bonus on his check if he has more than two legs or is otherwise + more stable than a normal humanoid. If you win, you trip the + defender. + */ + int nAbilityScore = GetAbilityScoreForClass(nClassType, oPC); + + int nAttackBonus = (2 + nCasterLvl + (nAbilityScore - 10)/2 ); + int nTripBonus = min(20,(nCasterLvl/3)); + + int iAttackRoll = GetAttackRoll(oTarget, OBJECT_INVALID, OBJECT_INVALID, 0, nAttackBonus,0,nDisplayFeedback, 0.0, TOUCH_ATTACK_MELEE_SPELL); + if (iAttackRoll > 0) + { + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //save + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget, oPC), SAVING_THROW_TYPE_SPELL)) + { + int nOpposing = d20() + (max(GetAbilityModifier(ABILITY_STRENGTH, oTarget), GetAbilityModifier(ABILITY_DEXTERITY, oTarget))) + EvalSizeBonus(oTarget); + int nCheck = d20() + 2 + nTripBonus; + + if(nCheck > nOpposing) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oTarget, 6.0f); + } + } + } + } + PRCSetSchool(); +} + +int EvalSizeBonus(object oSubject) +{ + int nSize = PRCGetCreatureSize(oSubject); + int nBonus; + + //Eval size + + if(nSize == CREATURE_SIZE_LARGE) + { + nBonus = 4; + } + else if(nSize == CREATURE_SIZE_HUGE) + { + nBonus = 8; + } + else if(nSize == CREATURE_SIZE_GARGANTUAN) + { + nBonus = 12; + } + else if(nSize == CREATURE_SIZE_COLOSSAL) + { + nBonus = 16; + } + else if(nSize == CREATURE_SIZE_SMALL) + { + nBonus = -4; + } + else if(nSize == CREATURE_SIZE_TINY) + { + nBonus = -8; + } + else if(nSize == CREATURE_SIZE_DIMINUTIVE) + { + nBonus = -12; + } + else if (nSize == CREATURE_SIZE_FINE) + { + nBonus = -16; + } + else + { + nBonus = 0; + } + + return nBonus; +} diff --git a/35expandedspells/sp_blastfrc.ncs b/35expandedspells/sp_blastfrc.ncs new file mode 100644 index 00000000..9877013b Binary files /dev/null and b/35expandedspells/sp_blastfrc.ncs differ diff --git a/35expandedspells/sp_blastfrc.nss b/35expandedspells/sp_blastfrc.nss new file mode 100644 index 00000000..fbe0452e --- /dev/null +++ b/35expandedspells/sp_blastfrc.nss @@ -0,0 +1,109 @@ +//:: Name Blast of Force +//:: FileName sp_blastfrc.nss +//::////////////////////////////////////////////// +/** @file +Evocation [Force] +Level: Sorcerer 2, Wizard 2, Force 3, +Components: V, S,\line Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Effect: Ray +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: Yes + +Drawing upon magic in its purest form, you send invisible energy whistling through the air to batter your foe. +You must succeed on a ranged touch attack with the ray to strike a target. A blast of force deals 1d6 points +of damage per two caster levels (maximum 5d6). In addition, a successful hit forces the subject to make a +Fortitude save or be knocked prone (size and stability modifiers apply to the saving throw as if the spell +were a bull rush). +*/ +//::////////////////////////////////////////////// +//:: Created By: Tenjac +//:: Created On: 1/20/21//:: +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" +#include "prc_inc_combmove" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary + +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + // Applying Bull Rush bonuses to defender + nSaveDC -= GetCombatMoveCheckBonus(oTarget, COMBAT_MOVE_BULLRUSH, TRUE); + int nPenetr = nCasterLevel + SPGetPenetr(); + PRCSignalSpellEvent(oTarget, TRUE, SPELL_BLASTOFFORCE, oCaster); + + //Make touch attack + int iAttackRoll = PRCDoRangedTouchAttack(oTarget); + //No VFX + if (iAttackRoll) + { + if (!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + int nDice= min(nCasterLevel/2, 20); + int nDam = d6(nDice); + if(nMetaMagic & METAMAGIC_MAXIMIZE) nDam = 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) nDam += (nDam/2); + + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_SPELL)) + { + nDam /= 2; + if(GetHasMettle(oTarget, SAVING_THROW_FORT)) + nDam = 0; + } + else + { + effect eKnock = EffectKnockdown(); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnock, oTarget, 3.0); + } + + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DESTRUCTION), oTarget); + } + } + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { + //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + + if (oCaster != oTarget)//cant target self with this spell, only when holding charge + { + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); + } +} \ No newline at end of file diff --git a/35expandedspells/sp_blessbahamut.ncs b/35expandedspells/sp_blessbahamut.ncs new file mode 100644 index 00000000..98418d4c Binary files /dev/null and b/35expandedspells/sp_blessbahamut.ncs differ diff --git a/35expandedspells/sp_blessbahamut.nss b/35expandedspells/sp_blessbahamut.nss new file mode 100644 index 00000000..1c2cd9cf --- /dev/null +++ b/35expandedspells/sp_blessbahamut.nss @@ -0,0 +1,36 @@ +#include "prc_inc_spells" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + // Declare major variables + object oTarget = PRCGetSpellTargetObject(); + + // Signal the spell cast at event + PRCSignalSpellEvent(oTarget, FALSE); + + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + + // DR 10/-. + effect eStone = EffectDamageReduction(10+ (nCasterLevel/2), DAMAGE_POWER_ENERGY); + eStone = EffectLinkEffects(eStone, EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR)); + + // Get duration, 1 round / level unless extended. + float fDuration = PRCGetMetaMagicDuration(RoundsToSeconds(nCasterLevel)); + + // Build the list of fancy visual effects to apply when the spell goes off. + effect eVFX = EffectVisualEffect(VFX_IMP_DEATH_WARD); + + // Remove existing effect, if any. + PRCRemoveEffectsFromSpell(oTarget, GetSpellId()); + + // Apply effects and VFX to target + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStone, oTarget, fDuration,TRUE,-1,nCasterLevel); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget); + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_blsflm.ncs b/35expandedspells/sp_blsflm.ncs new file mode 100644 index 00000000..d6c09634 Binary files /dev/null and b/35expandedspells/sp_blsflm.ncs differ diff --git a/35expandedspells/sp_blsflm.nss b/35expandedspells/sp_blsflm.nss new file mode 100644 index 00000000..c4d1e29a --- /dev/null +++ b/35expandedspells/sp_blsflm.nss @@ -0,0 +1,17 @@ +///////////////////////////////////////////////////////////////////// +// +// Blast of Flame - Cone of fire damage 1d6 / level, cap 10. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_cone" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + DoCone (6, 0, 40, -1, VFX_IMP_FLAME_S, + DAMAGE_TYPE_FIRE, SAVING_THROW_TYPE_FIRE); +} diff --git a/35expandedspells/sp_bolt_glory.ncs b/35expandedspells/sp_bolt_glory.ncs new file mode 100644 index 00000000..82ad9db6 Binary files /dev/null and b/35expandedspells/sp_bolt_glory.ncs differ diff --git a/35expandedspells/sp_bolt_glory.nss b/35expandedspells/sp_bolt_glory.nss new file mode 100644 index 00000000..bda34d41 --- /dev/null +++ b/35expandedspells/sp_bolt_glory.nss @@ -0,0 +1,108 @@ +//:://///////////////////////////////////////////// +//:: Name Bolt of Glory +//:: FileName sp_bolt_glory +//::////////////////////////////////////////////// +/**@file Bolt of Glory +Evocation [Good] +Level: Exalted arcanist 6, Glory 6 +Components: V, S, DF +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./level) +Effect: Ray +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +By casting this spell, you project a bolt of +energy from the Positive Energy Plane against one +creature. You must succeed on a ranged touch +attack to strike your target. A creature struck +takes varying damage, depending on its nature, +home plane of existence and your level: + +Creature's Origin Damage + +Material Plane, +Elemental, +neutral outsider 1d6/2 levels (7d6 maximum) + +Positive Energy Plane, +good outsider none + +Evil outsider, +undead creature, +Negative Energy Plane 1d6/level (15d6 maximum) + + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nTouch = PRCDoRangedTouchAttack(oTarget); + int nCasterLevel = PRCGetCasterLevel(oPC); + int nRace = MyPRCGetRacialType(oTarget); + int nAlign = GetAlignmentGoodEvil(oTarget); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam; + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_BOLT_OF_GLORY, oPC); + + //Beam VFX. Ornedan is my hero. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_HOLY, oPC, BODY_NODE_HAND, !nTouch), oTarget, 1.0f); + + //Crits automatic? + if(nTouch) + { + //SR + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLevel + SPGetPenetr())) + { + if((nRace == RACIAL_TYPE_UNDEAD) || (nRace == RACIAL_TYPE_OUTSIDER && nAlign == ALIGNMENT_EVIL)) + { + nDam = d6(min(nCasterLevel, 40)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * min(nCasterLevel, 40); + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + } + + if((nRace == RACIAL_TYPE_ELEMENTAL) || + //neutral outsider + (nRace == RACIAL_TYPE_OUTSIDER && nAlign == ALIGNMENT_NEUTRAL) || + //Material native and living + (nRace != RACIAL_TYPE_OUTSIDER && nRace != RACIAL_TYPE_UNDEAD && nRace != RACIAL_TYPE_CONSTRUCT)) + { + nDam = d6(min(nCasterLevel/2, 30)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * min(nCasterLevel/2, 30); + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_DIVINE), oTarget); + } + } + //SPGoodShift(oPC); + PRCSetSchool(); +} diff --git a/35expandedspells/sp_celest_bld.ncs b/35expandedspells/sp_celest_bld.ncs new file mode 100644 index 00000000..a473e729 Binary files /dev/null and b/35expandedspells/sp_celest_bld.ncs differ diff --git a/35expandedspells/sp_celest_bld.nss b/35expandedspells/sp_celest_bld.nss new file mode 100644 index 00000000..bab32552 --- /dev/null +++ b/35expandedspells/sp_celest_bld.nss @@ -0,0 +1,89 @@ +//:://///////////////////////////////////////////// +//:: Name Celestial blood +//:: FileName sp_celest_bld.nss +//::////////////////////////////////////////////// +/**@file Celestial Blood +Abjuration [Good] +Level: Apostle of peace 6, Clr 6, Pleasure 6 +Components: V, S, M +Casting Time: 1 round +Range: Touch +Target: Non-evil creature touched +Duration: 1 minute/level +Saving Throw: None +Spell Resistance: Yes (harmless) + +You channel holy power to grant the subject some of +the protection enjoyed by celestial creatures. The +subject gains resistance 10 to acid, cold, and +electricity, a +4 bonus on saving throws against +poison, and damage reduction 10/evil. + +Material Component: A vial of holy water, with +which you anoint the subject's head. + +Author: Tenjac +Created: 6/16/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_sp_func" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDur = TurnsToSeconds(nCasterLevel); + if(nMetaMagic & METAMAGIC_EXTEND) + fDur *= 2; + + if(GetAlignmentGoodEvil(oTarget) != ALIGNMENT_EVIL) + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_CELESTIAL_BLOOD, FALSE)); + + effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); + + effect eLink = EffectDamageResistance(DAMAGE_TYPE_ACID, 10, 0); + eLink = EffectLinkEffects(eLink, EffectDamageResistance(DAMAGE_TYPE_COLD, 10+(nCasterLevel/2), 0)); + eLink = EffectLinkEffects(eLink, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 10+(nCasterLevel/2), 0)); + eLink = EffectLinkEffects(eLink, EffectSavingThrowIncrease(SAVING_THROW_ALL, 4, SAVING_THROW_TYPE_POISON)); + eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + + //Can't do DR 10/evil + eLink = EffectLinkEffects(eLink, EffectDamageReduction(10+(nCasterLevel/2), DAMAGE_POWER_PLUS_TWO)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur, TRUE, SPELL_CELESTIAL_BLOOD, nCasterLevel, oCaster); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + //SPGoodShift(oCaster); + + return TRUE; +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_chaavs_lgh.ncs b/35expandedspells/sp_chaavs_lgh.ncs new file mode 100644 index 00000000..08834831 Binary files /dev/null and b/35expandedspells/sp_chaavs_lgh.ncs differ diff --git a/35expandedspells/sp_chaavs_lgh.nss b/35expandedspells/sp_chaavs_lgh.nss new file mode 100644 index 00000000..2e69bed8 --- /dev/null +++ b/35expandedspells/sp_chaavs_lgh.nss @@ -0,0 +1,111 @@ +//:://///////////////////////////////////////////// +//:: Name Chaav's Laugh +//:: FileName sp_chaavs_lgh.nss +//::////////////////////////////////////////////// +/**@file Chaav's Laugh +Enchantment (Compulsion)[Good, Mind-Affecting] +Level: Cleric 5, Joy 5 +Components: V +Casting Time: 1 standard action +Range: 40ft +Area: 40-ft-radius spread centered on you +Duration: 1 minute/level +Saving Throw: Will negates +Spell Resistance: Yes + +You release a joyous, boistrous laugh that +strengthens the resolve of good creatures and +weakens the resolve of evil creatures. + +Good creatures within the spell's area gain the +following benefits for the duration of the spell: +a +2 morale bonus on attack rolls an saves against +fear effects. plus temporary hit points equal to +1d8 + caster level(to a maximum of 1d8 +20 at level +20). + +Evil creatures within the spell's are that fail a +Will save take a -2 morale penalty on attack rolls +and saves against fear effects for the duration of +the spell. + +Creatures must beable to hear the laugh to be +affected by the spell. Creatures that are neither +good nor evil are anaffected by Chaav's Laugh. + +Author: Tenjac +Created: 7/10/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); + + object oPC = OBJECT_SELF; + location lLoc = GetLocation(oPC); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC; + int nAlign; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nModify = 2; + float fDur = (60.0f * nCasterLvl); + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nModify = 3; + } + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + effect eVilLink = EffectLinkEffects(EffectAttackDecrease(nModify, ATTACK_BONUS_MISC), EffectSavingThrowDecrease(SAVING_THROW_ALL, nModify, SAVING_THROW_TYPE_FEAR)); + effect eGoodLink = EffectLinkEffects(EffectAttackIncrease(nModify, ATTACK_BONUS_MISC), EffectSavingThrowIncrease(SAVING_THROW_ALL, nModify, SAVING_THROW_TYPE_FEAR)); + eGoodLink = EffectLinkEffects(eGoodLink, EffectTemporaryHitpoints(d8(1) + min(40, nCasterLvl))); + + while(GetIsObjectValid(oTarget)) + { + nAlign = GetAlignmentGoodEvil(oTarget); + nDC = PRCGetSaveDC(oTarget, oPC); + + if(!PRCGetHasEffect(EFFECT_TYPE_DEAF, oTarget)) + { + + if (nAlign == ALIGNMENT_EVIL) + { + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVilLink, oTarget, fDur); + } + } + } + + if(nAlign == ALIGNMENT_GOOD) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGoodLink, oTarget, fDur); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + //SPGoodShift(oPC); + PRCSetSchool(); +} + + + + + + \ No newline at end of file diff --git a/35expandedspells/sp_chan_pyrob.ncs b/35expandedspells/sp_chan_pyrob.ncs new file mode 100644 index 00000000..c9bbd2a4 Binary files /dev/null and b/35expandedspells/sp_chan_pyrob.ncs differ diff --git a/35expandedspells/sp_chan_pyrob.nss b/35expandedspells/sp_chan_pyrob.nss new file mode 100644 index 00000000..5ec0b1a8 --- /dev/null +++ b/35expandedspells/sp_chan_pyrob.nss @@ -0,0 +1,162 @@ +//:://///////////////////////////////////////////// +//:: Name Channeled Pyroburst +//:: FileName sp_chan_pyrob.nss +//::////////////////////////////////////////////// +/**@file Channeled Pyroburst +Evocation [Fire] +Level: Duskblade 4, sorcerer/wizard 4 +Components: V,S +Casting Time: See text +Range: Medium +Area: See text +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +This spell creates a bolt of fiery energy that blasts +your enemies. The spell's strength depends on the +amount of time you spend channeling energy into it. + +If you cast this spell as a swift action, it deals +1d4 points of fire damage per two caster levels +(maximum 10d4) against a single target of your choice. + +If you cast this spell as a standard action, it deals +1d6 points of fire damage per caster level +(maximum 10d6) to all creatures in a 10-foot-radius +spread. + +If you cast this spell as a full-round action, it deals +1d8 points of fire damage per caster level +(maximum 10d8) to all creatures in a 15-foot-radius +spread. + +If you spend 2 rounds casting this spell, it deals 1d10 +points of fire damage per caster level (maximum 10d10) +to all creatures in a 20-foot-radius spread. + +You do not need to declare ahead of time how long you +want to spend casting the spell. When you begin casting +the spell, you decide that you are finished casting after +the appropriate time has passed. + +**/ + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nSpell = PRCGetSpellId(); + int nCasterLvl = PRCGetCasterLevel(oPC); + object oTarget = PRCGetSpellTargetObject(); + location lLoc = PRCGetSpellTargetLocation(); + int nDC = PRCGetSaveDC(oTarget, oPC); + int nDam; + int nMetaMagic = PRCGetMetaMagicFeat(); + float fRadius = 0.0f; + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_CHANNELED_PYROBURST, oPC); + + //Check Spell Resistance + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //swift + if(nSpell == SPELL_CHANNELED_PYROBURST_1) + { + if(!TakeSwiftAction(oPC)) + { + return; + } + + nDam = d4(min((nCasterLvl/2), 40)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 4 * (min((nCasterLvl/2), 40)); + } + } + + //standard + else if(nSpell == SPELL_CHANNELED_PYROBURST_2) + { + nDam = d6(min(40, nCasterLvl)); + fRadius = 3.048f; + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(40, nCasterLvl)); + } + } + + //full round + else if(nSpell == SPELL_CHANNELED_PYROBURST_3) + { + nDam = d8(min(40, nCasterLvl)); + fRadius = 4.57f; + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 8 * (min(40, nCasterLvl)); + } + } + + //two rounds + else if(nSpell == SPELL_CHANNELED_PYROBURST_4) + { + nDam = d10(min(40, nCasterLvl)); + fRadius = 6.10f; + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 10 * (min(40, nCasterLvl)); + } + } + + else + { + PRCSetSchool(); + return; + } + + //Metamagic Empower + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_FIRE)) + { + nDam = nDam/2; + } + + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE); + + if(fRadius == 0.0f) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + + else + { + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + + while(GetIsObjectValid(oTarget)) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + } + } + PRCSetSchool(); +} + + + + diff --git a/35expandedspells/sp_close_wounds.ncs b/35expandedspells/sp_close_wounds.ncs new file mode 100644 index 00000000..c29f4db5 Binary files /dev/null and b/35expandedspells/sp_close_wounds.ncs differ diff --git a/35expandedspells/sp_close_wounds.nss b/35expandedspells/sp_close_wounds.nss new file mode 100644 index 00000000..a70bcc2a --- /dev/null +++ b/35expandedspells/sp_close_wounds.nss @@ -0,0 +1,70 @@ +//:://///////////////////////////////////////////// +//:: Name Close Wounds +//:: FileName sp_close_wounds.nss +//::////////////////////////////////////////////// +/** @file Close Wounds +Conjuration (Healing) +Level: Clr 3, Hlr 3 +Components: V +Casting Time: 1 swift action +Range: Close +Target: One creature +Duration: Instantaneous +Saving Throw: Will half (harmless) +Spell Resistance: Yes (harmless) + +This spell cures 2d4 points of damage. You can cast +this spell with an instant utterance. + +Used against an undead creature, close wounds deals +damage instea of curing the creature (which takes half +damage if it makes a Will saving throw). +**/ +////////////////////////////////////////////////// +// Author: Tenjac +// Date: 5.10.06 +/////////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + + int nCasterLvl = PRCGetCasterLevel(oPC); +int nHeal = d4(nCasterLvl)+8; + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nHeal = 8+ (nCasterLvl*4); + + if(nMetaMagic & METAMAGIC_EMPOWER) + nHeal += (nHeal/2); + + //Damage if undead + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD + || (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)) + { + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //save for 1/2 dam + if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oPC), SAVING_THROW_TYPE_POSITIVE)) + nHeal = nHeal/2; + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nHeal, DAMAGE_TYPE_POSITIVE), oTarget); + } + } + else + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget); + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_cloud_achaiA.ncs b/35expandedspells/sp_cloud_achaiA.ncs new file mode 100644 index 00000000..3a2f0419 Binary files /dev/null and b/35expandedspells/sp_cloud_achaiA.ncs differ diff --git a/35expandedspells/sp_cloud_achaiA.nss b/35expandedspells/sp_cloud_achaiA.nss new file mode 100644 index 00000000..5cb6d659 --- /dev/null +++ b/35expandedspells/sp_cloud_achaiA.nss @@ -0,0 +1,77 @@ +//:://///////////////////////////////////////////// +//:: Cloud of the Achaierai: On Enter +//:: sp_cloud_achaiA.nss +//:: +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Tenjac +//:: Created On: 3/24/06 +//::////////////////////////////////////////////// + + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + object oTarget = GetEnteringObject(); + object oPC = GetAreaOfEffectCreator(); + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eDark = EffectDarkness(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDark, eDur); + effect eConf = PRCEffectConfused(); + effect eLinkConf = EffectLinkEffects(eLink, eConf); + int nCasterLvl = PRCGetCasterLevel(oPC); + float fDuration = (nCasterLvl * 600.0f); + int nDam = d6(nCasterLvl/2)+2; + int nDC = PRCGetSaveDC(oTarget, oPC); + + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + fDuration = fDuration *2; //Duration is +100% + } + + // * July 2003: If has darkness then do not put it on it again + // Primogenitor: Yes, what about overlapping darkness effects by different casters? + //if (PRCGetHasEffect(EFFECT_TYPE_DARKNESS, oTarget) == TRUE) + //{ + // return; + //} + + //if valid and not caster + if(GetIsObjectValid(oTarget) && oTarget != oPC) + { + //Spell resistance + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Save + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinkConf, oTarget, fDuration); + } + else + { + if(!GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + } + } + + //Damage + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + } + + PRCSetSchool(); +} + + + diff --git a/35expandedspells/sp_clutch_orcus.ncs b/35expandedspells/sp_clutch_orcus.ncs new file mode 100644 index 00000000..586b03f3 Binary files /dev/null and b/35expandedspells/sp_clutch_orcus.ncs differ diff --git a/35expandedspells/sp_clutch_orcus.nss b/35expandedspells/sp_clutch_orcus.nss new file mode 100644 index 00000000..6dca8b7c --- /dev/null +++ b/35expandedspells/sp_clutch_orcus.nss @@ -0,0 +1,101 @@ +//:://///////////////////////////////////////////// +//:: Name Clutch of Orcus +//:: FileName sp_clutch_orcus.nss +//::////////////////////////////////////////////// +/**@file Clutch of Orcus +Necromancy [Evil] +Level: Clr 3 +Components: V, S +Casting Time: 1 action +Range: Medium (100 ft. + 10 ft./level) +Target: One humanoid +Duration: Concentration (see text) +Saving Throw: Fortitude negates (see text) +Spell Resistance: Yes + +The caster creates a magical force that grips the +subject's heart (or similar vital organ) and +begins crushing it. The victim is paralyzed +(as if having a heart attack) and takes 1d3 points +of damage per round. + +Each round, the caster must concentrate to +maintain the spell. In addition, a conscious +victim gains a new saving throw each round to stop +the spell. If the victim dies as a result of this +spell, his chest ruptures and bursts, and his +smoking heart appears in the caster's hand. + +Author: Tenjac +Created: 3/28/05 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void CrushLoop(object oTarget, object oPC, int bEndSpell, int nDC) +{ +int nCasterLvl = PRCGetCasterLevel(oPC); + //Conc check + if(GetBreakConcentrationCheck(oPC)) + { + bEndSpell = TRUE; + } + + //if makes save, abort + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + bEndSpell = TRUE; + } + + //if Conc and failed save... + if(bEndSpell = FALSE) + { + //Paral + effect ePar = EffectParalyze(); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePar, oTarget, 6.0f); + + //damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, d3(nCasterLvl/4)+1, DAMAGE_TYPE_MAGICAL), oTarget); + + //if dead, end effect + if(GetIsDead(oTarget)) + { + effect eChunky = EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eChunky, oTarget); + + //End loop next time so it doesn't keep going forever + bEndSpell = TRUE; + } + + DelayCommand(6.0f, CrushLoop(oTarget, oPC, bEndSpell, nDC)); + } +} + +void main() +{ + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oPC = OBJECT_SELF; + object oTarget= PRCGetSpellTargetObject(); + int bEndSpell = FALSE; + int nDC = PRCGetSaveDC(oTarget, oPC); + int nCasterLvl = PRCGetCasterLevel(oPC); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_CLUTCH_OF_ORCUS, oPC); + + //Check spell resistance + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //start loop + CrushLoop(oTarget, oPC, bEndSpell, nDC); + } + + //SPEvilShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_curimpbl.ncs b/35expandedspells/sp_curimpbl.ncs new file mode 100644 index 00000000..6e6e3523 Binary files /dev/null and b/35expandedspells/sp_curimpbl.ncs differ diff --git a/35expandedspells/sp_curimpbl.nss b/35expandedspells/sp_curimpbl.nss new file mode 100644 index 00000000..9a9a466e --- /dev/null +++ b/35expandedspells/sp_curimpbl.nss @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////// +// +// Curse of Impending Blades - Target receives a -2 to AC penalty. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + object oTarget = PRCGetSpellTargetObject(); + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // Get the target and raise the spell cast event. + PRCSignalSpellEvent(oTarget); + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(PRCGetCasterLevel())); + + // Determine the save bonus. + int nBonus = 2 + (nCasterLvl / 6); + if (nBonus > 20) nBonus = 20; + + // Apply the curse and vfx. + effect eCurse = EffectACDecrease(2); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCurse, oTarget, fDuration,TRUE,-1,nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_curpfail.ncs b/35expandedspells/sp_curpfail.ncs new file mode 100644 index 00000000..407ead55 Binary files /dev/null and b/35expandedspells/sp_curpfail.ncs differ diff --git a/35expandedspells/sp_curpfail.nss b/35expandedspells/sp_curpfail.nss new file mode 100644 index 00000000..ec5568b0 --- /dev/null +++ b/35expandedspells/sp_curpfail.nss @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////// +// +// Curse of Petty Failing - Target takes a -2 penalty to attacks +// and saves. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oTarget = PRCGetSpellTargetObject(); + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // Get the target and raise the spell cast event. + PRCSignalSpellEvent(oTarget); + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(PRCGetCasterLevel())); + + // Determine the save bonus. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nBonus = 2 + (nCasterLvl / 6); + if (nBonus > 20) nBonus = 20; + + // Apply the curse and vfx. + effect eCurse = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2); + eCurse = EffectLinkEffects(eCurse, EffectAttackDecrease(2)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCurse, oTarget, fDuration,TRUE,-1,nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_damng_darkA.ncs b/35expandedspells/sp_damng_darkA.ncs new file mode 100644 index 00000000..647248d4 Binary files /dev/null and b/35expandedspells/sp_damng_darkA.ncs differ diff --git a/35expandedspells/sp_damng_darkA.nss b/35expandedspells/sp_damng_darkA.nss new file mode 100644 index 00000000..5f64ccca --- /dev/null +++ b/35expandedspells/sp_damng_darkA.nss @@ -0,0 +1,86 @@ +//:://///////////////////////////////////////////// +//:: Name Damning Darkness +//:: FileName sp_damng_dark.nss +//::////////////////////////////////////////////// +/**@file Damning Darkness +Evocation [Darkness, Evil] +Level: Clr 4, Darkness 4, Sor/Wiz 4 +Components: V, M/DF +Casting Time: 1 action +Range: Touch +Target: Object touched +Duration: 10 minutes/level (D) +Saving Throw: None +Spell Resistance: No + +This spell is similar to darkness, except that those +within the area of darkness also take unholy damage. +Creatures of good alignment take 2d6 points of +damage per round in the darkness, and creatures +neither good nor evil take 1d6 points of damage. As +with the darkness spell, the area of darkness is a +20-foot radius, and the object that serves as the +spell's target can be shrouded to block the darkness +(and thus the dam­aging effect). + +Damning darkness counters or dispels any light spell +of equal or lower level. + +Arcane Material Component: A dollop of pitch with a +tiny needle hidden inside it. + +Author: Tenjac +Created: 6/12/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +void DarkLoop(object oTarget); + + +#include "prc_alterations" +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oTarget = GetEnteringObject(); + object oPC = GetAreaOfEffectCreator(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCasterLvl = PRCGetCasterLevel(oPC); + effect eDark = EffectDarkness(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDark, eDur); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, (600.0f * nCasterLvl)); + + DarkLoop(oTarget); + + PRCSetSchool(); +} + +void DarkLoop(object oTarget) +{ +object oPC = GetAreaOfEffectCreator(); +int nCasterLvl = PRCGetCasterLevel(oPC); + + if(GetIsObjectValid(oTarget)) + { + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, d6(nCasterLvl/2)+2, DAMAGE_TYPE_DIVINE), oTarget); + } + + else if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_NEUTRAL) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, d6(nCasterLvl/2)+2, DAMAGE_TYPE_DIVINE), oTarget); + } + + else + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE), oTarget, 1.0f); + } + + } + DelayCommand(6.0f, DarkLoop(oTarget)); + +} \ No newline at end of file diff --git a/35expandedspells/sp_dancg_web.ncs b/35expandedspells/sp_dancg_web.ncs new file mode 100644 index 00000000..68ce047c Binary files /dev/null and b/35expandedspells/sp_dancg_web.ncs differ diff --git a/35expandedspells/sp_dancg_web.nss b/35expandedspells/sp_dancg_web.nss new file mode 100644 index 00000000..287e0cda --- /dev/null +++ b/35expandedspells/sp_dancg_web.nss @@ -0,0 +1,97 @@ +//:://///////////////////////////////////////////// +//:: Name Dancing Web +//:: FileName sp_dancg_web.nss +//::////////////////////////////////////////////// +/**@file Dancing Web +Evocation [Good] +Level: Clr 5, Drd 5, Sor/Wiz 4 +Components: V, S, M/DF +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Area: 20-ft.-radius burst +Duration: Instantaneous +Saving Throw: Reflex half; see text +Spell Resistance: Yes + +This spell creates a burst of magical energy that +deals 1d6 points per level of non-lethal damage +maximum 10d6). Further, evil creatures that fail +their saving throw become entangled by lingering +threads of magical energy for 1d6 rounds. An +entangled creature takes a -2 penalty on attack +rolls and a -4 penalty to effective Dexterity; +the entangled target can move at half speed but +can't run or charge. + +Arcane Material Component: A bit of spider's web. + +Author: Tenjac +Created: 7/6/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 6.10f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + float fDur; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMin = min(40, nCasterLvl); + int nDam; + int nDC = PRCGetSaveDC(oTarget, oPC); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION), lLoc); + + while(GetIsObjectValid(oTarget)) + { + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Should be non-lethal + nDam = d6(nMin); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * nMin; + fDur = RoundsToSeconds(6); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_GOOD)) + { + fDur = RoundsToSeconds(d6(1)); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, fDur); + } + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 6.10f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + //SPGoodShift(oPC); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_darkbolt.ncs b/35expandedspells/sp_darkbolt.ncs new file mode 100644 index 00000000..e16449c9 Binary files /dev/null and b/35expandedspells/sp_darkbolt.ncs differ diff --git a/35expandedspells/sp_darkbolt.nss b/35expandedspells/sp_darkbolt.nss new file mode 100644 index 00000000..1ec8a594 --- /dev/null +++ b/35expandedspells/sp_darkbolt.nss @@ -0,0 +1,96 @@ +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nPenetr = nCasterLvl + SPGetPenetr(); + + int nMissiles = nCasterLvl/2; + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + float fDelay2, fTime; + int nCnt; + + effect eBolt = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND); + effect eMissile = EffectVisualEffect(VFX_BEAM_EVIL); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eDazed=EffectDazed(); + + effect eVis2 = EffectVisualEffect(VFX_IMP_DAZED_S); + + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_ENFEEBLEMENT)); + //Limit missiles to 7 + if (nMissiles > 40) nMissiles = 40; + + //Make SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + //Apply a single damage hit for each missile instead of as a single mass + for (nCnt = 1; nCnt <= nMissiles; nCnt++) + { + //Roll damage + int nDam = d8(2); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 16;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + + fTime = fDelay; + fDelay2 += 0.1; + fTime += fDelay2; + + //Set damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, 1.0,FALSE); + + if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0,FALSE)); + //DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget,1.0)); + + } + + + } + //Make reflex save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget,OBJECT_SELF))) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,6.0)); + + if(!GetIsImmune(oTarget,IMMUNITY_TYPE_MIND_SPELLS)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDazed, oTarget,6.0)); + // FloatingTextStringOnCreature("no immune " , OBJECT_SELF, FALSE); + } + else + { + // FloatingTextStringOnCreature("immune " , OBJECT_SELF, FALSE); + + AssignCommand(oTarget,ClearAllActions(TRUE)); + AssignCommand(oTarget,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE,1.0,6.0)); + DelayCommand(0.2,SetCommandable(FALSE,oTarget)); + DelayCommand(6.2,SetCommandable(TRUE,oTarget)); + } + } + } + + + PRCSetSchool(); + +} \ No newline at end of file diff --git a/35expandedspells/sp_darkbolt1.ncs b/35expandedspells/sp_darkbolt1.ncs new file mode 100644 index 00000000..40b58a9c Binary files /dev/null and b/35expandedspells/sp_darkbolt1.ncs differ diff --git a/35expandedspells/sp_darkbolt1.nss b/35expandedspells/sp_darkbolt1.nss new file mode 100644 index 00000000..3f5fa847 --- /dev/null +++ b/35expandedspells/sp_darkbolt1.nss @@ -0,0 +1,169 @@ +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void DarkBolt(object oTarget,int nMissiles, int nDC , int nMetaMagic) +{ + if (GetIsDead(oTarget)) return; + + nMissiles--; + effect eMissile = EffectVisualEffect(VFX_BEAM_EVIL); + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eDazed=EffectDazed(); + effect eVis2 = EffectVisualEffect(VFX_IMP_DAZED_S); + //effect eBolt = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND); + effect eBolt = EffectVisualEffect(VFX_IMP_MIRV); + + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + float fDelay2, fTime; + + //Make SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget)) + { + //Roll damage + int nDam = d8(2); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 16;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + + fTime = fDelay; + fDelay2 += 0.1; + fTime += fDelay2; + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, 1.0,FALSE); + + //Set damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, 1.0,FALSE); + + if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0,FALSE)); + //DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget,1.0)); + } + + //Make reflex save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget,nDC)) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,6.0)); + + if(!GetIsImmune(oTarget,IMMUNITY_TYPE_MIND_SPELLS)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDazed, oTarget,6.0)); + // FloatingTextStringOnCreature("no immune " , OBJECT_SELF, FALSE); + } + else + { + // FloatingTextStringOnCreature("immune " , OBJECT_SELF, FALSE); + + AssignCommand(oTarget,ClearAllActions(TRUE)); + AssignCommand(oTarget,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE,1.0,6.0)); + DelayCommand(0.2,SetCommandable(FALSE,oTarget)); + DelayCommand(6.2,SetCommandable(TRUE,oTarget)); + } + } + } + + if (nMissiles>0) + DelayCommand(6.2,DarkBolt(oTarget,nMissiles,nDC,nMetaMagic)); + +} + + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nPenetr = nCasterLvl + SPGetPenetr(); + + int nMissiles = nCasterLvl/2; + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + float fDelay2, fTime; + int nCnt; + + effect eBolt = EffectBeam(VFX_BEAM_EVIL, OBJECT_SELF, BODY_NODE_HAND); + effect eMissile = EffectVisualEffect(VFX_BEAM_EVIL); + effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE); + effect eDazed=EffectDazed(); + + effect eVis2 = EffectVisualEffect(VFX_IMP_DAZED_S); + + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_ENFEEBLEMENT)); + //Limit missiles to 7 + if (nMissiles > 40) nMissiles = 40; + + //Make SR Check + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + + //Roll damage + int nDam = d8(2); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 16;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + + fTime = fDelay; + fDelay2 += 0.1; + fTime += fDelay2; + + //Set damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBolt, oTarget, 1.0,FALSE); + + if(MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0,FALSE)); + // DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget,1.0)); + } + + + //Make reflex save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget,nDC)) + { + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,6.0)); + + if(!GetIsImmune(oTarget,IMMUNITY_TYPE_MIND_SPELLS)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDazed, oTarget,6.0)); + // FloatingTextStringOnCreature("no immune " , OBJECT_SELF, FALSE); + } + else + { + // FloatingTextStringOnCreature("immune " , OBJECT_SELF, FALSE); + + AssignCommand(oTarget,ClearAllActions(TRUE)); + AssignCommand(oTarget,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE,1.0,6.0)); + DelayCommand(0.2,SetCommandable(FALSE,oTarget)); + DelayCommand(6.2,SetCommandable(TRUE,oTarget)); + } + } + } + nMissiles--; + if (nMissiles>0) + DelayCommand(6.2,DarkBolt( oTarget,nMissiles,nDC,nMetaMagic)); + + PRCSetSchool(); + +} \ No newline at end of file diff --git a/35expandedspells/sp_deep_slumber.ncs b/35expandedspells/sp_deep_slumber.ncs new file mode 100644 index 00000000..660307f9 Binary files /dev/null and b/35expandedspells/sp_deep_slumber.ncs differ diff --git a/35expandedspells/sp_deep_slumber.nss b/35expandedspells/sp_deep_slumber.nss new file mode 100644 index 00000000..32310143 --- /dev/null +++ b/35expandedspells/sp_deep_slumber.nss @@ -0,0 +1,161 @@ +//:://///////////////////////////////////////////// +//:: Name Deep Slumber +//:: FileName sp_deep_slumber.nss +//::////////////////////////////////////////////// +/**@file Deep Slumber +Enchantment (Compulsion) [Mind-Affecting] +Level: Brd 3, Sor/Wiz 3, Hexblade 3 +Range: Close (25 ft. + 5 ft./2 levels) +This spell functions like sleep, except that it affects 10 HD of creatures. + +**/ + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ENCHANTMENT); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget; + object oLowest; + effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20); + effect eSleep = EffectSleep(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eVis = EffectVisualEffect(VFX_IMP_SLEEP); + + effect eLink = EffectLinkEffects(eSleep, eMind); + eLink = EffectLinkEffects(eLink, eDur); + + // * Moved the linking for the ZZZZs into the later code + // * so that they won't appear if creature immune + + int bContinueLoop; + int nHD = 20; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCurrentHD; + int bAlreadyAffected; + int nMax = 19;// maximun hd creature affected + int nLow; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + int nScaledDuration; + nDuration = 3 + nDuration; + int nPenetr = CasterLvl + SPGetPenetr(); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + string sSpellLocal = "BIOWARE_SPELL_LOCAL_SLEEP_" + ObjectToString(OBJECT_SELF); + //Enter Metamagic conditions + + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nHD = nHD + (nHD/2); //Damage/Healing is +50% + } + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + nDuration += 2; + //Get the first target in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + //If no valid targets exists ignore the loop + if (GetIsObjectValid(oTarget)) + { + bContinueLoop = TRUE; + } + // The above checks to see if there is at least one valid target. + while ((nHD > 0) && (bContinueLoop)) + { + nLow = nMax; + bContinueLoop = FALSE; + //Get the first creature in the spell area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, PRCGetSpellTargetLocation()); + while (GetIsObjectValid(oTarget)) + { + //Make faction check to ignore allies + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) + && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT + && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD) + { + //Get the local variable off the target and determined if the spell has already checked them. + bAlreadyAffected = GetLocalInt(oTarget, sSpellLocal); + if (!bAlreadyAffected) + { + //Get the current HD of the target creature + nCurrentHD = GetHitDice(oTarget); + //Check to see if the HD are lower than the current Lowest HD stored and that the + //HD of the monster are lower than the number of HD left to use up. + if(nCurrentHD < nLow + && nCurrentHD <= nHD + && (nCurrentHD < 5 || GetPRCSwitch(PRC_SLEEP_NO_HD_CAP))) + { + nLow = nCurrentHD; + oLowest = oTarget; + bContinueLoop = TRUE; + } + } + } + //Get the next target in the shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, PRCGetSpellTargetLocation()); + } + //Check to see if oLowest returned a valid object + if(oLowest != OBJECT_INVALID) + { + //Fire cast spell at event for the specified target + SignalEvent(oLowest, EventSpellCastAt(OBJECT_SELF, SPELL_DEEP_SLUMBER)); + //Make SR check + if (!PRCDoResistSpell(OBJECT_SELF, oLowest,nPenetr)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + //Make Fort save + if(!PRCMySavingThrow(SAVING_THROW_WILL, oLowest, (nDC), SAVING_THROW_TYPE_MIND_SPELLS)) + { + //SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oLowest); + if (GetIsImmune(oLowest, IMMUNITY_TYPE_SLEEP) == FALSE) + { + effect eLink2 = EffectLinkEffects(eLink, eVis); + nScaledDuration = PRCGetScaledDuration(nDuration, oLowest); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oLowest, RoundsToSeconds(nScaledDuration)); + } + else + // * even though I am immune apply just the sleep effect for the immunity message + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSleep, oLowest, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + } + + } + } + } + //Set a local int to make sure the creature is not used twice in the pass. Destroy that variable in + //.3 seconds to remove it from the creature + SetLocalInt(oLowest, sSpellLocal, TRUE); + DelayCommand(0.5, SetLocalInt(oLowest, sSpellLocal, FALSE)); + DelayCommand(0.5, DeleteLocalInt(oLowest, sSpellLocal)); + //Remove the HD of the creature from the total + nHD = nHD - GetHitDice(oLowest); + oLowest = OBJECT_INVALID; + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/sp_deflect.ncs b/35expandedspells/sp_deflect.ncs new file mode 100644 index 00000000..c9ffff3a Binary files /dev/null and b/35expandedspells/sp_deflect.ncs differ diff --git a/35expandedspells/sp_deflect.nss b/35expandedspells/sp_deflect.nss new file mode 100644 index 00000000..e9ecdcad --- /dev/null +++ b/35expandedspells/sp_deflect.nss @@ -0,0 +1,68 @@ +//:://///////////////////////////////////////////// +//:: Name Lesser Deflect +//:: FileName sp_deflect.nss +//::////////////////////////////////////////////// +/**@file Lesser Deflect +Abjuration [Force] +Level: Duskblade 1, sorcerer/wizard 1 +Components: V +Casting Time: 1 immediate action +Range: Personal +Duration: 1 round or until discharged + +You project a field of ivisible force, creating a +short-lived protective barrier. You gain a +deflection bonus to your AC against a single attack; +this bonus is equal to +1 per three caster levels +(maximum +5). + +**/ + +//:://///////////////////////////////////////////// +//:: Name Deflect +//:: FileName sp_deflect.nss +//::////////////////////////////////////////////// +/**@file Deflect +Abjuration [Force] +Level: Duskblade 2, sorcerer/wizard 2 +Components: V +Casting Time: 1 immediate action +Range: Personal +Duration: 1 round or until discharged + + +You project a field of ivisible force, creating a +short-lived protective barrier. You gain a +deflection bonus to your AC against a single attack; +this bonus is equal to 1/2 your caster level +(round down). + +**/ + +#include "prc_alterations" +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + object oPC = OBJECT_SELF; + float fDur = RoundsToSeconds(1); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSpell = PRCGetSpellId(); + int nBonus = nSpell == SPELL_DEFLECT ? nCasterLvl/2: + min(20, (nCasterLvl/3)); + + PRCSignalSpellEvent(oPC, FALSE, nSpell, oPC); + + if(nMetaMagic & METAMAGIC_EXTEND) + fDur *= 2; + + effect eBonus = EffectACIncrease(AC_DEFLECTION_BONUS, nBonus); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oPC, fDur); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_dispell_tch.ncs b/35expandedspells/sp_dispell_tch.ncs new file mode 100644 index 00000000..d62d4b72 Binary files /dev/null and b/35expandedspells/sp_dispell_tch.ncs differ diff --git a/35expandedspells/sp_dispell_tch.nss b/35expandedspells/sp_dispell_tch.nss new file mode 100644 index 00000000..811faeda --- /dev/null +++ b/35expandedspells/sp_dispell_tch.nss @@ -0,0 +1,95 @@ +//:://///////////////////////////////////////////// +//:: Name Dispelling Touch +//:: FileName sp_dispell_tch.nss +//::////////////////////////////////////////////// +/**@file Dispelling Touch +Abjuration +Level: Duskblade 3, sorcerer/wizard 2 +Components: V,S +Casting Time: 1 standard action +Range: Touch +Target: One touched creature, object, or spell + effect +Duration: Instantaneous +Saving Throw: None +Spell Resistance: No + +You can use dispelling touch to end an ongoing +spell that has been cast on a creature or object, +or a spell tha has a noticeable ongoing effect. You +mkae a dispel check (1d20 + your caster level, max ++10) against the spell effect with the highest +caster level. If that check fails, you make dispel +checks against progressively weaker spells until +you dispel one spell or you fail all your checks. +Magic items carried by a creature are not affected. +**/ + +/* + PRC_SPELL_EVENT_ATTACK is set when a + touch or ranged attack is used + +*/ + +#include "inc_dispel" +#include "prc_inc_sp_tch" +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int iTypeDispel = GetLocalInt(GetModule(),"BIODispel"); + // Dispel Magic is capped at caster level 10 + if(nCasterLevel > 20) + nCasterLevel = 20; + + effect eVis = EffectVisualEffect(VFX_IMP_BREACH); + effect eImpact = EffectVisualEffect(VFX_FNF_DISPEL); + + int iAttackRoll = PRCDoMeleeTouchAttack(oTarget); + if(iAttackRoll) + { + if(GetIsObjectValid(oTarget)) + { + if(iTypeDispel) + spellsDispelMagic(oTarget, nCasterLevel, eVis, eImpact); + else + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact); + } + } + + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + if(!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_disrpt_undead.ncs b/35expandedspells/sp_disrpt_undead.ncs new file mode 100644 index 00000000..b3526fa1 Binary files /dev/null and b/35expandedspells/sp_disrpt_undead.ncs differ diff --git a/35expandedspells/sp_disrpt_undead.nss b/35expandedspells/sp_disrpt_undead.nss new file mode 100644 index 00000000..5a0cd5b8 --- /dev/null +++ b/35expandedspells/sp_disrpt_undead.nss @@ -0,0 +1,127 @@ +//:://///////////////////////////////////////////// +//:: Name Disrupt Undead/Greater Disrupt Undead +//:: FileName sp_disrpt_undead.nss +//::////////////////////////////////////////////// +/**@file Disrupt Undead +Necromancy +Level: Sor/Wiz 0 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: Ray +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +You direct a ray of positive energy. You must make a +ranged touch attack to hit, and if the ray hits an +undead creature, it deals 1d6 points of damage to it. + +Greater Disrupt Undead +Necromancy +Level: Sorcerer/wizard 3 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: Ray +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +You must succeed on a ranged touch attack with the ray +to strike a target. This spell functions like disrupt +undead (PH 223), except that this ray deals 1d8 points +of damage per caster level to any undead, to a maximum +of 10d8. If the damage is sufficient to destroy the +first target, then you can redirect the ray to another +undead target within 15 feet of the first target. If +you make a successful ranged touch attack on the second +target, that target takes half of the damage rolled for +the first target. + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" + +void main() +{ + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nSpell = GetSpellId(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nBeam; + int nDam; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nTouch = PRCDoRangedTouchAttack(oTarget); + int nType = MyPRCGetRacialType(oTarget); + + if(nSpell == SPELL_DISRUPT_UNDEAD) + { + nBeam = VFX_BEAM_HOLY; + nDam = d6(1)+ (nCasterLvl/4); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) nDam = 6+(nCasterLvl/4); + } + + if(nSpell == SPELL_GREATER_DISRUPT_UNDEAD) + { + nBeam = VFX_BEAM_BLACK; + nDam = d6(3)+ (nCasterLvl/3); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) nDam = 18+ (nCasterLvl/3); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) nDam += (nDam/2); + + //Beam that acts accordingly + effect eVis = EffectBeam(nBeam, oPC, BODY_NODE_HAND, !nTouch); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(nTouch) + { + if(nType == RACIAL_TYPE_UNDEAD + || (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)) + { + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + if(nSpell == SPELL_GREATER_DISRUPT_UNDEAD) + { + //Get hp before damage + int nHP = GetCurrentHitPoints(oTarget); + + //Apply Damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_POSITIVE), oTarget); + + //if enough to kill target, bounce + if(nDam >= nHP) + { + location lLoc = GetLocation(oTarget); + object oTarget2 = MyFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(15.0), lLoc, TRUE); + + while(GetIsObjectValid(oTarget2)) + { + //Undead, enemy, and not the original target + if((GetRacialType(oTarget2) == RACIAL_TYPE_UNDEAD || (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget2) && GetAlignmentGoodEvil(oTarget2) != ALIGNMENT_GOOD) + && GetIsEnemy(oTarget2, oPC) && (oTarget != oTarget2))) + { + //Black beam, origin chest of previous target + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectBeam(VFX_BEAM_BLACK, oTarget, BODY_NODE_CHEST), oTarget2); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam/2, DAMAGE_TYPE_POSITIVE), oTarget2); + break; + } + + oTarget2 = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(15.0), lLoc, TRUE); + } + } + } + else SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_POSITIVE), oTarget); + } + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_divprot.ncs b/35expandedspells/sp_divprot.ncs new file mode 100644 index 00000000..117c0c35 Binary files /dev/null and b/35expandedspells/sp_divprot.ncs differ diff --git a/35expandedspells/sp_divprot.nss b/35expandedspells/sp_divprot.nss new file mode 100644 index 00000000..30b18224 --- /dev/null +++ b/35expandedspells/sp_divprot.nss @@ -0,0 +1,55 @@ +///////////////////////////////////////////////////////////////////// +// +// Divine Protection - +1 to AC and saves to allies in a huge burst. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Get the effective caster level. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + // Determine the save bonus. + int nBonus = 2 + (nCasterLvl / 6); + if (nBonus > 5) nBonus = 5; + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(nCasterLvl)); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget, FALSE); + + PRCRemoveSpellEffects(GetSpellId(), OBJECT_SELF, oTarget); + + float fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + + // Apply the curse and vfx. + effect eCurse = EffectSavingThrowIncrease(SAVING_THROW_ALL, 1); + eCurse = EffectLinkEffects(eCurse, EffectACIncrease(1)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCurse, oTarget, fDuration,TRUE,-1,nCasterLvl)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_AC_BONUS), oTarget)); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_dmnd_spray.ncs b/35expandedspells/sp_dmnd_spray.ncs new file mode 100644 index 00000000..0fff9dd0 Binary files /dev/null and b/35expandedspells/sp_dmnd_spray.ncs differ diff --git a/35expandedspells/sp_dmnd_spray.nss b/35expandedspells/sp_dmnd_spray.nss new file mode 100644 index 00000000..d113e56c --- /dev/null +++ b/35expandedspells/sp_dmnd_spray.nss @@ -0,0 +1,101 @@ +//:://///////////////////////////////////////////// +//:: Name Diamond Spray +//:: FileName sp_dmnd_spray +//::////////////////////////////////////////////// +/**@file Diamond Spray +Evocation [Good] +Level: Sanctified 4 +Components: V, S, M +Casting Time: 1 standard action +Range: 60 ft. +Area: Cone-shaped burst +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +A blast of diamond-like shards springs from your +hand and extends outward in a glittering cone. The +cone dazzles evil creatures in the area for 2d6 +rounds. The spell also deals 1d6 points of damage +per caster level (maximum 10d6). The damage +affects only evil creatures. A successful Reflex +save reduces the damage by half but does not +negate the dazzling effect. + +Material Component: Diamond dust worth at least 100 gp. + +Author: Tenjac +Created: 6/11/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC; + int nMetaMagic = PRCGetMetaMagicFeat(); + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 18.28f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + float fDur = RoundsToSeconds(d6(2)); + + //make sure it's not the PC + if(oTarget == oPC) + { + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 18.28f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + while(GetIsObjectValid(oTarget)) + { + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + int nDam = d6(min(nCasterLvl,40)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(nCasterLvl, 40)); + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + nDC = PRCGetSaveDC(oTarget, oPC); + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC)) + { + nDam = nDam/2; + } + + //Apply appropriate damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + + //Dazzled = -1 to Attack, Spot, and search + effect eDazzle = EffectLinkEffects(EffectDazzle(), EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDazzle, oTarget, fDur); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 18.28f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_doom_scarab.ncs b/35expandedspells/sp_doom_scarab.ncs new file mode 100644 index 00000000..daf47df3 Binary files /dev/null and b/35expandedspells/sp_doom_scarab.ncs differ diff --git a/35expandedspells/sp_doom_scarab.nss b/35expandedspells/sp_doom_scarab.nss new file mode 100644 index 00000000..81ec3816 --- /dev/null +++ b/35expandedspells/sp_doom_scarab.nss @@ -0,0 +1,108 @@ +//:://///////////////////////////////////////////// +//:: Name Doom Scarabs +//:: FileName sp_doom_scarab.nss +//::////////////////////////////////////////////// +/**@file Doom Scarabs +Conjuration/Necromancy +Level: Duskblade 3, sorcerer/wizard 4 +Components: V,S +Casting Time: 1 standard action +Range: 60ft +Area: Cone-shaped burst +Duration: Instantaneous +Saving Throw: Will half +Spell Resistance: See text + +This spell has two effects. It deals 1d6 points of +damage per two caster levels (maximum 10d6) to all +creatures in the area. Spell resistance does not +apply to this damage. However, spell resistance +does apply to the spell's secondary effect. If you +ovecome a creature's spell resistance, you gain 1d4 +temporary hit points as the scarabs feast on the +creature's arcane energy and bleed it back into you. +You gain these temporary hit points for each creature +whose spell resistance you overcome. You never gain +temporary hit points from creatures that do not have +spell resistance. + +The temporary hit points gained from this spell last +for up to 1 hour. + +**/ + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 18.29f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nBonusDice; + int nDam; + int nDC; + float fDur = HoursToSeconds(1); + + //don't target the caster moron + if(oTarget == oPC) + { + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 18.29f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + while(GetIsObjectValid(oTarget)) + { + nDam = d6(min(nCasterLvl/2, 40)); + nDC = PRCGetSaveDC(oTarget, oPC); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(nCasterLvl/2, 40)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + nDam = (nDam/2); + + if(GetHasMettle(oTarget, SAVING_THROW_WILL)) + { + PRCSetSchool(); + return; + } + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + nBonusDice++; + } + + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 18.29f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + effect eBonus = EffectTemporaryHitpoints(d4(nBonusDice)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oPC, fDur); + + PRCSetSchool(); +} + + + \ No newline at end of file diff --git a/35expandedspells/sp_elemstrike.ncs b/35expandedspells/sp_elemstrike.ncs new file mode 100644 index 00000000..304997c4 Binary files /dev/null and b/35expandedspells/sp_elemstrike.ncs differ diff --git a/35expandedspells/sp_elemstrike.nss b/35expandedspells/sp_elemstrike.nss new file mode 100644 index 00000000..a0d1f18d --- /dev/null +++ b/35expandedspells/sp_elemstrike.nss @@ -0,0 +1,149 @@ +//:://///////////////////////////////////////////// +//:: Elemental Strike +//:: sp_elemstrike.nss +//::////////////////////////////////////////////// +/* +Evocation [see text] +Level: Clr 5, Drd 4, Fiery Wrath 5, Tmp 5 +Components: V, S, DF +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Area: Cylinder (10-ft. radius, 40 ft. high) +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +A column of divine and elemental energy shoots downward +from the point you designate, striking those caught +beneath it with the fury of your element. + +An elemental strike produces a vertical column. The +spell deals 1d6 points of damage per caster level +(maximum 15d6). Half the damage is energy damage, but +the other half results directly from divine power and is +therefore not subject to being reduced by resistance to +energy–based attacks. The type of energy damage, as well +as the energy descriptor of the spell, is chosen at the time +of casting. Clerics must choose the energy type that +corresponds to their patron element. + +Air: Sonic +Earth: Acid +Fire: Fire +Magma: Fire +Rain: Electricity +Silt: Acid +Sun: Fire +Water: Cold + +This spell’s subtype is the same as the type of energy +you cast. + +Note: This spell replaces the flame strike spell from the +Player’s Handbook. +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nSpellID = PRCGetSpellId(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nDice = min(40, nCasterLvl); + int nPenter = nCasterLvl + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamageType, nImpVfx, nDamage, nDamage2; + effect eStrike; + + switch(nSpellID) + { + case SPELL_ELEMENTAL_STRIKE_ACID:{ + nDamageType = DAMAGE_TYPE_ACID; + nImpVfx = VFX_IMP_ACID_S; + eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_ACID); + break;} + case SPELL_ELEMENTAL_STRIKE_COLD:{ + nDamageType = DAMAGE_TYPE_COLD; + nImpVfx = VFX_IMP_FROST_S; + eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_COLD); + break;} + case SPELL_ELEMENTAL_STRIKE_ELECRICITY:{ + nDamageType = DAMAGE_TYPE_ELECTRICAL; + nImpVfx = VFX_IMP_LIGHTNING_S; + eStrike = EffectVisualEffect(VFX_IMP_LIGHTNING_M); + break;} + case SPELL_ELEMENTAL_STRIKE_SONIC:{ + nDamageType = DAMAGE_TYPE_SONIC; + nImpVfx = VFX_IMP_SONIC; + eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_SONIC); + break;} + default:{ + nDamageType = DAMAGE_TYPE_FIRE; + nImpVfx = VFX_IMP_FLAME_S; + eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE); + break;} + } + + int EleDmg = ChangedElementalDamage(oCaster, nDamageType); + int nSaveType = ChangedSaveType(EleDmg); + effect eVis = EffectVisualEffect(nImpVfx); + effect eHoly; + effect eElem; + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR); + //Apply the location impact visual to the caster location instead of caster target creature. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eStrike, lTarget); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID)); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(oCaster, oTarget, nPenter, 0.6)) + { + int nDC = PRCGetSaveDC(oTarget, oCaster); + nDamage = d6(nDice); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += (nDamage/2); + // Acid Sheath adds +1 damage per die to acid descriptor spells + if (GetHasDescriptor(nSpellID, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster)) + nDamage += nDice; + //Adjust the damage based on Reflex Save, Evasion and Improved Evasion + nDamage2 = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), SAVING_THROW_TYPE_DIVINE); + nDamage = PRCGetReflexAdjustedDamage(nDamage/2, oTarget, (nDC), nSaveType); + //Make a faction check so that only enemies receieve the full brunt of the damage. + if(!GetIsFriend(oTarget)) + { + eHoly = PRCEffectDamage(oTarget, nDamage2, DAMAGE_TYPE_DIVINE); + DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHoly, oTarget)); + } + // Apply effects to the currently selected target. + eElem = PRCEffectDamage(oTarget, nDamage, EleDmg); + if(nDamage > 0) + { + DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eElem, oTarget)); + DelayCommand(0.6, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget, FALSE, OBJECT_TYPE_CREATURE|OBJECT_TYPE_PLACEABLE|OBJECT_TYPE_DOOR); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_energz_ptn.ncs b/35expandedspells/sp_energz_ptn.ncs new file mode 100644 index 00000000..d1cd0826 Binary files /dev/null and b/35expandedspells/sp_energz_ptn.ncs differ diff --git a/35expandedspells/sp_energz_ptn.nss b/35expandedspells/sp_energz_ptn.nss new file mode 100644 index 00000000..a70c31a6 --- /dev/null +++ b/35expandedspells/sp_energz_ptn.nss @@ -0,0 +1,145 @@ +//:://///////////////////////////////////////////// +//:: Name Energize Potion +//:: FileName sp_energz_ptn.nss +//::////////////////////////////////////////////// +/**@file Energize Potion +Transmutation +Level: Cleric 3, druid 3, sorc/wizard 2, Wrath 2 +Components: V,S,M +Casting Time: 1 standard action +Range: Close +Effect: 10ft radius +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +This spell transforms a magic potion into a volatile +substance that can be hurled out to the specified +range. The spell destroys the potion and releases +a 10-foot-radius burst of energy at the point of +impact. The caster must specify the energy type +(acid, cold, electricity, fire, or sonic) when the +spell is cast. + +The potion deals 1d6 points of damage (of the +appropriate energy type) per spell level of the +potion (maximum 3d6). For example, a potion of +displacement transformed by this spell deals 3d6 +points of damage. An energized potion set to deal +fire damage ignites combustibles within the burst +radius. + +Author: Tenjac +Created: 7/6/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + object oPC = OBJECT_SELF; + object oPotion = PRCGetSpellTargetObject(); + int nSpell = PRCGetSpellId(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC = GetSpellSaveDC(); + string sDamageType; + + if(GetBaseItemType(oPotion) != BASE_ITEM_POTIONS) + { + FloatingTextStringOnCreature("Invalid item type.", oPC, FALSE); + return; + } + + //Get spell level + int nLevel = 0; //define it outside the loop + itemproperty ipTest = GetFirstItemProperty(oPotion); + + while(GetIsItemPropertyValid(ipTest)) + { + if(GetItemPropertyType(ipTest) == ITEM_PROPERTY_CAST_SPELL) + { + //Get row + int nRow = GetItemPropertySubType(ipTest); + + //Get spell level + nLevel = StringToInt(Get2DACache("iprp_spells", "InnateLvl", nRow)); + if(DEBUG) DoDebug("Spell level read as: " + IntToString(nLevel)); + + //no need to check rest of the ips + break; + } + ipTest = GetNextItemProperty(oPotion); + } + + //Remove potion being converted + int nStack = GetItemStackSize(oPotion); + + if(nStack > 1) SetItemStackSize(oPotion, (nStack - 1)); + + else DestroyObject(oPotion); + + //Create the grenade + object oGrenade = CreateItemOnObject("prc_it_enrgpot", oPC, 1); + + if(nSpell == SPELL_ENERGIZE_POTION_ACID) + { + SetLocalInt(oGrenade, "PRC_GrenadeDamageType", DAMAGE_TYPE_ACID); + SetLocalInt(oGrenade, "PRC_EnergizedPotionSave", SAVING_THROW_TYPE_ACID); + sDamageType = "Acid"; + } + + else if(nSpell == SPELL_ENERGIZE_POTION_COLD) + { + SetLocalInt(oGrenade, "PRC_GrenadeDamageType", DAMAGE_TYPE_COLD); + SetLocalInt(oGrenade, "PRC_EnergizedPotionSave", SAVING_THROW_TYPE_COLD); + sDamageType = "Cold"; + } + + else if(nSpell == SPELL_ENERGIZE_POTION_ELECTRICITY) + { + SetLocalInt(oGrenade, "PRC_GrenadeDamageType", DAMAGE_TYPE_ELECTRICAL); + SetLocalInt(oGrenade, "PRC_EnergizedPotionSave", SAVING_THROW_TYPE_ELECTRICITY); + sDamageType = "Electrical"; + } + + else if(nSpell == SPELL_ENERGIZE_POTION_FIRE) + { + SetLocalInt(oGrenade, "PRC_GrenadeDamageType", DAMAGE_TYPE_FIRE); + SetLocalInt(oGrenade, "PRC_EnergizedPotionSave", SAVING_THROW_TYPE_FIRE); + sDamageType = "Fire"; + } + + else if(nSpell == SPELL_ENERGIZE_POTION_SONIC) + { + SetLocalInt(oGrenade, "PRC_GrenadeDamageType", DAMAGE_TYPE_SONIC); + SetLocalInt(oGrenade, "PRC_EnergizedPotionSave", SAVING_THROW_TYPE_SONIC); + sDamageType = "Sonic"; + } + nLevel = min(20, nLevel); + SetLocalInt(oGrenade, "PRC_GrenadeLevel", nLevel); + SetLocalInt(oGrenade, "PRC_EnPotSaveDC", nDC); + + string sStrength; + + //Get strength string + switch(nLevel) + { + case 0: break; + + case 1: sStrength = "Weak"; + break; + case 2: sStrength = "Moderate"; + break; + case 3: sStrength = "Strong"; + break; + } + + SetName(oGrenade, sStrength + " " + "Energized" + " " + sDamageType + " " + "Potion"); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_exalt_fury.ncs b/35expandedspells/sp_exalt_fury.ncs new file mode 100644 index 00000000..2751c78b Binary files /dev/null and b/35expandedspells/sp_exalt_fury.ncs differ diff --git a/35expandedspells/sp_exalt_fury.nss b/35expandedspells/sp_exalt_fury.nss new file mode 100644 index 00000000..2520c356 --- /dev/null +++ b/35expandedspells/sp_exalt_fury.nss @@ -0,0 +1,83 @@ +//:://///////////////////////////////////////////// +//:: Name Exalted Fury +//:: FileName sp_exalt_fury.nss +//::////////////////////////////////////////////// +/**@file Exalted Fury +Evocation [Good] +Level: Sanctified 9 +Components: V, Sacrifice +Casting Time: 1 standard action +Range: 40 ft. +Area: 40-ft. radius burst, centered on you +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +Uttering a single, awesomely powerful syllable of +the Words of Creation, your body erupts in the same +holy power that shaped the universe at its birth. +All evil creatures within the area take damage equal +to your current hit points +50. + +Sacrifice: You die. You can be raised or resurrected +normally. + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nMetaMagic = PRCGetMetaMagicFeat(); + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + effect eVisLink = EffectLinkEffects(EffectVisualEffect(VFX_FNF_STRIKE_HOLY), EffectVisualEffect(VFX_FNF_SCREEN_BUMP)); + eVisLink = EffectLinkEffects(eVisLink, EffectVisualEffect(VFX_FNF_SUNBEAM)); + int nCasterLvl = PRCGetCasterLevel(oPC); + + //Damage = Hitpoints + 50 + int nDam = (GetCurrentHitPoints(oPC) + 50 + nCasterLvl); + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //You die, make it spectacular + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisLink, oPC); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(TRUE), oPC); + + //Loop + while(GetIsObjectValid(oTarget)) + { + //only looking for evil + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + //SR + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + //Hit 'em + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + } + } + + //cycle + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_exaltd_raim.ncs b/35expandedspells/sp_exaltd_raim.ncs new file mode 100644 index 00000000..d01cde57 Binary files /dev/null and b/35expandedspells/sp_exaltd_raim.ncs differ diff --git a/35expandedspells/sp_exaltd_raim.nss b/35expandedspells/sp_exaltd_raim.nss new file mode 100644 index 00000000..f6e822f9 --- /dev/null +++ b/35expandedspells/sp_exaltd_raim.nss @@ -0,0 +1,140 @@ +//:://///////////////////////////////////////////// +//:: Name Exalted Raiment +//:: FileName sp_exaltd_raim.nss +//::////////////////////////////////////////////// +/**@file Exalted Raiment +Abjuration +Level: Sanctified 6 +Components: V, DF, Sacrifice +Casting Time: 1 standard action +Range: Touch +Target: Robe, garment, or outfit touched +Duration: 1 minute/level +Saving Throw: Will negates (harmless, object) +Spell Resistance: Yes (harmless, object) + +You imbue a robe, priestly garment, or outfit of +regular clothing with divine power. The spell bestows +the following effects for the duration: + + - +1 sacred bonus to AC per five caster levels + (max +4 at 20th level) + + - Damage reduction 10/evil + + - Spell resistance 5 + 1/caster level (max SR 25 + at 20th level + + - Reduces ability damage due to spell casting by 1, + to a minimum of 1 point (but does not reduce the + sacrifice cost of this spell). + + Sacrifice: 1d4 points of Strength damage + +Author: Tenjac +Created: 6/28/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + + + +#include "prc_inc_spells" +#include "prc_ip_srcost.nss" + +int GetERSpellResistance(int nCasterLvl) +{ + int nSRBonus = min(nCasterLvl, 20); + int nIPConst; + + switch(nSRBonus) + { + case 0: break; + case 1: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_6; break; + case 2: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_7; break; + case 3: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_8; break; + case 4: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_9; break; + case 5: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_10; break; + case 6: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_11; break; + case 7: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_12; break; + case 8: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_13; break; + case 9: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_14; break; + case 10: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_15; break; + case 11: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_16; break; + case 12: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_17; break; + case 13: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_18; break; + case 14: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_19; break; + case 15: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_20; break; + case 16: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_21; break; + case 17: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_22; break; + case 18: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_23; break; + case 19: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_24; break; + case 20: nIPConst = IP_CONST_SPELLRESISTANCEBONUS_25; break; + } + + return nIPConst; +} + +void main() +{ + object oPC = OBJECT_SELF; + object oMyArmor = IPGetTargetedOrEquippedArmor(FALSE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nSR = GetERSpellResistance(nCasterLvl); + int nArmor = min(nCasterLvl / 5, 8); + float fDur = (60.0f * nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + //check to make sure it has no AC + int nBaseAC = GetBaseAC(oMyArmor); + int nBonusAC = GetACBonus(oMyArmor); + int nLevel = GetLevelByClass(CLASS_TYPE_ABJURANT_CHAMPION); + + if(nLevel > 0) + { + nBonusAC += nLevel; + } + + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + itemproperty ipArmor = ItemPropertyACBonus(nBonusAC += nArmor); + itemproperty ipDR = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_2, IP_CONST_DAMAGESOAK_10_HP); + itemproperty ipSR = ItemPropertyBonusSpellResistance(nSR); + + //object is valid but has no AC value (clothes, robes, etc). + if((GetIsObjectValid(oMyArmor))) + { + if(nBaseAC < 1) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUPER_HEROISM), oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oMyArmor, fDur); + IPSafeAddItemProperty(oMyArmor, ipArmor, fDur); + IPSafeAddItemProperty(oMyArmor, ipDR, fDur); + IPSafeAddItemProperty(oMyArmor, ipSR, fDur); + //SetLocalInt(oMyArmor, "PRC_Has_Exalted_Raiment", 1); + //DelayCommand(fDur, DeleteLocalInt(oMyArmor, "PRC_Has_Exalted_Raiment")); + } + else + { + SendMessageToPC(oPC, "Invalid item: Base AC > 0"); + return; + } + } + else + { + SendMessageToPC(oPC, "Target creature has no armor!"); + return; + } + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + + DoCorruptionCost(oPC, ABILITY_STRENGTH, d4(1), 0); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_extr_wtrele.ncs b/35expandedspells/sp_extr_wtrele.ncs new file mode 100644 index 00000000..70caa8b9 Binary files /dev/null and b/35expandedspells/sp_extr_wtrele.ncs differ diff --git a/35expandedspells/sp_extr_wtrele.nss b/35expandedspells/sp_extr_wtrele.nss new file mode 100644 index 00000000..9c3af967 --- /dev/null +++ b/35expandedspells/sp_extr_wtrele.nss @@ -0,0 +1,120 @@ +//:://///////////////////////////////////////////// +//:: Name Extract Water Elemental +//:: FileName sp_extr_wtrele.nss +//::////////////////////////////////////////////// +/**@file Extract Water Elemental +Transmutation [Water] +Level: Druid 6, sorcerer/wizard 6 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./level) +Target: One living creature +Duration: Instantaneous +Saving Throw: Fortitude half +Spell Resistance: Yes + +This brutal spell causes the targeted +creature to dehydrate horribly as the +moisture in its body is forcibly extracted +through its eyes, nostrils, mouth, and +pores. This deals 1d6 points of damage +per caster level (maximum 20d6), or +half damage on a successful Fortitude +save. If the targeted creature is slain +by this spell, the extracted moisture is +transformed into a water elemental of +a size equal to the slain creature (up to +Huge). The water elemental is under +your control, as if you summoned it, +and disappears after 1 minute. + +Author: Tenjac +Created: 6/28/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +void SummonElemental(object oTarget, object oPC); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam = d6(min(nCasterLvl, 40)); + int nSaveDC = PRCGetSaveDC(oTarget, oPC); + int nType = MyPRCGetRacialType(oTarget); + + if(!PRCGetIsAliveCreature(oTarget)) + + { + SendMessageToPC(oPC, "This spell must be cast on a living target"); + PRCSetSchool(); + return; + } + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(min(nCasterLvl, 40)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //SR check + if(!PRCDoResistSpell(oPC, oTarget, (nCasterLvl + SPGetPenetr()))) + { + //VFX + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_PULSE_WATER), oTarget); + + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_SPELL)) + { + nDam = nDam/2; + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + + if(GetIsDead(oTarget)) + { + SummonElemental(oTarget, oPC); + } + } + PRCSetSchool(); +} + +void SummonElemental(object oTarget, object oPC) +{ + location lLoc = GetLocation(oTarget); + int nSize = GetCreatureSize(oTarget); + string sResref; + + if(nSize == CREATURE_SIZE_HUGE) sResref = "nw_watergreat"; + + else if (nSize == CREATURE_SIZE_LARGE) sResref = "nw_waterhuge"; + + else if (nSize == CREATURE_SIZE_MEDIUM) sResref = "nw_water"; + + else if (nSize == CREATURE_SIZE_SMALL) sResref = "nw_water"; + + else if (nSize == CREATURE_SIZE_TINY) sResref = "nw_water"; + + else + { + SendMessageToPC(oPC, "Creature Size Invalid"); + return; + } + + MultisummonPreSummon(); + + effect eSummon = EffectSummonCreature(sResref, VFX_FNF_SUMMON_EPIC_UNDEAD); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, lLoc, 60.0f); +} \ No newline at end of file diff --git a/35expandedspells/sp_false_life.ncs b/35expandedspells/sp_false_life.ncs new file mode 100644 index 00000000..259e8bf6 Binary files /dev/null and b/35expandedspells/sp_false_life.ncs differ diff --git a/35expandedspells/sp_false_life.nss b/35expandedspells/sp_false_life.nss new file mode 100644 index 00000000..b7931cbf --- /dev/null +++ b/35expandedspells/sp_false_life.nss @@ -0,0 +1,61 @@ +//:://///////////////////////////////////////////// +//:: Name False Life +//:: FileName sp_false_life.nss +//::////////////////////////////////////////////// +/**@file False Life +Necromancy +Level: Sor/Wiz 2, Hexblade 2 +Components: V, S, M +Casting Time: 1 standard action +Range: Personal +Target: You +Duration: 1 hour/level or until discharged; see text + +You harness the power of unlife to grant yourself a +limited ability to avoid death. While this spell is +in effect, you gain temporary hit points equal to +1d10 +1 per caster level (maximum +10). + +Material Component: A small amount of alcohol or +distilled spirits, which you use to trace certain +sigils on your body during casting. These sigils +cannot be seen once the alcohol or spirits evaporate. + +**/ + +#include "prc_alterations" +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDur = HoursToSeconds(nCasterLvl); + if(nMetaMagic & METAMAGIC_EXTEND) + fDur *= 2; + + int nBonus = d10(1) + (min(20, nCasterLvl)); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nBonus = 10 + (min(20, nCasterLvl)); + if(nMetaMagic & METAMAGIC_EMPOWER) + nBonus += (nBonus/2); + + PRCRemoveEffectsFromSpell(oPC, SPELL_FALSE_LIFE); + + PRCSignalSpellEvent(oPC, FALSE, SPELL_FALSE_LIFE, oPC); + + effect eHP = EffectTemporaryHitpoints(nBonus); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eHP, eDur); + effect eVis = EffectVisualEffect(VFX_IMP_HEAD_EVIL); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, fDur, TRUE, SPELL_FALSE_LIFE, nCasterLvl, oPC); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_fester_death.ncs b/35expandedspells/sp_fester_death.ncs new file mode 100644 index 00000000..fb69ae26 Binary files /dev/null and b/35expandedspells/sp_fester_death.ncs differ diff --git a/35expandedspells/sp_fester_death.nss b/35expandedspells/sp_fester_death.nss new file mode 100644 index 00000000..fa82c027 --- /dev/null +++ b/35expandedspells/sp_fester_death.nss @@ -0,0 +1,91 @@ +//:://///////////////////////////////////////////// +//:: Name Song of Festering Death +//:: FileName sp_fester_death.nss +//::////////////////////////////////////////////// +/**@file Song of Festering Death +Evocation [Evil] +Level: Brd 2 +Components: V +Casting Time: 1 action +Range: Close (25 ft. + 5 ft./2 levels) +Target: One living creature +Duration: Concentration +Saving Throw: Fortitude negates +Spell Resistance: Yes + +The caster sings a wailing ululation, requiring a +successful Perform (singing) check (DC 20). If the +Perform check succeeds and the target fails a +Fortitude saving throw, the subject's flesh +bubbles and festers into pestilent blobs, dealing +the subject 2d6 points of damage each round. If the +subject dies, she bursts with a sickening pop as +steamy gore spills onto the ground. + +Author: Tenjac +Created: 3/26/05 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void FesterLoop(object oTarget, int nConc, int nHP) +{ + if (nConc == FALSE) + { + return; + } + + int nDam = d6(20); + nHP = GetCurrentHitPoints(oTarget); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + + if(nDam > nHP) + { + //esplode! + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(TRUE, TRUE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + } + else + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + + //Loop + DelayCommand(6.0f, FesterLoop(oTarget, nConc, nHP)); + +} + + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nConc = TRUE; + int nDC = PRCGetSaveDC(oTarget, oPC); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nHP = GetCurrentHitPoints(oTarget); + + //Check for skill + if(GetIsSkillSuccessful(oPC, SKILL_PERFORM, 20) && PRCGetIsAliveCreature(oTarget)) + { + //Spell Resist + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL, oPC, 1.0)) + { + FesterLoop(oTarget, nConc, nHP); + } + } + } + + //SPEvilShift(oPC); + PRCSetSchool(); +} diff --git a/35expandedspells/sp_fire_trapA.ncs b/35expandedspells/sp_fire_trapA.ncs new file mode 100644 index 00000000..cff3dcf2 Binary files /dev/null and b/35expandedspells/sp_fire_trapA.ncs differ diff --git a/35expandedspells/sp_fire_trapA.nss b/35expandedspells/sp_fire_trapA.nss new file mode 100644 index 00000000..5e97ea1f --- /dev/null +++ b/35expandedspells/sp_fire_trapA.nss @@ -0,0 +1,107 @@ +//:://///////////////////////////////////////////// +//:: Name +//:: FileName sp_.nss +//::////////////////////////////////////////////// +/**@file Fire Trap +Abjuration [Fire] +Level: Drd 2, Sor/Wiz 4 +Components: V, S, M +Casting Time: 10 minutes +Range: Touch +Target: Area +Duration: Permanent until discharged (D) +Saving Throw: Reflex half; see text +Spell Resistance: Yes + +Fire trap creates a fiery explosion when an intruder +enters the area that the trap protects. + +When casting fire trap, you select a point as the spell’s +center. When someone other than you gets too close to that +point, a fiery explosion fills the area within a 5-foot radius around +the spell’s center. The flames deal 1d4 points of fire damage +1 +point per caster level (maximum +20). + +An unsuccessful dispel magic spell does not detonate the +spell. + +Underwater, this ward deals half damage and creates a +large cloud of steam. + +Material Component: A half-pound of gold dust (cost 25 gp) +sprinkled on the warded object. + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + location lTarget = GetLocation(OBJECT_SELF); + int nDam; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + if(nCasterLvl > 40) nCasterLvl = 40; + + int nFire = GetLocalInt(OBJECT_SELF, "PRC_SPELL_FIRE_TRAP"); + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE); + + effect eDam; + effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + //Check the faction of the entering object to make sure the entering object is not in the casters faction + if(nFire == 0) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + SetLocalInt(OBJECT_SELF, "PRC_SPELL_FIRE_TRAP",TRUE); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Cycle through the targets in the explosion area + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_FIRE_TRAP)); + //Make SR check + if(!PRCDoResistSpell(oCaster, oTarget,nCasterLvl + SPGetPenetr())) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + nDam = d4(1) + nCasterLvl; + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 4 + nCasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) nDam +=(nDam/2); + + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Change damage according to Reflex, Evasion and Improved Evasion + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nDC, SAVING_THROW_TYPE_FIRE, GetAreaOfEffectCreator()); + //Set up the damage effect + eDam = PRCEffectDamage(oTarget, nDam, EleDmg); + if(nDam > 0) + { + //Apply VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Get next target in the sequence + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + DestroyObject(OBJECT_SELF, 1.0); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_fireburst.ncs b/35expandedspells/sp_fireburst.ncs new file mode 100644 index 00000000..172929d2 Binary files /dev/null and b/35expandedspells/sp_fireburst.ncs differ diff --git a/35expandedspells/sp_fireburst.nss b/35expandedspells/sp_fireburst.nss new file mode 100644 index 00000000..c80c9f47 --- /dev/null +++ b/35expandedspells/sp_fireburst.nss @@ -0,0 +1,24 @@ +///////////////////////////////////////////////////////////////////// +// +// Firestorm - Burst of fire centered on the caster doing 1d8/lvl, +// max 5d8 +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_burst" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDice = nCasterLvl; + if (nDice > 20) nDice = 20; + + DoBurst (nCasterLvl,8, 0, nDice, VFX_IMP_FLAME_M, VFX_IMP_FLAME_S, 2.0f, + DAMAGE_TYPE_FIRE, DAMAGE_TYPE_FIRE, SAVING_THROW_TYPE_FIRE, TRUE); +} diff --git a/35expandedspells/sp_flesh_armor.ncs b/35expandedspells/sp_flesh_armor.ncs new file mode 100644 index 00000000..80fa3515 Binary files /dev/null and b/35expandedspells/sp_flesh_armor.ncs differ diff --git a/35expandedspells/sp_flesh_armor.nss b/35expandedspells/sp_flesh_armor.nss new file mode 100644 index 00000000..0c41b1f4 --- /dev/null +++ b/35expandedspells/sp_flesh_armor.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Name Flesh Armor +//:: FileName sp_flesh_armor.nss +//::////////////////////////////////////////////// +/**@file Flesh Armor +Abjuration [Evil] +Level: Asn 4 +Components: V, S, M, F +Casting Time: 1 action +Range: Personal +Target: Caster +Duration: 10 minutes/level or until discharged + + Prior to casting flesh armor, the caster flays the + skin from a creature of his size and lays it upon + his own flesh, wearing it like clothing or armor. + Once the caster casts flesh armor, his skin develops + resistance to blows, cuts, stabs, and slashes. The + caster gains damage reduction 10/+1. Once the spell + has prevented a total of 5 points of damage per + caster level (maximum 50 points), it is discharged, + and the skin slowly rots, shedding in patches like + the skin of a molting snake. + + Material Component: A bit of flesh torn from + the caster's body during the casting (dealing 1 point + of damage). + + Focus: The entire freshly harvested skin of another + creature of the caster's size. + +Author: Tenjac +Created: 05/05/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + float fDur= (600.0f * nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nAmount = min(50 + (nCasterLvl/2), (5 * nCasterLvl)); + effect eDR = EffectDamageReduction(10 + (nCasterLvl/2), DAMAGE_POWER_PLUS_ONE, nAmount); + + //placeholder VFX + effect eVis = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + //Spellhook + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + //Meta Magic + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur = (fDur * 2); + } + + //Link and Apply + + effect eLink = EffectLinkEffects(eDR, eVis); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, fDur); + + //SPEvilShift(oPC); + + PRCSetSchool(); + } + + + + + + \ No newline at end of file diff --git a/35expandedspells/sp_flesh_rip.ncs b/35expandedspells/sp_flesh_rip.ncs new file mode 100644 index 00000000..b147f6b5 Binary files /dev/null and b/35expandedspells/sp_flesh_rip.ncs differ diff --git a/35expandedspells/sp_flesh_rip.nss b/35expandedspells/sp_flesh_rip.nss new file mode 100644 index 00000000..84899fb7 --- /dev/null +++ b/35expandedspells/sp_flesh_rip.nss @@ -0,0 +1,105 @@ +//:://///////////////////////////////////////////// +//:: Name Flesh Ripper +//:: FileName sp_flesh_rip +//::////////////////////////////////////////////// +/**@file Flesh Ripper +Evocation [Evil] +Level: Clr 3, Mortal Hunter 3 +Components: V, S, Undead, Fiend +Casting Time: 1 action +Range: Close (25 ft. + 5 ft./2 levels) +Target: One living creature +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +The caster evokes pure evil power in the form of a +black claw that flies at the target. If a ranged +touch attack roll succeeds, the claw deals 1d8 +points of damage per caster level (maximum 10d8). +On a critical hit, in addition to dealing double +damage, the wound bleeds for 1 point of damage per +round until it is magically healed. + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Spellhook + if (!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nType = MyPRCGetRacialType(oPC); + int nType2 = MyPRCGetRacialType(oTarget); + int nDice = min(20, nCasterLvl); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_FLESH_RIPPER, oPC); + + //Caster must be undead. If not, hit 'em with alignment change anyway. + //Try reading the description of the spell moron. =P + + if(nType == RACIAL_TYPE_UNDEAD) + { + //check for living target + if(PRCGetIsAliveCreature(oTarget)) + { + //Check spell resistance + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + int nDam = d8(nDice); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = (8 * nDice); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //Non-descript + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + + //VFX + effect eVis = EffectBeam(VFX_BEAM_BLACK, oPC, BODY_NODE_HAND); + + //Make touch attack + int nTouch = PRCDoRangedTouchAttack(oTarget); + + if(nTouch > 0) + { + //Apply VFX + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + + if(nTouch = 2) + { + //Apply damage + nDam += nDam; + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + + //Wounding + effect eWound = EffectHitPointChangeWhenDying(1.0f); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eWound, oTarget); + } + } + } + } + //SPEvilShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_forceblast.ncs b/35expandedspells/sp_forceblast.ncs new file mode 100644 index 00000000..c113ad05 Binary files /dev/null and b/35expandedspells/sp_forceblast.ncs differ diff --git a/35expandedspells/sp_forceblast.nss b/35expandedspells/sp_forceblast.nss new file mode 100644 index 00000000..6294221c --- /dev/null +++ b/35expandedspells/sp_forceblast.nss @@ -0,0 +1,17 @@ +#include "prc_inc_spells" +#include "spinc_bolt" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int nDice = nCasterLevel > 20 ? 20 : nCasterLevel; + + DoBolt (nCasterLevel,4, 0, nDice, VFX_BEAM_MIND, VFX_IMP_MAGBLUE, + DAMAGE_TYPE_MAGICAL, SAVING_THROW_TYPE_SPELL, + SPELL_SCHOOL_EVOCATION, TRUE, GetSpellId()); +} + diff --git a/35expandedspells/sp_forceorb.ncs b/35expandedspells/sp_forceorb.ncs new file mode 100644 index 00000000..8ca18835 Binary files /dev/null and b/35expandedspells/sp_forceorb.ncs differ diff --git a/35expandedspells/sp_forceorb.nss b/35expandedspells/sp_forceorb.nss new file mode 100644 index 00000000..856e84a1 --- /dev/null +++ b/35expandedspells/sp_forceorb.nss @@ -0,0 +1,77 @@ +#include "prc_inc_spells" +#include "prc_add_spell_dc" +#include "prc_inc_sp_tch" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + object oCaster = OBJECT_SELF; + effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE); + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + int nSpellId = PRCGetSpellId(); + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nDice = nCasterLvl; + if (nDice > 40) nDice = 40; + + int nAtk = PRCDoRangedTouchAttack(oTarget, TRUE, oCaster); + if(nAtk) + { + //Make SR Check + if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl)) + { + effect eMissile = EffectVisualEffect(VFX_IMP_MIRV); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget, TRUE, nSpellId); + + //Roll damage for each target + int nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_MAGICAL, nDice, 6); + // Succeeded on the save + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, oCaster))) + nDamage = nDamage/2; + + // Apply the damage and the damage visible effect to the target. + ApplyTouchAttackDamage(oCaster, oTarget, nAtk, nDamage, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + else // If it misses, it becomes an AoE + { + location lTarget = PRCGetSpellTargetLocation(); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellId)); + //Get the distance between the explosion and the target to calculate delay + float fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl, fDelay)) + { + int nDamage = nDice * 2; + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget, oCaster)), SAVING_THROW_TYPE_SPELL); + if(nDamage > 0) + { + //Set the damage effect + effect eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL); + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_gfireburst.ncs b/35expandedspells/sp_gfireburst.ncs new file mode 100644 index 00000000..b5b9c9ea Binary files /dev/null and b/35expandedspells/sp_gfireburst.ncs differ diff --git a/35expandedspells/sp_gfireburst.nss b/35expandedspells/sp_gfireburst.nss new file mode 100644 index 00000000..d63468c6 --- /dev/null +++ b/35expandedspells/sp_gfireburst.nss @@ -0,0 +1,24 @@ +///////////////////////////////////////////////////////////////////// +// +// Greater Firestorm - Burst of fire centered on the caster doing +// 1d8/lvl, max 15d8 +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_burst" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDice = nCasterLvl; + if (nDice > 40) nDice = 40; + + DoBurst (nCasterLvl,8, 0, nDice, VFX_FNF_FIREBALL, VFX_IMP_FLAME_M, 4.0f, + DAMAGE_TYPE_FIRE, DAMAGE_TYPE_FIRE, SAVING_THROW_TYPE_FIRE, TRUE); +} diff --git a/35expandedspells/sp_gheroism.ncs b/35expandedspells/sp_gheroism.ncs new file mode 100644 index 00000000..9a1050d8 Binary files /dev/null and b/35expandedspells/sp_gheroism.ncs differ diff --git a/35expandedspells/sp_gheroism.nss b/35expandedspells/sp_gheroism.nss new file mode 100644 index 00000000..9daae72c --- /dev/null +++ b/35expandedspells/sp_gheroism.nss @@ -0,0 +1,37 @@ +#include "prc_inc_spells" +#include "prc_spell_const" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); + + // Get the target and raise the spell cast event. + object oTarget = PRCGetSpellTargetObject(); + PRCSignalSpellEvent(oTarget, FALSE); + + if(GetHasSpellEffect(SPELL_HEROISM, oTarget)) + { + PRCRemoveSpellEffects(SPELL_HEROISM,OBJECT_SELF,OBJECT_SELF); + } + + // Determine the spell's duration, taking metamagic feats into account. + int nCasterlvl = PRCGetCasterLevel(); + float fDuration = PRCGetMetaMagicDuration(TenMinutesToSeconds(nCasterlvl)); + + // Create the chain of buffs to apply, including the vfx. + effect eBuff = EffectSavingThrowIncrease(SAVING_THROW_ALL, 4, SAVING_THROW_TYPE_ALL); + eBuff = EffectLinkEffects (eBuff, EffectAttackIncrease(4, ATTACK_BONUS_MISC)); + eBuff = EffectLinkEffects (eBuff, EffectSkillIncrease(SKILL_ALL_SKILLS, 4)); + eBuff = EffectLinkEffects (eBuff, EffectImmunity(IMMUNITY_TYPE_FEAR)); + //improperly removing gheroism when temp hp expire; fix by unlinking temp hp from other effect ~ Lockindal + effect eTempHP = EffectTemporaryHitpoints(nCasterlvl > 40 ? 40 : nCasterlvl); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterlvl); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTempHP, oTarget, fDuration,TRUE,-1,nCasterlvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RESTORATION), oTarget); + + PRCSetSchool(SPELL_SCHOOL_ENCHANTMENT); +} diff --git a/35expandedspells/sp_gutwrench.ncs b/35expandedspells/sp_gutwrench.ncs new file mode 100644 index 00000000..f4d8e9cd Binary files /dev/null and b/35expandedspells/sp_gutwrench.ncs differ diff --git a/35expandedspells/sp_gutwrench.nss b/35expandedspells/sp_gutwrench.nss new file mode 100644 index 00000000..3f360357 --- /dev/null +++ b/35expandedspells/sp_gutwrench.nss @@ -0,0 +1,121 @@ +//:://///////////////////////////////////////////// +//:: Name Gutwrench +//:: FileName sp_gutwrench.nss +//::////////////////////////////////////////////// +/**@file Gutwrench +Necromancy [Evil, Death] +Level: Sor/Wiz 8 +Components: V, S, Undead +Casting Time: 1 action +Range: Close (25 ft. + 5 ft./2 levels) +Target: One living creature +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: Yes + +The innards of the target creature roil. If the +target fails its saving throw, its intestines burst +forth, killing it. The intestines fly toward the +caster and are absorbed into her form, granting her +4d6 temporary hit points and a +4 enhancement bonus +to Strength. If the target's save is successful, it +takes 10d6 points of damage instead. + +A creature with no discernible anatomy is unaffected +by this spell. + +Author: Tenjac +Created: 16.3.2006 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + //Spellhook + if (!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nTargetType = MyPRCGetRacialType(oTarget); + int nDC = PRCGetSaveDC(oTarget, oPC); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_GUTWRENCH, oPC); + + //Caster must be undead. If not, hit 'em with alignment change anyway. + //Try reading the description of the spell moron. =P + + if(MyPRCGetRacialType(oPC) == RACIAL_TYPE_UNDEAD) + { + if(nTargetType != RACIAL_TYPE_OOZE && + nTargetType != RACIAL_TYPE_CONSTRUCT && + nTargetType != RACIAL_TYPE_UNDEAD && + nTargetType != RACIAL_TYPE_ELEMENTAL) + + { + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DEATH)) + { + //define effects + effect eDeath = EffectDeath(); + effect eGut = EffectBeam(VFX_BEAM_SILENT_EVIL, oTarget, BODY_NODE_CHEST); + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eBonus = EffectAbilityIncrease(ABILITY_STRENGTH, 4); + effect eLink = EffectLinkEffects(eDeath, eGut); + + //Apply to target + DeathlessFrenzyCheck(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); + + //PC + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oPC, HoursToSeconds(24)); + } + + //Otherwise, take 10d6 damage, be thankful, and RUN. + else + { + if(!GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + int nDam = d6(10)+nCasterLvl; + + //evaluate metamagic + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 60+nCasterLvl; + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //define damage + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + } + } + } + } + else + { + FloatingTextStringOnCreature("Caster is not Undead! Spell failed.", oPC, FALSE); + } + + //SPEvilShift(oPC); + + PRCSetSchool(); +} + diff --git a/35expandedspells/sp_hailofstone.ncs b/35expandedspells/sp_hailofstone.ncs new file mode 100644 index 00000000..9bd08c89 Binary files /dev/null and b/35expandedspells/sp_hailofstone.ncs differ diff --git a/35expandedspells/sp_hailofstone.nss b/35expandedspells/sp_hailofstone.nss new file mode 100644 index 00000000..ae95ec97 --- /dev/null +++ b/35expandedspells/sp_hailofstone.nss @@ -0,0 +1,68 @@ +#include "prc_inc_sp_tch" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Apply area vfx. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, + EffectVisualEffect(VFX_COM_CHUNK_STONE_SMALL), lTarget); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, + EffectVisualEffect(356 /*VFX_FNF_SCREEN_SHAKE2*/), lTarget); + + float fDelay; + + // Determine damage dice. + int nCasterLvl = PRCGetCasterLevel(); + int nDice = nCasterLvl; + if (nDice > 20) nDice = 20; + int nPenetr = nCasterLvl + SPGetPenetr(); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + int nTargets = 0; + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, FALSE, + OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while (GetIsObjectValid(oTarget)) + { + fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + // Make touch attack, saving result for possible critical + int nTouchAttack = PRCDoRangedTouchAttack(oTarget);; + if (nTouchAttack > 0) + { + // Roll the damage of (1d6+1) / level, doing double damage on a crit. + int nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_BLUDGEONING, + 1 == nTouchAttack ? nDice : (nDice * 2), 4); + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + + // Apply the damage and the damage visible effect to the target. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, + PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_BLUDGEONING), oTarget); + PRCBonusDamage(oTarget); +//TODO: need VFX +// SPApplyEffectToObject(DURATION_TYPE_INSTANT, +// EffectVisualEffect(VFX_IMP_FROST_S), oTarget); + } + } + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, FALSE, + OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_healrbm.ncs b/35expandedspells/sp_healrbm.ncs new file mode 100644 index 00000000..c5927cac Binary files /dev/null and b/35expandedspells/sp_healrbm.ncs differ diff --git a/35expandedspells/sp_healrbm.nss b/35expandedspells/sp_healrbm.nss new file mode 100644 index 00000000..791c95aa --- /dev/null +++ b/35expandedspells/sp_healrbm.nss @@ -0,0 +1,21 @@ +///////////////////////////////////////////////////////// +// Healer's Balm +// sp_healrbm.nss +///////////////////////////////////////////////////////// +/*Healer’s Balm: This smooth, sweet-smelling balm +allows a healer to better soothe the effects of wounds, disease, +and poison. Healer’s balm provides a +1 alchemical +bonus on Heal checks made to help an affected creature. +The effects of healer’s balm last for 1 minute. +One dose of healer’s balm is enough to coat one +Medium creature. Applying healer’s balm is a standard +action that provokes attacks of opportunity. It can be +applied as part of a standard action made to administer +first aid, treat a wound, or treat poison. */ + +void main() +{ + object oPC = OBJECT_SELF; + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSkillIncrease(SKILL_HEAL, 5), oPC, TurnsToSeconds(1)); + SendMessageToPC(oPC, "You coat your hands in Healer's Balm."); +} \ No newline at end of file diff --git a/35expandedspells/sp_hellfire.ncs b/35expandedspells/sp_hellfire.ncs new file mode 100644 index 00000000..fde75778 Binary files /dev/null and b/35expandedspells/sp_hellfire.ncs differ diff --git a/35expandedspells/sp_hellfire.nss b/35expandedspells/sp_hellfire.nss new file mode 100644 index 00000000..e37ab87d --- /dev/null +++ b/35expandedspells/sp_hellfire.nss @@ -0,0 +1,87 @@ +//:://///////////////////////////////////////////// +//:: Name Hellfire +//:: FileName sp_hellfire.nss +//::////////////////////////////////////////////// +/**@file Hellfire +Evocation [Evil] +Level: Diabolic 4 +Components: V, S +Casting Time: 1 action +Range: Close (25 ft. + 5 ft./2 levels) +Area: 5-ft.-radius spread +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +The caster creates a small explosion of brimstone +and fire that deals 3d6 points of special diabolic +fire damage. The diabolic flames are not subject +to being reduced by protection from elements +(fire), fire shield (chill shield), or similar +magic. + +Author: Tenjac +Created: 05/03/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + + +void main() +{ + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + effect eVis = EffectVisualEffect(806); + effect eExplode = EffectVisualEffect(VFX_FNF_HELLFIRE); + effect eDam; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDamage; + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDelay; + + //Spellhook + if(!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lLoc); + + //get initial oTarget + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + + //damage loop + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Roll damage for each target + nDamage = d6(nCasterLvl/2)+3; + + //Resolve metamagic + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDamage =(nCasterLvl/2)*6 +3; + } + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDamage = nDamage + nDamage / 2; + } + + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + //SPEvilShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_heroism.ncs b/35expandedspells/sp_heroism.ncs new file mode 100644 index 00000000..8a9d07c4 Binary files /dev/null and b/35expandedspells/sp_heroism.ncs differ diff --git a/35expandedspells/sp_heroism.nss b/35expandedspells/sp_heroism.nss new file mode 100644 index 00000000..99218010 --- /dev/null +++ b/35expandedspells/sp_heroism.nss @@ -0,0 +1,78 @@ +/* + sp_heroism + + Consolidation of Heroism, Greater Heroism + + By: Flaming_Sword + Created: Jul 1, 2006 + Modified: Jul 1, 2006 + + Fixed typo +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nSpellID = PRCGetSpellId(); + PRCSignalSpellEvent(oTarget, FALSE); + int bGreater = (nSpellID == SPELL_GREATER_HEROISM); + if(bGreater && GetHasSpellEffect(SPELL_HEROISM, oTarget)) + { + PRCRemoveSpellEffects(SPELL_HEROISM, oCaster, oTarget); + } + else if(!bGreater && GetHasSpellEffect(SPELL_GREATER_HEROISM, oTarget)) + { + FloatingTextStringOnCreature("Target already has Greater Heroism Effect!", oCaster); + return TRUE; + } + float fDuration = PRCGetMetaMagicDuration(TenMinutesToSeconds(nCasterLevel)); + int nBonus = (bGreater) ? 4 : 2; + // Create the chain of buffs to apply, including the vfx. + effect eBuff = EffectSavingThrowIncrease(SAVING_THROW_ALL, nBonus, SAVING_THROW_TYPE_ALL); + eBuff = EffectLinkEffects (eBuff, EffectAttackIncrease(nBonus, ATTACK_BONUS_MISC)); + eBuff = EffectLinkEffects (eBuff, EffectSkillIncrease(SKILL_ALL_SKILLS, nBonus)); + if(bGreater) + eBuff = EffectLinkEffects (eBuff, EffectImmunity(IMMUNITY_TYPE_FEAR)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLevel); + //improperly removing gheroism when temp hp expire; fix by unlinking temp hp from other effect ~ Lockindal + if(bGreater) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTemporaryHitpoints(nCasterLevel > 40 ? 40 : nCasterLevel), oTarget, fDuration,TRUE,-1,nCasterLevel); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RESTORATION), oTarget); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_hf_storm.ncs b/35expandedspells/sp_hf_storm.ncs new file mode 100644 index 00000000..18368249 Binary files /dev/null and b/35expandedspells/sp_hf_storm.ncs differ diff --git a/35expandedspells/sp_hf_storm.nss b/35expandedspells/sp_hf_storm.nss new file mode 100644 index 00000000..2d903a4c --- /dev/null +++ b/35expandedspells/sp_hf_storm.nss @@ -0,0 +1,85 @@ +//:://///////////////////////////////////////////// +//:: Name Hellfire Storm +//:: FileName sp_hf_storm.nss +//::////////////////////////////////////////////// +/**@file Hellfire Storm +Evocation [Evil] +Level: Diabolic 7 +Range: Medium (100 ft. + 10 ft./level) +Area: 20-ft.-radius spread + +As hellfire, except in area and range and that the +spell deals 5d6 points of special diabolic fire damage. + +Author: Tenjac +Created: +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + //Declare major variables + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + effect eExplode = EffectVisualEffect(807); + effect eVis = EffectVisualEffect(VFX_FNF_HELLFIRESTORM); + effect eDam; + + //spellhook + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + if (!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl)) + { + //Roll damage for each target + nDamage = d6(nCasterLvl)+5; + + //Resolve metamagic + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDamage = 6*(nCasterLvl)+5; + } + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDamage = nDamage + nDamage / 2; + } + + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + //SPEvilShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_ice_knife.ncs b/35expandedspells/sp_ice_knife.ncs new file mode 100644 index 00000000..e4342531 Binary files /dev/null and b/35expandedspells/sp_ice_knife.ncs differ diff --git a/35expandedspells/sp_ice_knife.nss b/35expandedspells/sp_ice_knife.nss new file mode 100644 index 00000000..48fa67b9 --- /dev/null +++ b/35expandedspells/sp_ice_knife.nss @@ -0,0 +1,130 @@ +//:://///////////////////////////////////////////// +//:: Name Ice Knife +//:: FileName sp_ice_knife.nss +//::////////////////////////////////////////////// +/**@file Ice Knife +Conjuration (Creation) [Cold] +Level: Assassin 2, wu jen 2 (water),warmage 2 +Components: S, M +Casting Time: 1 standard action +Range: Long (400 ft. + 40 ft./level) +Effect: One icy missile +Duration: Instantaneous +Saving Throw: See text +Spell Resistance: Yes + +A magical shard of ice blasts from your +hand and speeds to its target. You must +succeed on a normal ranged attack to +hit (with a +2 bonus on the attack roll +for every two caster levels). If it hits, +an ice knife deals 2d8 points of cold +damage plus 2 points of Dexterity damage +(no Dexterity damage on a successful +Fortitude save). Creatures that have +immunity to cold damage also take no +Dexterity damage automatically. + +A knife that misses creates a shower +of ice crystals in a 10-foot-radius burst. +The icy burst deals 1d8 points of cold +damage to all creatures within the area +of the effect (Reflex half). + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "x0_i0_position" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + location lTarget = GetLocation(oTarget); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDC = PRCGetSaveDC(oTarget, oCaster); + int nAttackBonus = (nCasterLvl/2)*2; + int iAttackRoll = PRCDoRangedTouchAttack(oTarget, TRUE, oCaster, nAttackBonus); + int nDamageType = ChangedElementalDamage(oCaster, DAMAGE_TYPE_COLD); + int nDam; + effect eImp = EffectVisualEffect(VFX_IMP_FROST_S); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_L); + effect eDam; + + nCasterLvl += SPGetPenetr(); + + if(iAttackRoll) + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ICE_KNIFE)); + + if(!PRCDoResistSpell(oCaster, oTarget, nCasterLvl)) + { + nDam = d8(nCasterLvl/4)+2; + if (nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 8*(nCasterLvl/4)+2; + if (nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + //if failed, ability damage + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_COLD)) + { + int nDexPenalty = 2 * iAttackRoll;//double damage in case of *Critical Hit* + ApplyAbilityDamage(oTarget, ABILITY_DEXTERITY, nDexPenalty, DURATION_TYPE_TEMPORARY, TRUE, -1.0f); + } + + //Apply damage even if they are immune - can't hurt + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDam, nDamageType); + PRCBonusDamage(oTarget); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget); + } + } + else + { + //missed, so do AoE + float fDistance = IntToFloat(Random(9)); //random distance for new loc + float fAngle = IntToFloat(Random(359)); //random angle from original + + //Orientation doesn't matter, so make it 0.0f + location lAoE = GenerateNewLocationFromLocation(lTarget, fDistance, fAngle, 0.0f); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lAoE); + + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0f), lAoE, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR); + + while(GetIsObjectValid(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ICE_KNIFE)); + + if(!PRCDoResistSpell(oCaster, oTarget, nCasterLvl)) + { + nDam = d8(nCasterLvl/4)+1; + if (nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 8*(nCasterLvl/4)+1; + if (nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nDC, SAVING_THROW_TYPE_COLD); + + if(nDam > 0) + { + eDam = PRCEffectDamage(oTarget, nDam, nDamageType); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget); + PRCBonusDamage(oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0f), lAoE, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_DOOR); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_iceburst.ncs b/35expandedspells/sp_iceburst.ncs new file mode 100644 index 00000000..e60ff2db Binary files /dev/null and b/35expandedspells/sp_iceburst.ncs differ diff --git a/35expandedspells/sp_iceburst.nss b/35expandedspells/sp_iceburst.nss new file mode 100644 index 00000000..cf748c75 --- /dev/null +++ b/35expandedspells/sp_iceburst.nss @@ -0,0 +1,19 @@ +#include "prc_inc_spells" +#include "spinc_burst" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the number of damage dice. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDice = nCasterLvl; + if (nDice > 20) nDice = 20; + + // Ice burst is a colossal radius burst doing 1d4+10/level (cap at 10) cold damage. + DoBurst (nCasterLvl,4, 1, nDice, + VFX_FNF_ICESTORM, VFX_IMP_FROST_S, + RADIUS_SIZE_GARGANTUAN, DAMAGE_TYPE_COLD, DAMAGE_TYPE_BLUDGEONING, SAVING_THROW_TYPE_COLD); +} diff --git a/35expandedspells/sp_impmagearm.ncs b/35expandedspells/sp_impmagearm.ncs new file mode 100644 index 00000000..e9730596 Binary files /dev/null and b/35expandedspells/sp_impmagearm.ncs differ diff --git a/35expandedspells/sp_impmagearm.nss b/35expandedspells/sp_impmagearm.nss new file mode 100644 index 00000000..50c0112c --- /dev/null +++ b/35expandedspells/sp_impmagearm.nss @@ -0,0 +1,38 @@ +#include "prc_inc_spells" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + // Declare major variables + object oTarget = PRCGetSpellTargetObject(); + + // Signal the spell cast at event + PRCSignalSpellEvent(oTarget, FALSE); + + int nCasterLevel = PRCGetCasterLevel(); + + // Boost AC. + int nIncrease = 3 + nCasterLevel / 2; + if (nIncrease > 13) nIncrease = 13; + effect eAC = EffectACIncrease(nIncrease, AC_ARMOUR_ENCHANTMENT_BONUS); + eAC = EffectLinkEffects(eAC, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + + // Get duration, 1 hour / level unless extended. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(nCasterLevel)); + + // Build the list of fancy visual effects to apply when the spell goes off. + effect eVFX = EffectVisualEffect(VFX_IMP_AC_BONUS); + + // Remove existing effect, if any. + PRCRemoveEffectsFromSpell(oTarget, GetSpellId()); + + // Apply effects and VFX to target + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAC, oTarget, fDuration,TRUE,-1,nCasterLevel); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget); + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_kelgore_fb.ncs b/35expandedspells/sp_kelgore_fb.ncs new file mode 100644 index 00000000..b88d5f64 Binary files /dev/null and b/35expandedspells/sp_kelgore_fb.ncs differ diff --git a/35expandedspells/sp_kelgore_fb.nss b/35expandedspells/sp_kelgore_fb.nss new file mode 100644 index 00000000..9a6a2e05 --- /dev/null +++ b/35expandedspells/sp_kelgore_fb.nss @@ -0,0 +1,73 @@ +//:://///////////////////////////////////////////// +//:: Name Kelgore's Fire Bolt +//:: FileName sp_kelgore_fb.nss +//::////////////////////////////////////////////// +/**@file Kelgore's Fire Bolt +Conjuration/Evocation [Fire] +Level: Duskblade 1, sorcerer/wizard 1 +Components: V,S,M +Casting Time: 1 standard action +Range: Medium +Target: One creature +Duration: Instantaneous +Saving Thorw: Reflex half +Spell Resistance: See text + +This spell conjures a small orb of rock and sheathes +it in arcane energy. This spell deals 1d6 point of +fire damage per caster level (maximum 5d6). If you +fail to overcome the target's spell resistance, the +spell still deals 1d6 points of fire damage from the +heat and force of the conjured orb's impact. + +Material component: A handful of ashes +**/ + +//////////////////////////////////////////////////// +// Author: Tenjac +// Date: 21.9.06 +//////////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + int nMax = nCasterLvl; + if (nMax > 20) nMax = 20; + int nDam = d6(nMax); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_KELGORES_FIRE_ORB, oPC); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * nMax; + } + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + nDam = d6(1); + eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + } + + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nDC, SAVING_THROW_TYPE_FIRE); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_lahms_fd.ncs b/35expandedspells/sp_lahms_fd.ncs new file mode 100644 index 00000000..a4a6b89c Binary files /dev/null and b/35expandedspells/sp_lahms_fd.ncs differ diff --git a/35expandedspells/sp_lahms_fd.nss b/35expandedspells/sp_lahms_fd.nss new file mode 100644 index 00000000..9be4fbbc --- /dev/null +++ b/35expandedspells/sp_lahms_fd.nss @@ -0,0 +1,154 @@ +//:://///////////////////////////////////////////// +//:: Name: Lahm's Finger Darts +//:: Filename: sp_lahms_fd.nss +//:://///////////////////////////////////////////// +/**@file Lahm's Finger Darts +Transmutation [Evil] +Level: Corrupt 2 +Components: V S, Corrupt +Casting Time: 1 action +Range: Medium (100 ft. + 10 ft./level) +Targets: Up to five creatures, no two of which can +be more than 15 ft. apart +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +The caster's finger becomes a dangerous projectile +that flies from her hand and unerringly strikes its +target. The dart deals 1d4 points of Dexterity +damage. Creatures without fingers cannot cast this +spell. + +The dart strikes unerringly, even if the target is +in melee or has partial cover or concealment. +Inanimate objects (locks, doors, and so forth) +cannot be damaged by the spell. + +For every three caster levels beyond 1st, the caster +gains an additional dart by losing an additional +finger: two at 4th level, three at 7th level, four +at 10th level, and the maximum of five darts at 13th +level or higher. If the caster shoots multiple darts, +she can have them strike a single creature or several +creatures. A single dart can strike only one creature. +The caster must designate targets before checking for +spell resistance or damage. + +Fingers lost to this spell grow back when the +corruption cost is healed, at the rate of one finger +per point of Strength damage healed. + +Corruption Cost: 1 point of Strength damage per dart, +plus the loss of one finger per dart. A hand with one +or no fingers is useless. + +@author Written By: Tenjac +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + //Spellhook + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nLFingers = (GetPersistantLocalInt(oPC, "FINGERS_LEFT_HAND") - 1); + int nRFingers = (GetPersistantLocalInt(oPC, "FINGERS_RIGHT_HAND")- 1); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nFingers = 1; + int nDam; + effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE); + effect eMissile = EffectVisualEffect(VFX_IMP_MIRV); + effect eDam = EffectAbilityDecrease(ABILITY_DEXTERITY, nDam); + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + float fDelay2, fTime; + location lTarget = PRCGetSpellTargetLocation(); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_LAHMS_FINGER_DARTS, oPC); + + //Set up fingers if it hasn't been done before + if (GetPersistantLocalInt(oPC, "FINGERS_LEFT_HAND") < 1) + { + SetPersistantLocalInt(oPC, "FINGERS_LEFT_HAND", 6); + SetPersistantLocalInt(oPC, "FINGERS_RIGHT_HAND", 6); + nLFingers = 5; + nRFingers = 5; + } + + //Spell Resistance, no save + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Calculate fingers used + if(nCasterLvl > 3) nFingers++; + if(nCasterLvl > 6) nFingers++; + if(nCasterLvl > 9) nFingers++; + if(nCasterLvl > 12) nFingers++; + + //gotta set up a new counter because nFingers is used later + int nCounter = nFingers; + + //Determine which hand to screw up + if(nLFingers >= nFingers) + { + nLFingers -= nFingers; + SetPersistantLocalInt(oPC, "FINGERS_LEFT_HAND", nLFingers); + } + + else if(nRFingers >= nFingers) + { + nRFingers -= nFingers; + SetPersistantLocalInt(oPC, "FINGERS_RIGHT_HAND", nRFingers); + } + + else + { + SendMessageToPC(oPC, "You do not have enough fingers left to cast this spell"); + nCounter = 0; + } + + //Damage loop + while(nCounter > 0) + { + nDam = d4(1)+ (nCasterLvl/4); + + //Apply the MIRV and damage effect + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget)); + DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + + // Play the sound of a dart hitting + DelayCommand(fTime, PlaySound("cb_ht_dart1")); + + //decrement nCounter to handle loop termination + nCounter--; + } + + //Determine usefullness of remaining stumps + if(nLFingers < 2) + { + //mark left hand useless + SetPersistantLocalInt(oPC, "LEFT_HAND_USELESS", 1); + } + + if(nRFingers < 2) + { + //mark right hand useless + SetPersistantLocalInt(oPC, "RIGHT_HAND_USELESS", 1); + } + } + + //Corrupt spells get mandatory 10 pt evil adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_EVIL, 10, FALSE); + + //SPEvilShift(oPC); + DoCorruptionCost(oPC, ABILITY_STRENGTH, nFingers, 0); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_lconvict.ncs b/35expandedspells/sp_lconvict.ncs new file mode 100644 index 00000000..cd345f2e Binary files /dev/null and b/35expandedspells/sp_lconvict.ncs differ diff --git a/35expandedspells/sp_lconvict.nss b/35expandedspells/sp_lconvict.nss new file mode 100644 index 00000000..16e983d9 --- /dev/null +++ b/35expandedspells/sp_lconvict.nss @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////// +// +// Legion's Conviction - Give all allies in a huge burst a +2 to +// +5 bonus to saves. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Get the effective caster level. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + // Determine the save bonus. + int nBonus = 2 + (PRCGetCasterLevel() / 6); + if (nBonus > 15) nBonus = 15; + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(TurnsToSeconds(PRCGetCasterLevel())); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget, FALSE); + + float fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + + // Apply the buff and vfx. + effect eBuff = EffectSavingThrowIncrease(SAVING_THROW_ALL, nBonus, SAVING_THROW_TYPE_ALL); + eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLvl +)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RESTORATION_LESSER), oTarget)); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_lcurimpbl.ncs b/35expandedspells/sp_lcurimpbl.ncs new file mode 100644 index 00000000..9f3ad96f Binary files /dev/null and b/35expandedspells/sp_lcurimpbl.ncs differ diff --git a/35expandedspells/sp_lcurimpbl.nss b/35expandedspells/sp_lcurimpbl.nss new file mode 100644 index 00000000..80fdc16b --- /dev/null +++ b/35expandedspells/sp_lcurimpbl.nss @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////// +// +// Legion's Curse of Impending Blades - All targets receives a +// -2 to AC penalty. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Get the effective caster level. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + // Determine the save bonus. + int nBonus = 2 + (PRCGetCasterLevel() / 6); + if (nBonus > 15) nBonus = 15; + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(PRCGetCasterLevel())); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + float fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + + // Apply the curse and vfx. + effect eCurse = EffectACDecrease(2); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCurse, oTarget, fDuration,TRUE,-1,nCasterLvl +)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget)); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_lcurpfail.ncs b/35expandedspells/sp_lcurpfail.ncs new file mode 100644 index 00000000..ffcce5c5 Binary files /dev/null and b/35expandedspells/sp_lcurpfail.ncs differ diff --git a/35expandedspells/sp_lcurpfail.nss b/35expandedspells/sp_lcurpfail.nss new file mode 100644 index 00000000..5fb74ad8 --- /dev/null +++ b/35expandedspells/sp_lcurpfail.nss @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////// +// +// Legion's Curse of Petty Failing - Target takes a -2 penalty to +// attacks and saves. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Get the effective caster level. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + // Determine the save bonus. + int nBonus = 2 + (PRCGetCasterLevel() / 6); + if (nBonus > 15) nBonus = 15; + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(PRCGetCasterLevel())); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + float fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + + // Apply the curse and vfx. + effect eCurse = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2); + eCurse = EffectLinkEffects(eCurse, EffectAttackDecrease(2)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eCurse = EffectLinkEffects(eCurse, EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCurse, oTarget, fDuration,TRUE,-1,nCasterLvl +)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget)); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_leonl_roar.ncs b/35expandedspells/sp_leonl_roar.ncs new file mode 100644 index 00000000..49d2bccd Binary files /dev/null and b/35expandedspells/sp_leonl_roar.ncs differ diff --git a/35expandedspells/sp_leonl_roar.nss b/35expandedspells/sp_leonl_roar.nss new file mode 100644 index 00000000..0728d1e9 --- /dev/null +++ b/35expandedspells/sp_leonl_roar.nss @@ -0,0 +1,74 @@ +//:://///////////////////////////////////////////// +//:: Name Leonal's Roar +//:: FileName sp_leonl_roar.nss +//::////////////////////////////////////////////// +/**@file Leonal's Roar +Evocation [Good, Sonic] +Level: Drd 8 +Components: V +Casting Time: 1 standard action +Range: 40 ft. +Targets: Non good creatures in a 40-ft.radius spread +centered on you +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: Yes + +This spell has the effect of a holy word, and it +additionally deals 2d6 points of sonic damage to +non-good creatures in the area. A successful +Fortitude saving throw negates the sonic damage, +but not the other effects of the spell. + +Author: Tenjac +Created: 7/7/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 12.192, lLoc, TRUE, OBJECT_TYPE_CREATURE); + int nDC; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam; + int nCasterLvl = PRCGetCasterLevel(oPC); + + while(GetIsObjectValid(oTarget)) + { + nDC = PRCGetSaveDC(oTarget, oPC); + + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_SONIC)) + { + nDam = d6(nCasterLvl)+2; + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(nCasterLvl)+2; + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_SONIC), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 12.192, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + //Holy Word + ActionCastSpellAtLocation(SPELL_HOLY_WORD, lLoc, nMetaMagic, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + //SPGoodShift(oPC); +} \ No newline at end of file diff --git a/35expandedspells/sp_lowersr.ncs b/35expandedspells/sp_lowersr.ncs new file mode 100644 index 00000000..95337858 Binary files /dev/null and b/35expandedspells/sp_lowersr.ncs differ diff --git a/35expandedspells/sp_lowersr.nss b/35expandedspells/sp_lowersr.nss new file mode 100644 index 00000000..6350565b --- /dev/null +++ b/35expandedspells/sp_lowersr.nss @@ -0,0 +1,41 @@ +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + if(PRCGetIsAliveCreature(oTarget)) + { + // Let the target attempte to make a fort save. (good luck since there is a penalty equal to the + // caster's level on the save). + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget,OBJECT_SELF) + nCasterLvl, SAVING_THROW_TYPE_SPELL)) + { + // Calculate the duration of the spell. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(nCasterLvl)); + + // Generate a SR decrease for the caster level, up to a max of 15. + int nSRReduction = nCasterLvl; + if (nSRReduction > 40) nSRReduction = 40; + effect eSR = EffectLinkEffects(EffectSpellResistanceDecrease(nSRReduction), EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSR, oTarget, fDuration,TRUE,-1,nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget); + } + } + } + + PRCSetSchool(); +} + diff --git a/35expandedspells/sp_lshlfat.ncs b/35expandedspells/sp_lshlfat.ncs new file mode 100644 index 00000000..cd214705 Binary files /dev/null and b/35expandedspells/sp_lshlfat.ncs differ diff --git a/35expandedspells/sp_lshlfat.nss b/35expandedspells/sp_lshlfat.nss new file mode 100644 index 00000000..041be810 --- /dev/null +++ b/35expandedspells/sp_lshlfat.nss @@ -0,0 +1,49 @@ +///////////////////////////////////////////////////////////////////// +// +// Legion's Curse of Petty Failing - Target takes a -2 penalty to +// attacks and saves. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + // Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + + // Determine the save bonus. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nBonus = 2 + (nCasterLvl / 6); + if (nBonus > 15) nBonus = 15; + + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(nCasterLvl)); + + // Declare the spell shape, size and the location. Capture the first target object in the shape. + // Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget, FALSE); + + float fDelay = PRCGetSpellEffectDelay(lTarget, oTarget); + + // Apply the curse and vfx. + effect eBuff = EffectACIncrease(nBonus, AC_DEFLECTION_BONUS); + eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLvl +)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_AC_BONUS), oTarget)); + } + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_mass_frshld.ncs b/35expandedspells/sp_mass_frshld.ncs new file mode 100644 index 00000000..9f7c2dfd Binary files /dev/null and b/35expandedspells/sp_mass_frshld.ncs differ diff --git a/35expandedspells/sp_mass_frshld.nss b/35expandedspells/sp_mass_frshld.nss new file mode 100644 index 00000000..dc5f5280 --- /dev/null +++ b/35expandedspells/sp_mass_frshld.nss @@ -0,0 +1,74 @@ +//:://///////////////////////////////////////////// +//:: Name Mass Fire Shield +//:: FileName sp_mass_frshld.nss +//::////////////////////////////////////////////// +/**@file Mass Fire Shield +Evocation [Fire or Cold] +Level: Sorcerer/wizard 5, warmage 5 +Components: V, S, M +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Targets: One or more allied creatures, no two of which +can be more than 30 ft. apart +Duration: 1 round/level (D) +Save: Will negates (harmless) +Spell Resistance: Yes (harmless) + +This spell functions like fire shield (see +page 230 of the Player’s Handbook), +except as noted above. + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + if(!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + location lLoc = PRCGetSpellTargetLocation(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam = min(40,nCasterLvl); + float fDur = RoundsToSeconds(nCasterLvl); + effect eVis, eShield, eReduce; + int nSpell = GetSpellId(); + float fRadius = FeetToMeters(15.0); + + //Extend + if(nMetaMagic & METAMAGIC_EXTEND) fDur += fDur; + + if(nSpell == SPELL_MASS_FIRE_SHIELD_RED) + { + eVis = EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD); + eShield = EffectDamageShield(nDam, DAMAGE_BONUS_1d6, ChangedElementalDamage(oPC, DAMAGE_TYPE_FIRE)); + eReduce = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 50); + } + else if (nSpell == SPELL_MASS_FIRE_SHIELD_BLUE) + { + eVis = EffectVisualEffect(VFX_DUR_CHILL_SHIELD); + eShield = EffectDamageShield(nDam, DAMAGE_BONUS_1d6, ChangedElementalDamage(oPC, DAMAGE_TYPE_COLD)); + eReduce = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50); + } + effect eLink = EffectLinkEffects(eShield, eVis); + eLink = EffectLinkEffects(eLink, eReduce); + + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fRadius, lLoc, FALSE, OBJECT_TYPE_CREATURE); + while(GetIsObjectValid(oTarget)) + { + if(GetIsFriend(oTarget, oPC)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur, TRUE, nSpell, nCasterLvl); + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, fRadius, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + PRCSetSchool(); +} + diff --git a/35expandedspells/sp_nec_bloat.ncs b/35expandedspells/sp_nec_bloat.ncs new file mode 100644 index 00000000..38905de5 Binary files /dev/null and b/35expandedspells/sp_nec_bloat.ncs differ diff --git a/35expandedspells/sp_nec_bloat.nss b/35expandedspells/sp_nec_bloat.nss new file mode 100644 index 00000000..178d9a5c --- /dev/null +++ b/35expandedspells/sp_nec_bloat.nss @@ -0,0 +1,98 @@ +//:://///////////////////////////////////////////// +//:: Name Necrotic Bloat +//:: FileName sp_nec_bloat.nss +//::////////////////////////////////////////////// +/** @file +Necrotic Bloat +Necromancy [Evil] +Level: Clr 3, sor/wiz 3 +Components: V, S, F +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Target: Living creature with necrotic cyst +Duration: Instantaneous +Saving Throw: None +Spell Resistance: No + +You cause the cyst of a subject already harboring +a necrotic cyst (see spell of the same name) to +pulse and swell. This agitation of the necrotic +cyst tears living tissue and expands the size of +the cyst, dealing massive internal damage to the +subject. The subject takes 1d6 points of damage +per level (maximum 10d6), and half the damage is +considered vile damage because the cyst expands +to envelop the newly necrotized tissue. The cyst +is reduced to its original size when the vile +damage is healed. + +Vile damage can only be healed +by magic cast within the area of a consecrate or +hallow spell (or an area naturally consecrated or +hallowed). Points of vile damage represent such +an evil violation to a character's body or soul +that only in a holy place, with holy magic, can +the damage be repaired. +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_necro_cyst" +#include "inc_utility" + +void main() +{ + // Set the spellschool + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nLevel = min(PRCGetCasterLevel(oPC), 20); + int nMetaMagic = PRCGetMetaMagicFeat(); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_NECROTIC_BLOAT, oPC); + + if(!GetCanCastNecroticSpells(oPC)) + return; + + if(!GetHasNecroticCyst(oTarget)) + { + // "Your target does not have a Necrotic Cyst." + SendMessageToPCByStrRef(oPC, nNoNecCyst); + return; + } + + //Resolve spell + int nDam = d6(nLevel); + + //Metmagic: Maximize + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (nLevel); + } + + //Metmagic: Empower + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + int nVile = nDam/2; + int nNorm = (nDam - nVile); + + //Vile damage is currently being applied as Positive damage + effect eVileDam = PRCEffectDamage(oTarget, nVile, DAMAGE_TYPE_POSITIVE); + effect eNormDam = PRCEffectDamage(oTarget, nNorm, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVileDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNormDam, oTarget); + + + PRCSetSchool(); + + //SPEvilShift(oPC); +} diff --git a/35expandedspells/sp_nec_burst.ncs b/35expandedspells/sp_nec_burst.ncs new file mode 100644 index 00000000..e27392a8 Binary files /dev/null and b/35expandedspells/sp_nec_burst.ncs differ diff --git a/35expandedspells/sp_nec_burst.nss b/35expandedspells/sp_nec_burst.nss new file mode 100644 index 00000000..d76790c0 --- /dev/null +++ b/35expandedspells/sp_nec_burst.nss @@ -0,0 +1,118 @@ +//:://///////////////////////////////////////////// +//:: Name Necrotic Burst +//:: FileName sp_nec_burst.nss +//::////////////////////////////////////////////// +/** @file +Necrotic Burst +Necromancy [Evil] +Level: Clr 5, sor/wiz 5 +Components: V, S, F +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Target: Living creature with necrotic cyst +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: No + +You cause the cyst of a subject already harboring a necrotic cyst +(see spell of the same name) to explosively enlarge itself at the +expense of the subject's body tissue. if the subject succeeds on +her saving throw, she takes 1d6 points of damage per level +(maximum 15d6), and half the damage is considered vile damage +(see necrotic bloat). The subject's cyst-derived saving throw +penalty against effects from the school of necromancy applies. + +If the subject fails her saving throw, the cyst expands beyond +control, killing the subject. On the round following the subject's +death, the cyst exits the flesh of the slain subject as a free-willed +undead called a skulking cyst. The skulking cyst is formed from the +naked organs of the subject (usually the intestines, but also +including a mass of blood vessels, the odd bone or two, and +sometimes even half the lolling head). + + Author: Tenjac + Created: 9/22/05 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_necro_cyst" +#include "inc_utility" +#include "prc_add_spell_dc" + +void main() +{ + // Set the spellschool + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + + object oPC = OBJECT_SELF; + int nLevel = min(PRCGetCasterLevel(oPC), 40); + int nMetaMagic = PRCGetMetaMagicFeat(); + object oTarget = PRCGetSpellTargetObject(); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_NECROTIC_BURST, oPC); + + if(!GetCanCastNecroticSpells(oPC)) + return; + + if(!GetHasNecroticCyst(oTarget)) + { + // "Your target does not have a Necrotic Cyst." + SendMessageToPCByStrRef(oPC, nNoNecCyst); + return; + } + + //Define nDC + + int nDC = PRCGetSaveDC(oTarget, oPC); + + //Resolve spell + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + if(!GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + + int nDam = d6(nLevel); + + //Metmagic: Maximize + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (nLevel); + } + + //Metmagic: Empower + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + int nVile = nDam/2; + int nNorm = (nDam - nVile); + //Vile damage is currently being applied as Positive damage + effect eVileDam = PRCEffectDamage(oTarget, nVile, DAMAGE_TYPE_POSITIVE); + effect eNormDam = PRCEffectDamage(oTarget, nNorm, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVileDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNormDam, oTarget); + } + } + + else + { + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(); + + eDeath = SupernaturalEffect(eDeath); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + RemoveCyst(oTarget); + PRCSetSchool(); + } + //SPEvilShift(oPC); +} + diff --git a/35expandedspells/sp_nec_erupt.ncs b/35expandedspells/sp_nec_erupt.ncs new file mode 100644 index 00000000..ac4885e2 Binary files /dev/null and b/35expandedspells/sp_nec_erupt.ncs differ diff --git a/35expandedspells/sp_nec_erupt.nss b/35expandedspells/sp_nec_erupt.nss new file mode 100644 index 00000000..8ee26e29 --- /dev/null +++ b/35expandedspells/sp_nec_erupt.nss @@ -0,0 +1,144 @@ +//:://///////////////////////////////////////////// +//:: Name Necrotic Eruption +//:: FileName sp_nec_erupt.nss +//::////////////////////////////////////////////// +/** @file +Necrotic Eruption +Necromancy [Evil] +Level: Clr 6, sor/wiz 6 +Components: V, S, F +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Target: Living creature with necrotic cyst and all creatures in 20 ft. Radius spread +Duration: Instantaneous +Saving Throw: Fortitude partial +Spell Resistance: No + +You cause the cyst of a subject already harboring a necrotic cyst +(see spell of the same name) to explosively enlarge itself at the +expense of the subject's body tissue, harming both the subject +(and nearby creatures if the subject fails his save). if the +subject succeeds on his saving throw, he takes 1d6 points of damage + per level (maximum 15d6), and half the damage is considered vile +damage (see necrotic bloat). The subject's cyst-derived saving throw + penalty against effects from the school of necromancy applies. + +If the subject fails his saving throw, the cyst expands beyond control, + killing the subject. All creatures within 20 feet of the subject take +1d6 points of damage per level (maximum 15d6; Reflex half), and half the + damage taken is considered vile damage. All creatures in range that take +this secondary damage are also exposed to the effect of the base necrotic +cyst spell. On the round following the subject's death, the cyst exits the + flesh of the slain subject as a free-willed undead called a skulking cyst. + + Author: Tenjac + Created: 9/22/05 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_necro_cyst" +#include "inc_utility" +#include "prc_add_spell_dc" + +void main() +{ + // Set the spellschool + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nLevel = min(PRCGetCasterLevel(oPC), 60); + int nMetaMagic = PRCGetMetaMagicFeat(); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_NECROTIC_ERUPTION, oPC); + + if(!GetCanCastNecroticSpells(oPC)) + return; + + if(!GetHasNecroticCyst(oTarget)) + { + // "Your target does not have a Necrotic Cyst." + SendMessageToPCByStrRef(oPC, nNoNecCyst); + return; + } + + //Define nDC + + int nDC = PRCGetSaveDC(oTarget, oPC); + + //Resolve spell + + + if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + if(!GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + + int nDam = d6(nLevel); + + //Metmagic: Maximize + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (nLevel); + } + + //Metmagic: Empower + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + int nVile = nDam/2; + int nNorm = (nDam - nVile); + //Vile damage is currently being applied as Positive damage + effect eVileDam = PRCEffectDamage(oTarget, nVile, DAMAGE_TYPE_POSITIVE); + effect eNormDam = PRCEffectDamage(oTarget, nNorm, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVileDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNormDam, oTarget); + } + } + + else + { + //Kill target + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + RemoveCyst(oTarget); + + //Apply same damage above in ALL creatures in 20 foot radius of target + location lTarget = PRCGetSpellTargetLocation(); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + int nDam = d6(nLevel); + int nVile = nDam/2; + int nNorm = (nDam - nVile); + //Vile damage is currently being applied as Positive damage + effect eVileDam = PRCEffectDamage(oTarget, nVile, DAMAGE_TYPE_POSITIVE); + effect eNormDam = PRCEffectDamage(oTarget, nNorm, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVileDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNormDam, oTarget); + //Apply Necrotic Cyst to target + AssignCommand(oPC, ActionCastSpellAtObject(SPELL_NECROTIC_CYST, oTarget, METAMAGIC_NONE, TRUE, 6, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + } + + //SPEvilShift(oPC); + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_nec_term.ncs b/35expandedspells/sp_nec_term.ncs new file mode 100644 index 00000000..9a5a0a63 Binary files /dev/null and b/35expandedspells/sp_nec_term.ncs differ diff --git a/35expandedspells/sp_nec_term.nss b/35expandedspells/sp_nec_term.nss new file mode 100644 index 00000000..88d24f42 --- /dev/null +++ b/35expandedspells/sp_nec_term.nss @@ -0,0 +1,141 @@ +//:://///////////////////////////////////////////// +//:: Name Necrotic Termination +//:: FileName sp_nec_term.nss +//::////////////////////////////////////////////// +/** @file + Necrotic Termination + Necromancy [Evil] + Level: Clr 9, sor/wiz 9 + Components: V, S, F, XP + Casting Time: 1 standard action + Range: Medium (100 ft. + 10 ft./level) + Target: Living creature with necrotic cyst + Duration: Instantaneous + Saving Throw: Fortitude partial + Spell Resistance: No + + You cause the cyst of a subject already harboring a necrotic cyst + (see spell of the same name) to physically and spiritually enlarge + itself at the expense of the subject's body and soul. If the subject + succeeds on her saving throw, she takes 1d6 points of damage per level + (maximum 25d6), and half the damage is considered vile damage + (see necrotic bloat). The subject's cyst-derived saving throw penalty + against effects from the school of necromancy applies. + + If the subject fails her saving throw, the cyst expands beyond control, + killing the subject and digesting her soul. Raise dead, resurrection, + true resurrection, wish, and miracle cannot return life to the subject + once her soul is digested-she is gone forever. On the round following + the subject's death, the cyst exits the flesh of the slain subject as + a free-willed undead called a skulking cyst. + + XP Cost: 1,000 XP. + + Author: Tenjac + Created: 10/28/05 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_necro_cyst" +#include "prc_inc_switch" +#include "inc_utility" +#include "prc_add_spell_dc" + + +void main() +{ + // Set the spellschool + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // Run the spellhook. + if (!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nLevel = min(PRCGetCasterLevel(oPC), 80); + int nMetaMagic = PRCGetMetaMagicFeat(); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_NECROTIC_TERMINATION, oPC); + + + if(!GetCanCastNecroticSpells(oPC)) + return; + + if(!GetHasNecroticCyst(oTarget)) + { + // "Your target does not have a Necrotic Cyst." + SendMessageToPCByStrRef(oPC, nNoNecCyst); + return; + } + //Check for perma-death + if(GetPRCSwitch(PRC_NEC_TERM_PERMADEATH)) + { + int nCost = 1000; + //Check XP if perma-death enabled + if(GetHasXPToSpend(oPC, nCost)) + SpendXP(oPC, nCost); + else + { + SendMessageToPC(oPC, "You don't have enough experience to cast this spell"); + return; + } + } + //SPEvilShift(oPC); + + + //Define nDC + int nDC = PRCGetSaveDC(oTarget, oPC); + + //Resolve spell + + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + if(!GetHasMettle(oTarget, SAVING_THROW_FORT)) + { + int nDam = d6(nLevel); + + //Metmagic: Maximize + if (nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (nLevel); + } + + //Metmagic: Empower + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + int nVile = nDam/2; + int nNorm = (nDam - nVile); + //Vile damage is currently being applied as Positive damage + effect eVileDam = PRCEffectDamage(oTarget, nVile, DAMAGE_TYPE_POSITIVE); + effect eNormDam = PRCEffectDamage(oTarget, nNorm, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVileDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eNormDam, oTarget); + } + } + + + else + { + //Target SOL. Kill it. + DeathlessFrenzyCheck(oTarget); + effect eDeath = EffectDeath(); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + + //Check for module perma-death + if(GetPRCSwitch(PRC_NEC_TERM_PERMADEATH)) + { + //Prevent revive + SetLocalInt(oPC, "PERMA_DEAD", 1); + } + + RemoveCyst(oTarget); + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_nght_caress.ncs b/35expandedspells/sp_nght_caress.ncs new file mode 100644 index 00000000..8fc7854b Binary files /dev/null and b/35expandedspells/sp_nght_caress.ncs differ diff --git a/35expandedspells/sp_nght_caress.nss b/35expandedspells/sp_nght_caress.nss new file mode 100644 index 00000000..23b4dc2c --- /dev/null +++ b/35expandedspells/sp_nght_caress.nss @@ -0,0 +1,122 @@ +/* + sp_nght_caress + + School: Necromancy [Evil] + Level: Sorc/Wiz 5 + Compnents: V,S + Range: Touch + Duration: Instantaneous + Save: Fortitude partial + Spell Resistance: Yes + + A touch from your hand, which sheds darkness like + the blackest of night, disrupts the life force of + a living creature. Your touch deals 1d6 points of + damage per caster level (max 15d6), and 1d6+2 + points of Constituion damage (a sucessful Fortitude + saving throw negates the Constitution damage.) + + The spell has a special effect on an undead creature. + An undead touched by you takes no damage, but it + must make a successful Will saving throw or flee + as if panicked for 1d4 rounds + 1 round per caster + level. + + By: Tenjac + Created: Dec 13, 2005 + Modified: Jul 2, 2006 + + added spell betrayal/spellstrike damage, touch attack damage + set vfx to DURATION_TYPE_INSTANT +*/ + +#include "prc_sp_func" +#include "prc_inc_sp_tch" +#include "prc_add_spell_dc" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int nDC = PRCGetSaveDC(oTarget, oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + PRCSignalSpellEvent(oTarget, TRUE, SPELL_NIGHTS_CARESS, oCaster); + + //Make touch attack + int nTouch = PRCDoMeleeTouchAttack(oTarget); + if(nTouch) + { + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + //Will saving throw + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + float fRounds = RoundsToSeconds(d4(1) + nCasterLevel); + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) fRounds *= 2; + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectLinkEffects(EffectFrightened(), EffectVisualEffect(VFX_IMP_HEAD_EVIL)), oTarget, fRounds); + } + } + //Spell Resistance + else if (!PRCDoResistSpell(oCaster, oTarget, nCasterLevel + SPGetPenetr()) && PRCGetIsAliveCreature(oTarget)) + { + //Max of 15 caster levels + if (nCasterLevel > 40) nCasterLevel = 40; + int nDam = d6(nCasterLevel); + //Metmagic: Maximize + if (nMetaMagic & METAMAGIC_MAXIMIZE) nDam = 6 * nCasterLevel; + //Metmagic: Empower + if (nMetaMagic & METAMAGIC_EMPOWER) nDam += (nDam/2); + nDam += ApplySpellBetrayalStrikeDamage(oTarget, oCaster); + //Apply damage as magical + ApplyTouchAttackDamage(oCaster, oTarget, nTouch, nDam, DAMAGE_TYPE_MAGICAL); + + // Fort saving throw + if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + int nConDam = (d6(1) + 2); + if (nMetaMagic & METAMAGIC_MAXIMIZE) nConDam = 8; + if (nMetaMagic & METAMAGIC_EMPOWER) nConDam += (nConDam/2); + //Ability damage healing 1 point per hour + ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, nConDam, DURATION_TYPE_TEMPORARY, TRUE, -1.0, FALSE, oCaster); + //Drain VFX + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE), oTarget); + } + } + } + + return nTouch; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + //SPEvilShift(oCaster); + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_ot_frz_sphere.ncs b/35expandedspells/sp_ot_frz_sphere.ncs new file mode 100644 index 00000000..01ca204e Binary files /dev/null and b/35expandedspells/sp_ot_frz_sphere.ncs differ diff --git a/35expandedspells/sp_ot_frz_sphere.nss b/35expandedspells/sp_ot_frz_sphere.nss new file mode 100644 index 00000000..29d8fe08 --- /dev/null +++ b/35expandedspells/sp_ot_frz_sphere.nss @@ -0,0 +1,125 @@ +//:://///////////////////////////////////////////// +//:: Name Otiluke's Freezing Sphere +//:: FileName sp_ot_frz_sphere.nss +//::////////////////////////////////////////////// +/**@file Otiluke's Freezing Sphere +Evocation [Cold] +Level: Sor/Wiz 6 +Components: V, S, F +Casting Time: 1 standard action +Range: Long (400 ft. + 40 ft./level) +Target, Effect, or Area: See text +Duration: Instantaneous or 1 round/level; see text +Saving Throw: Reflex half; see text +Spell Resistance: Yes + +Freezing sphere creates a frigid globe of cold energy +that streaks from your fingertips to the location you +select, where it explodes in a 10-foot-radius burst, +dealing 1d6 points of cold damage per caster level +(maximum 15d6) to each creature in the area. An +elemental (water) creature instead takes 1d8 points +of cold damage per caster level (maximum 15d8). + +You can refrain from firing the globe after +completing the spell, if you wish. Treat this as a +touch spell for which you are holding the charge. +You can hold the charge for as long as 1 round per +level, at the end of which time the freezing sphere +bursts centered on you (and you receive no saving +throw to resist its effect). Firing the globe in a +later round is a standard action. + +Focus: A small crystal sphere. + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +int GetIsWaterElemental(object oTarget); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDice = min(40, nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + int eDamageType = ChangedElementalDamage(oPC, DAMAGE_TYPE_COLD); + int nDC, bIsElemental, nDam; + float fDelay; + effect eImp = EffectVisualEffect(VFX_IMP_FROST_S); + effect eVis = EffectVisualEffect(VFX_FNF_OTIL_COLDSPHERE); + effect eDam; + + nCasterLvl += SPGetPenetr(); + + // Apply AOE location explosion + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lTarget); + + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + + while(GetIsObjectValid(oTarget)) + { + // PvP Check + if(!GetIsReactionTypeFriendly(oTarget, oPC)) + { + // Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + + // Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_OTILUKES_FREEZING_SPHERE)); + + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl)) + { + // Damage - it is 1d8 for water elementals! + bIsElemental = GetIsWaterElemental(oTarget); + nDC = PRCGetSaveDC(oTarget, oPC); + + nDam = bIsElemental ? d8(nDice) : d6(nDice); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = bIsElemental ? 8 * nDice : 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nDC, SAVING_THROW_TYPE_COLD); + + // Need to do damage to apply visuals + if(nDam > 0) + { + eDam = PRCEffectDamage(oTarget, nDam, eDamageType); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + PRCSetSchool(); +} + +int GetIsWaterElemental(object oTarget) +{ + if(GetObjectType(oTarget) != OBJECT_TYPE_CREATURE) + return FALSE; + + int nAppearance = GetAppearanceType(oTarget); + if(nAppearance == APPEARANCE_TYPE_ELEMENTAL_WATER + || nAppearance == APPEARANCE_TYPE_ELEMENTAL_WATER_ELDER) + return TRUE; + + if(FindSubString(GetStringLowerCase(GetSubRace(oTarget)), "water elemental", 0) > -1) + return TRUE; + + return FALSE; +} diff --git a/35expandedspells/sp_panacea.ncs b/35expandedspells/sp_panacea.ncs new file mode 100644 index 00000000..c59489b4 Binary files /dev/null and b/35expandedspells/sp_panacea.ncs differ diff --git a/35expandedspells/sp_panacea.nss b/35expandedspells/sp_panacea.nss new file mode 100644 index 00000000..20ab55aa --- /dev/null +++ b/35expandedspells/sp_panacea.nss @@ -0,0 +1,102 @@ +///////////////////////////////////////////////////////////////////// +// +// Panacea - Heals 1d8+1/lvl (max 1d8+20) hp, cures the following +// conditions: blinded, confused, dazed, deafened, diseased, +// frightened, paralyzed, poisoned, sleep, and stunned. +// +///////////////////////////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_add_spell_dc" +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + // Get the target and raise the spell cast event. + object oTarget = PRCGetSpellTargetObject(); + // Compute the damage to add to the dice roll. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nAdd = nCasterLvl; + if (nAdd > 40) nAdd = 40; + int nPenetr = nCasterLvl + SPGetPenetr(); + + // If the target is not undead then heal it and remove all harmfull effects. If + // the target is undead then check for SR. + if (RACIAL_TYPE_UNDEAD != MyPRCGetRacialType(oTarget) + && !(GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)) + { + PRCSignalSpellEvent(oTarget, FALSE); + + // Look for detrimental effects and remove them. Removes the following effects: + // blinded, confused, dazed, deafened, diseased, frightened, paralyzed, + // poisoned, sleep, and stunned. + effect eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + // GetIsValidEffect() appears to be returning TRUE sometimes even for invalid effects so + // catch that here. + int nEffectType = GetEffectType(eEffect); + if (EFFECT_TYPE_INVALIDEFFECT == nEffectType) + { + PrintString("****EFFECT_TYPE_INVALIDEFFECT returned but GetIsValidEffect() returns TRUE"); + break; + } + + // catch all of the detrimental effects and remove them. + if (EFFECT_TYPE_BLINDNESS == nEffectType || + EFFECT_TYPE_CONFUSED == nEffectType || + EFFECT_TYPE_DAZED == nEffectType || + EFFECT_TYPE_DEAF == nEffectType || + EFFECT_TYPE_DISEASE == nEffectType || + EFFECT_TYPE_FRIGHTENED == nEffectType || + EFFECT_TYPE_PARALYZE == nEffectType || + EFFECT_TYPE_POISON == nEffectType || + EFFECT_TYPE_SLEEP == nEffectType || + EFFECT_TYPE_STUNNED == nEffectType) + RemoveEffect(oTarget, eEffect); + + eEffect = GetNextEffect(oTarget); + } + + // Roll the healing 'damage'. + int nHeal = PRCGetMetaMagicDamage(DAMAGE_TYPE_POSITIVE, 1, 8, 0, nAdd); + if (GetLevelByClass(CLASS_TYPE_HEALER, OBJECT_SELF)) + nHeal += GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF); + + // Apply the healing and VFX. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(nHeal, oTarget), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_M), oTarget); + } + else if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + PRCSignalSpellEvent(oTarget); + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + int nTouch = PRCDoMeleeTouchAttack(oTarget);; + if (nTouch > 0) + { + // Roll the damage (allowing for a critical) and let the target make a will save to + // halve the damage. + int nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_POSITIVE, 1 == nTouch ? 1 : 2, 8, 0, nAdd); + if (PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget,OBJECT_SELF))) + { + nDamage /= 2; + if (GetHasMettle(oTarget, SAVING_THROW_WILL)) // Ignores partial effects + { + nDamage = 0; + } + } + + // Apply damage and VFX. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_POSITIVE), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUNSTRIKE), oTarget); + } + } + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_phoenix_fire.ncs b/35expandedspells/sp_phoenix_fire.ncs new file mode 100644 index 00000000..5d298aa8 Binary files /dev/null and b/35expandedspells/sp_phoenix_fire.ncs differ diff --git a/35expandedspells/sp_phoenix_fire.nss b/35expandedspells/sp_phoenix_fire.nss new file mode 100644 index 00000000..064ec247 --- /dev/null +++ b/35expandedspells/sp_phoenix_fire.nss @@ -0,0 +1,172 @@ +//:://///////////////////////////////////////////// +//:: Name Phoenix Fire +//:: FileName sp_phoenix_fire.nss +//::////////////////////////////////////////////// +/** @file +Phoenix Fire +Necromancy [Fire, Good] +Level: Sanctified 7 +Components: V,S,F,Sacrifice +Range: 15 feet +Area: 15 foot radius spread, centered on you +Duration: Instantaneous (see text) +Saving Throw: Reflex half (see text) +Spell Resistance: Yes (see text) + +You immolate yourself, consuming your flesh in a +cloud of flame 20 feet high and 30 feet in diameter. +You die (no saving throw, and spell resistance does +not apply). Every evil creature within the cloud takes +2d6 points of damage per caster level (maximum 40d6). +Neutral characters take half damage (and a successful +Reflex save reduces that further in half), while good +characters take no damage at all. Half of the damage +dealt by the spell against any creature is fire; the +rest results directly from divine power and is +therefore not subject to being reduced by resistance +to fire-based attacks, such as that granted by +protection from energy(fire), fire shield(chill +shield), and similar magic. + +After 10 minutes, you rise from the ashes as if restored +to life by a resurrection spell. + +Sacrifice: Your death and the level you lose when you +return to life are the sacrifice cost for this spell. + +*/ +// Author: Tenjac +// Created: 1/6/2006 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + + +void Counter(object oPC, int nCounter); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + //Define vars + object oPC = OBJECT_SELF; + location lLoc = GetLocation(oPC); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam; + float fDur = TurnsToSeconds(10); + + //Immolate VFX on caster - VFX_IMP_HOLY_AID for casting VFX + effect eFire = EffectVisualEffect(VFX_FNF_FIREBALL); + effect eDivine = EffectVisualEffect(VFX_FNF_STRIKE_HOLY); + + DelayCommand(0.3f, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oPC)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDivine, oPC); + + //VFX + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOST_SMOKE_2), lLoc, fDur); + + //"Kill" player + effect eLink = EffectLinkEffects(EffectCutsceneParalyze(), EffectCutsceneGhost()); + eLink = EffectLinkEffects(EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), eLink); + eLink = EffectLinkEffects(eLink, EffectEthereal()); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, fDur); + Counter(oPC, 10); + + SetPlotFlag(oPC, TRUE); + DelayCommand(fDur, SetPlotFlag(oPC, FALSE)); + DelayCommand(fDur, ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(GetMaxHitPoints(oPC), oPC), oPC)); + + //Get first object in shape + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLoc, TRUE, OBJECT_TYPE_CREATURE); + + //While object valid + while(GetIsObjectValid(oTarget)) + { + if (!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + int nDC = PRCGetSaveDC(oTarget, oPC); + + //If alignment evil + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + //Damage = 2d6/level + nDam = d6(min(60, (2 * nCasterLvl))); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(60, (2 * nCasterLvl))); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //Reflex save for 1/2 damage + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_GOOD)) + { + nDam = nDam/2; + } + + //Half divine, half fire + int nDiv = nDam/2; + nDam = nDam - nDiv; + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDiv, DAMAGE_TYPE_DIVINE), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + } + + //If alignment neutral + else if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_NEUTRAL) + { + //Half damage for neutrality, Damage = 1d6 + nDam = d6(min(40,nCasterLvl)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(40,nCasterLvl)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //Reflex for further 1/2 + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_GOOD)) + { + nDam = nDam/2; + } + + //Half divine, half fire + int nDiv = nDam/2; + nDam = nDam - nDiv; + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDiv, DAMAGE_TYPE_DIVINE), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + } + } + //Get next object in shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLoc, TRUE, OBJECT_TYPE_CREATURE); + } + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + PRCSetSchool(); + //SPGoodShift(oPC); +} + +void Counter(object oPC, int nCounter) +{ + FloatingTextStringOnCreature("Phoenix Fire: " + IntToString(nCounter) + " turns remaining until resurrection.", oPC); + nCounter--; + if(nCounter > 0) DelayCommand(TurnsToSeconds(1), Counter(oPC, nCounter)); +} \ No newline at end of file diff --git a/35expandedspells/sp_pnp_frshld.ncs b/35expandedspells/sp_pnp_frshld.ncs new file mode 100644 index 00000000..000a16d0 Binary files /dev/null and b/35expandedspells/sp_pnp_frshld.ncs differ diff --git a/35expandedspells/sp_pnp_frshld.nss b/35expandedspells/sp_pnp_frshld.nss new file mode 100644 index 00000000..1e079ce5 --- /dev/null +++ b/35expandedspells/sp_pnp_frshld.nss @@ -0,0 +1,102 @@ +//:://///////////////////////////////////////////// +//:: Name +//:: FileName sp_.nss +//::////////////////////////////////////////////// +/**@file Fire Shield +Evocation [Fire or Cold] +Level: Fire 5, Sor/Wiz 4, Sun 4 +Components: V, S, M/DF +Casting Time: 1 standard action +Range: Personal +Target: You +Duration: 1 round/level (D) + +This spell wreathes you in flame and causes damage +to each creature that attacks you in melee. The +flames also protect you from either cold-based or +fire-based attacks (your choice). + +Any creature striking you with its body or a +handheld weapon deals normal damage, but at the +same time the attacker takes 1d6 points of damage ++1 point per caster level (maximum +15). This +damage is either cold damage (if the shield +protects against fire-based attacks) or fire +damage (if the shield protects against cold-based +attacks). If the attacker has spell resistance, +it applies to this effect. Creatures wielding +weapons with exceptional reach are not subject to +this damage if they attack you. + +When casting this spell, you appear to immolate +yourself, but the flames are thin and wispy, +giving off light equal to only half the +illumination of a normal torch (10 feet). The +special powers of each version are as follows. + +Warm Shield: The flames are warm to the touch. +You take only half damage from cold-based attacks. +If such an attack allows a Reflex save for half +damage, you take no damage on a successful save. + +Chill Shield: The flames are cool to the touch. +You take only half damage from fire-based attacks. +If such an attack allows a Reflex save for half +damage, you take no damage on a successful save. + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + int nSpell = GetSpellId(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam = min(40,nCasterLvl); + float fDur = RoundsToSeconds(nCasterLvl); + effect eShield; + effect eVis; + effect eReduce; + + //Extend + if(nMetaMagic & METAMAGIC_EXTEND) fDur += fDur; + + if(nSpell == SPELL_PNP_FIRE_SHIELD_RED) + { + eVis = EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD); + eShield = EffectDamageShield(nDam, DAMAGE_BONUS_1d6, ChangedElementalDamage(oPC, DAMAGE_TYPE_FIRE)); + eReduce = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 50); + + } + + else if(nSpell == SPELL_PNP_FIRE_SHIELD_BLUE) + { + eVis = EffectVisualEffect(VFX_DUR_CHILL_SHIELD); + eShield = EffectDamageShield(nDam, DAMAGE_BONUS_1d6, ChangedElementalDamage(oPC, DAMAGE_TYPE_COLD)); + eReduce = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50); + } + + else + { + PRCSetSchool(); + return; + } + + effect eLink = EffectLinkEffects(eShield, eVis); + eLink = EffectLinkEffects(eLink, eReduce); + + //apply + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, fDur, TRUE, nSpell, nCasterLvl); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_polar_ray.ncs b/35expandedspells/sp_polar_ray.ncs new file mode 100644 index 00000000..b2e49e74 Binary files /dev/null and b/35expandedspells/sp_polar_ray.ncs differ diff --git a/35expandedspells/sp_polar_ray.nss b/35expandedspells/sp_polar_ray.nss new file mode 100644 index 00000000..34037aca --- /dev/null +++ b/35expandedspells/sp_polar_ray.nss @@ -0,0 +1,117 @@ +/* +Polar Ray + +Caster Level(s): Wizard / Sorcerer 8 +Innate Level: 8 +School: Evocation +Descriptor(s): Cold +Component(s): Verbal, Somatic +Range: Short +Area of Effect / Target: Single +Duration: Instant +Additional Counter Spells: +Save: None +Spell Resistance: Yes + +A blue-white ray of freezing air and ice springs from your hand. +You must succeed on a ranged touch attack with the ray to deal +damage to a target. The ray deals 1d6 points of cold damage per +caster level (maximum 25d6). +*/ + +//::Added hold ray functionality - HackyKid + + +#include "prc_inc_sp_tch" + +#include "prc_add_spell_dc" +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDam = nCasterLevel; + // 25d6 Max + if (nDam > 60) nDam = 60; + nDam = d6(nDam); + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND); + + int iAttackRoll = 0; + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAY_OF_FROST)); + eRay = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND); + + iAttackRoll = PRCDoRangedTouchAttack(oTarget);; + if(iAttackRoll > 0) + { + //Make SR Check + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr)) + { + //Enter Metamagic conditions + if (CheckMetaMagic(nMetaMagic, METAMAGIC_MAXIMIZE)) + { + nDam = 6 * nCasterLevel;//Damage is at max + // 25 * 6 = 150, so its the most the spell can do. + // if (nDam > 400) nDam = 400; + } + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + + // perform ranged touch attack and apply sneak attack if any exists + int eDamageType = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_COLD); + ApplyTouchAttackDamage(OBJECT_SELF, oTarget, iAttackRoll, nDam, eDamageType); + PRCBonusDamage(oTarget); + + //Apply the VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 1.7,FALSE); + + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_prism_wallA.ncs b/35expandedspells/sp_prism_wallA.ncs new file mode 100644 index 00000000..ba2972a0 Binary files /dev/null and b/35expandedspells/sp_prism_wallA.ncs differ diff --git a/35expandedspells/sp_prism_wallA.nss b/35expandedspells/sp_prism_wallA.nss new file mode 100644 index 00000000..4464119e --- /dev/null +++ b/35expandedspells/sp_prism_wallA.nss @@ -0,0 +1,213 @@ +//:://///////////////////////////////////////////// +//:: Name Prismatic Wall On Enter +//:: FileName sp_prism_wallA.nss +//::////////////////////////////////////////////// +/**@file Prismatic Wall +Abjuration +Level: Sor/Wiz 8 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: Wall 4 ft./level wide, 2 ft./level high +Duration: 10 min./level (D) +Saving Throw: See text +Spell Resistance: See text + +Prismatic wall creates a vertical, opaque wall; a +shimmering, multicolored plane of light that +protects you from all forms of attack. The wall +flashes with seven colors, each of which has a +distinct power and purpose. The wall is immobile, +and you can pass through and remain near the wall +without harm. However, any other creature with +less than 8 HD that is within 20 feet of the wall +is blinded for 2d4 rounds by the colors if it +looks at the wall. + +The wall’s maximum proportions are 4 feet wide per +caster level and 2 feet high per caster level. A +prismatic wall spell cast to materialize in a +space occupied by a creature is disrupted, and +the spell is wasted. + +Each color in the wall has a special effect. The +accompanying table shows the seven colors of the +wall, the order in which they appear, their +effects on creatures trying to attack you or pass +through the wall, and the magic needed to negate +each color. + +The wall can be destroyed, color by color, in +consecutive order, by various magical effects; +however, the first color must be brought down +before the second can be affected, and so on. +A rod of cancellation or a mage’s disjunction +spell destroys a prismatic wall, but an +antimagic field fails to penetrate it. Dispel +magic and greater dispel magic cannot dispel +the wall or anything beyond it. Spell resistance +is effective against a prismatic wall, but the +caster level check must be repeated for each +color present. + +Color Order Effect of Color + +Red 1st Deals 20 points of fire damage (Reflex half). +Orange 2nd Deals 40 points of acid damage (Reflex half). +Yellow 3rd Deals 80 points of electricity damage (Reflex half). +Green 4th Poison (Kills; Fortitude partial for 1d6 points of Con damage instead). +Blue 5th Turned to stone (Fortitude negates). +Indigo 6th Will save or become insane (as insanity spell). +Violet 7th Creatures sent to another plane (Will negates). + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + object oPC = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + int nDC = PRCGetSaveDC(oTarget, oPC); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDam; + int nPenetr = nCasterLvl + SPGetPenetr(); + + if(!GetIsReactionTypeFriendly(oTarget, oPC) && (oTarget != oPC)) + { + //Red + if(!PRCDoResistSpell(oPC, oTarget,nPenetr)) + { + nDam = 20 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_FIRE)) + { + nDam = 10 + (nPenetr/2); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + } + + //Orange + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + nDam = 40 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ACID)) + { + nDam = 20 + (nPenetr/2); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ACID), oTarget); + } + + //Yellow + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + nDam = 80 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY)) + { + nDam = 40 + (nPenetr/2); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ELECTRICAL), oTarget); + } + + //Green + if (PRCGetIsAliveCreature(oTarget) && (GetIsImmune(oTarget, IMMUNITY_TYPE_POISON) == FALSE)) + { + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_POISON)) + { + DeathlessFrenzyCheck(oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDeath()), oTarget); + } + + else ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, d6(1), DURATION_TYPE_TEMPORARY, TRUE, -1.0); + } + } + + //Blue + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) PRCDoPetrification(nCasterLvl, oPC, oTarget, SPELL_PRISMATIC_RAY, nDC); + + //Indigo + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S); + effect eConfuse = PRCEffectConfused(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eMind, eConfuse); + eLink = EffectLinkEffects(eLink, eDur); + eLink = SupernaturalEffect(eLink); + + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0, TRUE, SPELL_PRISMATIC_SPHERE, nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + + //Violet + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); + + int nMessageRoll = d6(1); + int nTalk; + + switch(nMessageRoll) + { + case 1: + { + nTalk = 1729332; + break; + } + + case 2: + { + nTalk = 1729333; + break; + } + + case 3: + { + nTalk = 1729334; + break; + } + + case 4: + { + nTalk = 1729335; + break; + } + + case 5: + { + nTalk = 1729336; + break; + } + + case 6: + { + nTalk = 1729337; + break; + } + } + //Death Popup + DelayCommand(2.75, PopUpDeathGUIPanel(oTarget, FALSE , TRUE, nTalk)); + DelayCommand(2.75, ExecuteScript("prc_ondeath", oTarget)); + } + } + } +} \ No newline at end of file diff --git a/35expandedspells/sp_prismat_ray.ncs b/35expandedspells/sp_prismat_ray.ncs new file mode 100644 index 00000000..071cf29a Binary files /dev/null and b/35expandedspells/sp_prismat_ray.ncs differ diff --git a/35expandedspells/sp_prismat_ray.nss b/35expandedspells/sp_prismat_ray.nss new file mode 100644 index 00000000..f43264bf --- /dev/null +++ b/35expandedspells/sp_prismat_ray.nss @@ -0,0 +1,271 @@ +//:://///////////////////////////////////////////// +//:: Name Prismatic Ray +//:: FileName sp_prismat_ray.nss +//::////////////////////////////////////////////// +/**@file Prismatic Ray +Evocation +Level: Sorcerer/wizard 5 +Components: V, S +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Effect: Ray +Duration: Instantaneous +Saving Throw: See text +Spell Resistance: Yes + +A single beam of brilliantly colored +light shoots from your outstretched +hand. You must succeed on a ranged touch +attack with the ray to strike a target. +On a successful attack, a creature with +6 Hit Dice or fewer is blinded for 2d4 +rounds by the prismatic ray in addition +to suffering a randomly determined +effect: + +1d8 Color of Beam Effect + +1 Red 20 points fire damage(Reflex half) +2 Orange 40 points acid damage(Reflex half) +3 Yellow 80 points electricity damage (Reflex half) +4 Green Poison (Kills; Fortitude partial, take 1d6 Con damage instead) +5 Blue Turned to stone(Fortitude negates) +6 Indigo Insane, as insanity spell (Will negates) +7 Violet Sent to another plane(Will negates) +8 Two effects; roll twice more, ignoring any '8' results + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +void DoRay(object oTarget, int nSaveDC, int nRoll, int nCasterLvl, object oPC); + +#include "prc_inc_sp_tch" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nRoll = d8(1); + int bTwoRolls = FALSE; + int nBeamVisualEffect; + int nSaveDC = PRCGetSaveDC(oTarget, oPC); + int nTouch = PRCDoRangedTouchAttack(oTarget); + int nHD = GetHitDice(oTarget); + int nRoll2; + + switch(nRoll) + { + case 1: nBeamVisualEffect = VFX_BEAM_EVIL; + break; + + case 2: nBeamVisualEffect = VFX_BEAM_FIRE; + break; + + case 3: nBeamVisualEffect = VFX_BEAM_SILENT_HOLY; + break; + + case 4: nBeamVisualEffect = VFX_BEAM_DISINTEGRATE; + break; + + case 5: nBeamVisualEffect = VFX_BEAM_SILENT_COLD; + break; + + case 6: nBeamVisualEffect = VFX_BEAM_ODD; + break; + + case 7: nBeamVisualEffect = VFX_BEAM_MIND; + break; + + case 8: break; + } + + //VFX + effect eVis = EffectBeam(nBeamVisualEffect, oPC, BODY_NODE_HAND, !nTouch); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(nTouch) + { + //SR check + if(!PRCDoResistSpell(oPC, oTarget, (nCasterLvl + SPGetPenetr()))) + { + + //blind + if(nHD < 7) SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), oTarget, RoundsToSeconds(d4(2))); + + if(nRoll == 8) + { + bTwoRolls = TRUE; + nRoll2 = d8(1); + + while(nRoll == 8) + { + nRoll = d8(1); + } + while (nRoll2 == 8) + { + nRoll2 = d8(1); + } + } + + DoRay(oTarget, nSaveDC, nRoll, nCasterLvl, oPC); + + if(bTwoRolls == TRUE) + { + if(!GetIsDead(oTarget)) //because let's face it; chances are good they are.... + { + DoRay(oTarget, nSaveDC, nRoll2, nCasterLvl, oPC); + } + } + } + } + PRCSetSchool(); +} + +void DoRay(object oTarget, int nSaveDC, int nRoll, int nCasterLvl, object oPC) +{ + int nDam; + switch(nRoll) + { + case 1: + { + nDam = 20 + (nCasterLvl/2); + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_FIRE)) + { + nDam = nDam/2; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + break; + } + + case 2: + { + nDam = 40 + (nCasterLvl/2); + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_ACID)) + { + nDam = nDam/2; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ACID), oTarget); + break; + } + + case 3: + { + nDam = 80 + (nCasterLvl/2); + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nSaveDC, SAVING_THROW_TYPE_ELECTRICITY)) + { + nDam = nDam/2; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ELECTRICAL), oTarget); + break; + } + + case 4: + { + if (PRCGetIsAliveCreature(oTarget) && (GetIsImmune(oTarget, IMMUNITY_TYPE_POISON) == FALSE)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_POISON)) + { + DeathlessFrenzyCheck(oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDeath()), oTarget); + } + + else ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, d6(1), DURATION_TYPE_TEMPORARY, TRUE, -1.0); + } + break; + } + + case 5: + { + PRCDoPetrification(nCasterLvl, oPC, oTarget, SPELL_PRISMATIC_RAY, nSaveDC); + break; + } + + case 6: + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nSaveDC, SAVING_THROW_TYPE_SPELL)) + { + effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S); + effect eConfuse = PRCEffectConfused(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eMind, eConfuse); + eLink = EffectLinkEffects(eLink, eDur); + eLink = SupernaturalEffect(eLink); + + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0, TRUE,-1,nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + break; + } + + case 7: + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nSaveDC, SAVING_THROW_TYPE_SPELL)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); + + int nMessageRoll = d6(1); + int nTalk; + + switch(nMessageRoll) + { + case 1: + { + nTalk = 1729332; + break; + } + + case 2: + { + nTalk = 1729333; + break; + } + + case 3: + { + nTalk = 1729334; + break; + } + + case 4: + { + nTalk = 1729335; + break; + } + + case 5: + { + nTalk = 1729336; + break; + } + + case 6: + { + nTalk = 1729337; + break; + } + } + + //Death Popup + DelayCommand(2.75, PopUpDeathGUIPanel(oTarget, FALSE , TRUE, nTalk)); + DelayCommand(2.75, ExecuteScript("prc_ondeath", oTarget)); + } + } + } +} \ No newline at end of file diff --git a/35expandedspells/sp_prismt_sphrA.ncs b/35expandedspells/sp_prismt_sphrA.ncs new file mode 100644 index 00000000..a9258a0a Binary files /dev/null and b/35expandedspells/sp_prismt_sphrA.ncs differ diff --git a/35expandedspells/sp_prismt_sphrA.nss b/35expandedspells/sp_prismt_sphrA.nss new file mode 100644 index 00000000..21745de7 --- /dev/null +++ b/35expandedspells/sp_prismt_sphrA.nss @@ -0,0 +1,215 @@ +//:://///////////////////////////////////////////// +//:: Name Prismatic Sphere on enter +//:: FileName sp_prismt_sphrA.nss +//::////////////////////////////////////////////// +/**@file Prismatic Sphere +Abjuration +Level: Protection 9, Sor/Wiz 9, Sun 9 +Components: V +Range: 10 ft. +Effect: 10-ft.-radius sphere centered on you + +This spell functions like prismatic wall, except you +conjure up an immobile, opaque globe of shimmering, +multicolored light that surrounds you and protects +you from all forms of attack. The sphere flashes in +all colors of the visible spectrum. + +The sphere’s blindness effect on creatures with less +than 8 HD lasts 2d4x10 minutes. + +You can pass into and out of the prismatic sphere and +remain near it without harm. However, when you’re +inside it, the sphere blocks any attempt to project +something through the sphere (including spells). Other +creatures that attempt to attack you or pass through +suffer the effects of each color, one at a time. + +Typically, only the upper hemisphere of the globe will +exist, since you are at the center of the sphere, so +the lower half is usually excluded by the floor surface +you are standing on. + +The colors of the sphere have the same effects as the +colors of a prismatic wall. + +Red 1st Deals 20 points of fire damage (Reflex half). +Orange 2nd Deals 40 points of acid damage (Reflex half). +Yellow 3rd Deals 80 points of electricity damage (Reflex half). +Green 4th Poison (Kills; Fortitude partial for 1d6 points of Con damage instead). +Blue 5th Turned to stone (Fortitude negates). +Indigo 6th Will save or become insane (as insanity spell). +Violet 7th Creatures sent to another plane (Will negates). + +Author: Tenjac +Created: 7/6/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + object oPC = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + int nDC = PRCGetSaveDC(oTarget, oPC); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDam; + int nPenetr = nCasterLvl + SPGetPenetr(); + + //Passing into the wall + SetLocalInt(oTarget, "PRC_INSIDE_PRISMATIC_SPHERE", 1); + + if(!GetIsReactionTypeFriendly(oTarget, oPC) && (oTarget != oPC)) + { + //Red + if(!PRCDoResistSpell(oPC, oTarget,nPenetr)) + { + nDam = 20 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_FIRE)) + { + nDam = 10 + nPenetr; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + } + + //Orange + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + nDam = 40 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ACID)) + { + nDam = 20 + nPenetr; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ACID), oTarget); + } + + //Yellow + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + nDam = 80 + nPenetr; + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ELECTRICITY)) + { + nDam = 40 + nPenetr; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ELECTRICAL), oTarget); + } + + //Green + if (PRCGetIsAliveCreature(oTarget) && (GetIsImmune(oTarget, IMMUNITY_TYPE_POISON) == FALSE)) + { + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_POISON)) + { + DeathlessFrenzyCheck(oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDeath()), oTarget); + } + + else ApplyAbilityDamage(oTarget, ABILITY_CONSTITUTION, d6(1), DURATION_TYPE_TEMPORARY, TRUE, -1.0); + } + } + + //Blue + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) PRCDoPetrification(nCasterLvl, oPC, oTarget, SPELL_PRISMATIC_RAY, nDC); + + //Indigo + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S); + effect eConfuse = PRCEffectConfused(); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eMind, eConfuse); + eLink = EffectLinkEffects(eLink, eDur); + eLink = SupernaturalEffect(eLink); + + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget, 0.0, TRUE, SPELL_PRISMATIC_SPHERE, nCasterLvl); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + + //Violet + if(!PRCDoResistSpell(oPC, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); + + int nMessageRoll = d6(1); + int nTalk; + + switch(nMessageRoll) + { + case 1: + { + nTalk = 1729332; + break; + } + + case 2: + { + nTalk = 1729333; + break; + } + + case 3: + { + nTalk = 1729334; + break; + } + + case 4: + { + nTalk = 1729335; + break; + } + + case 5: + { + nTalk = 1729336; + break; + } + + case 6: + { + nTalk = 1729337; + break; + } + } + //Death Popup + DelayCommand(2.75, PopUpDeathGUIPanel(oTarget, FALSE , TRUE, nTalk)); + DelayCommand(2.75, ExecuteScript("prc_ondeath", oTarget)); + } + } + } +} + + + + + + + + + + + + + + + + + + diff --git a/35expandedspells/sp_prot_arrows.ncs b/35expandedspells/sp_prot_arrows.ncs new file mode 100644 index 00000000..310ae840 Binary files /dev/null and b/35expandedspells/sp_prot_arrows.ncs differ diff --git a/35expandedspells/sp_prot_arrows.nss b/35expandedspells/sp_prot_arrows.nss new file mode 100644 index 00000000..3f7ef4b6 --- /dev/null +++ b/35expandedspells/sp_prot_arrows.nss @@ -0,0 +1,61 @@ +//:://///////////////////////////////////////////// +//:: Name Protection from Arrows +//:: FileName sp_prot_arrows.nss +//::////////////////////////////////////////////// +/**@file Protection from Arrows +Abjuration +Level: Sor/Wiz 2, Hexblade 2 +Components: V, S, F +Casting Time: 1 standard action +Range: Touch +Target: Creature touched +Duration: 1 hour/level or until discharged +Saving Throw: Will negates (harmless) +Spell Resistance: Yes (harmless) + +The warded creature gains resistance to ranged weapons. +The subject gains damage reduction 10/magic against +ranged weapons. (This spell doesn’t grant you the +ability to damage creatures with similar damage +reduction.) Once the spell has prevented a total of +10 points of damage per caster level (maximum 100 +points), it is discharged. + +Focus: A piece of shell from a tortoise or a turtle. + +**/ + +////////////////////////////////////////////////// +// Author: Tenjac +// Date: 16.9.2006 +///////////////////////////////////////////////// + +#include "prc_alterations" +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + float fDur = HoursToSeconds(nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + PRCSignalSpellEvent(oTarget,FALSE, SPELL_PROTECTION_FROM_ARROWS, oPC); + + // Damage Resistance 10 piercing, max of 100 total + effect eBuff = EffectLinkEffects(EffectDamageResistance(DAMAGE_TYPE_PIERCING, 10+(nCasterLvl/4), min((10 * nCasterLvl), 100)), EffectVisualEffect(VFX_DUR_PROTECTION_ARROWS)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDur); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_rain_btul.ncs b/35expandedspells/sp_rain_btul.ncs new file mode 100644 index 00000000..ef868b46 Binary files /dev/null and b/35expandedspells/sp_rain_btul.ncs differ diff --git a/35expandedspells/sp_rain_btul.nss b/35expandedspells/sp_rain_btul.nss new file mode 100644 index 00000000..372db97b --- /dev/null +++ b/35expandedspells/sp_rain_btul.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Name Rain of Black Tulips +//:: FileName sp_rain_btul.nss +//::////////////////////////////////////////////// +/**@file Rain of Black Tulips +Evocation [Good] +Level: Drd 9 +Components: V, S, M +Casting Time: 1 standard action +Range: Long (400 ft. + 40 ft./level) +Area: Cylinder (80-ft. radius, 80 ft. high) +Duration: 1 round/level (D) +Saving Throw: None (damage), Fortitude negates (nausea) +Spell Resistance: Yes + +Tulips as black as midnight fall from the sky. The +tulips explode with divine energy upon striking evil +creatures, each of which takes 5d6 points of damage. +In addition, evil creatures that fail a Fortitude +save are nauseated (unable to attack, cast spells, +concentrate on spells, perform any task requiring +concentration, or take anything other than a single +move action per turn) until they leave the spell's +area. A successful Fortitude save renders a creature +immune to the nauseating effect of the tulips, but +not the damage. + +Material Component: A black tulip. + +Author: Tenjac +Created: 7/14/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oPC); + effect eAOE = EffectAreaOfEffect(VFX_AOE_RAIN_OF_BLACK_TULIPS); + location lLoc = PRCGetSpellTargetLocation(); + int nMetaMagic = PRCGetMetaMagicFeat(); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 24.38f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + int nDam; + int nAlign; + float fDur = RoundsToSeconds(nCasterLvl); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + //Create AoE + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lLoc, fDur); + + object oAoE = GetAreaOfEffectObject(lLoc, "VFX_AOE_RAIN_OF_BLACK_TULIPS"); + SetAllAoEInts(SPELL_RAIN_OF_BLACK_TULIPS, oAoE, PRCGetSpellSaveDC(SPELL_RAIN_OF_BLACK_TULIPS, SPELL_SCHOOL_EVOCATION), 0, nCasterLvl); + + //Loop through and damage creatures + while(GetIsObjectValid(oTarget)) + { + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + nDam = d6(5+nCasterLvl); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(5+nCasterLvl); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 24.38f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + //SPGoodShift(oPC); + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_rain_ember.ncs b/35expandedspells/sp_rain_ember.ncs new file mode 100644 index 00000000..6f665b83 Binary files /dev/null and b/35expandedspells/sp_rain_ember.ncs differ diff --git a/35expandedspells/sp_rain_ember.nss b/35expandedspells/sp_rain_ember.nss new file mode 100644 index 00000000..ce0a1151 --- /dev/null +++ b/35expandedspells/sp_rain_ember.nss @@ -0,0 +1,135 @@ +//:://///////////////////////////////////////////// +//:: Name Rain of Embers +//:: FileName sp_rain_ember.nss +//::////////////////////////////////////////////// +/**@file Rain of Embers +Evocation [Fire, Good] +Level: Sanctified 7 +Components: V, S, Sacrifice +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Area: Cylinder (40-ft. radius, 120 ft. high) +Duration: 1 round/level (D) +Saving Throw: Reflex half; see text +Spell Resistance: Yes + +This spell causes orange, star-like embers to rain +steadily from above. Each round, the falling embers +deal 10d6 points of damage to evil creatures within +the spell's area. Half of the damage is fire damage, +but the other half results directly from divine +power and is therefore not subject to being reduced +by resistance to fire-based attacks, such as that +granted by protection from energy (fire), +fire shield (chill shield), and similar magic. +Creatures may leave the area to avoid taking +additional damage, but a new saving throw is required +each round a creature is caught in the Fiery downpour. + +A shield provides a cover bonus on the Reflex save, +depending on its size small +2, large +4, tower +7. +A shield spell oriented upward provides a +4 cover +bonus on the Reflex save. A creature using its +shield (or shield spell) to block the rain of embers +cannot use it for defense in combat. + +Sacrifice: 1d2 points of Strength drain. + +Author: Tenjac +Created: 6/21/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +void EmberLoop(int nCounter, int nCasterLvl, int nMetaMagic, object oPC, location lLoc); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oPC); + float fDur = RoundsToSeconds(nCasterLvl); + int nCounter = FloatToInt(fDur/6); + int nMetaMagic = PRCGetMetaMagicFeat(); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + //VFX + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_FIRESTORM), lLoc, fDur); + + EmberLoop(nCounter, nCasterLvl, nMetaMagic, oPC, lLoc); + + DoCorruptionCost(oPC, ABILITY_STRENGTH, d2(), 1); + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + PRCSetSchool(); + //SPGoodShift(oPC); +} + +void EmberLoop(int nCounter, int nCasterLvl, int nMetaMagic, object oPC, location lLoc) +{ + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + int nDam; + int nDam2; + + while(GetIsObjectValid(oTarget)) + { + if(GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL) + { + //Spell Resist + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + int nDC = PRCGetSaveDC(oTarget, oPC); + //Save + + nDam = d6(10+nCasterLvl); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(10+nCasterLvl); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if (PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_GOOD)) + { + nDam = (nDam/2); + } + + nDam2 = (nDam/2); + nDam = (nDam - nDam2); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_FIRE), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam2, DAMAGE_TYPE_DIVINE), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 12.19f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + nCounter--; + + if(nCounter > 0) + { + DelayCommand(6.0f, EmberLoop(nCounter, nCasterLvl, nMetaMagic, oPC, lLoc)); + } +} + + + + + + + \ No newline at end of file diff --git a/35expandedspells/sp_rainbow_blast.ncs b/35expandedspells/sp_rainbow_blast.ncs new file mode 100644 index 00000000..70498ce1 Binary files /dev/null and b/35expandedspells/sp_rainbow_blast.ncs differ diff --git a/35expandedspells/sp_rainbow_blast.nss b/35expandedspells/sp_rainbow_blast.nss new file mode 100644 index 00000000..d96dfdcb --- /dev/null +++ b/35expandedspells/sp_rainbow_blast.nss @@ -0,0 +1,211 @@ +//:://///////////////////////////////////////////// +//:: Name Rainbow Blast +//:: FileName sp_rainbow_blast.nss +//::////////////////////////////////////////////// +/**@file Rainbow Blast +Evocation [Light] +Level: Sorcerer/wizard 3 +Components: V, S, M +Casting Time: 1 standard action +Range: 120 ft. +Area: 120-ft. line +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +This spell is a wide-spectrum blast of +radiant energy composed of all five +energy types. Rainbow blast deals 1d6 +points of damage from each of the five +energy types (acid, cold, electricity, +fire, and sonic), for a total of 5d6 points +of damage. Creatures apply resistance +to energy separately for each type of +damage. +As you gain in levels, the damage +die increases in size. At 7th level the +spell deals 5d8 points of damage, at 9th +level it deals 5d10 points of damage, +and at 11th level it deals 5d12 points of +damage; one die for each of the five +energy types. +Focus: A small clear gem or crystal +prism worth at least 50 gp. + +Author: Tenjac +Created: 6/28/07 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "spinc_bolt" + +int GetDieType(int nCasterLevel) +{ + + if(nCasterLevel > 20) return 22; + if(nCasterLevel > 18) return 20; + if(nCasterLevel > 16) return 18; + if(nCasterLevel > 14) return 16; + if(nCasterLevel > 12) return 14; + if(nCasterLevel > 10) return 12; + if(nCasterLevel > 8) return 10; + if(nCasterLevel > 6) return 8; + return 6; +} + +void DoBoltVFX(location lCaster, location lTarget) +{ + // Do VFX. This is moderately heavy, so it isn't duplicated by Twin Power + float fAngle = GetRelativeAngleBetweenLocations(lCaster, lTarget); + float fRadius = FeetToMeters(5.0f); + float fVFXLength = GetVFXLength(lCaster, 36.6f, GetRelativeAngleBetweenLocations(lCaster, lTarget)); + // A tube of beams, radius 5ft, starting 1m from manifester and running for the length of the line + BeamGengon(DURATION_TYPE_TEMPORARY, VFX_BEAM_MIND, lCaster, fRadius, fRadius, + 1.0f, fVFXLength, // Start 1m from the manifester, end at LOS end + 8, // 8 sides + 4.5f, "prc_invisobj", + 0.0f, // Drawn instantly + 0.0f, 0.0f, 45.0f, "y", fAngle, 0.0f, + -1, -1, 0.0f, 1.0f, // No secondary VFX + 4.5f + ); +} + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + location lCaster = GetLocation(OBJECT_SELF); + vector vOrigin = GetPosition(OBJECT_SELF); + + int nCasterLevel = PRCGetCasterLevel(); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDieSides = GetDieType(nCasterLevel); + + DoBoltVFX(lCaster, lTarget); + + int nDamage; + int nSaveDC; + float fDelay; + + + // individual effect + effect eDamage; + + // spell damage effects + // Loop over targets in the spell shape + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCYLINDER, 36.6f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, vOrigin); + while(GetIsObjectValid(oTarget)) + { + if(oTarget != oCaster && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + // Let the AI know + PRCSignalSpellEvent(oTarget, TRUE, SPELL_RAINBOW_BLAST, oCaster); + + // Make an SR check + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + nSaveDC = PRCGetSaveDC(oTarget, OBJECT_SELF); + + fDelay = GetDistanceBetweenLocations(lCaster, GetLocation(oTarget)) / 20.0f; + + // Roll fire damage + nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_FIRE, 1, nDieSides); + // Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nSaveDC, SAVING_THROW_TYPE_FIRE); + if(nDamage > 0) + { + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_FIRE); + DelayCommand(1.0f + fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(1.0f + fDelay, PRCBonusDamage(oTarget)); + DelayCommand(1.0f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_S), oTarget)); + }// end if - There was still damage remaining to be dealt after adjustments + + // Roll acid damage + nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_ACID, 1, nDieSides); + // Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nSaveDC, SAVING_THROW_TYPE_ACID); + if(nDamage > 0) + { + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ACID); + DelayCommand(1.0f + fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(1.0f + fDelay, PRCBonusDamage(oTarget)); + DelayCommand(1.0f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_ACID_S), oTarget)); + }// end if - There was still damage remaining to be dealt after adjustments + + // Roll cold damage + nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_COLD, 1, nDieSides); + // Cold has a fort save for half + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_COLD)) + { + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + nDamage = 0; + nDamage /= 2; + } + + if(nDamage > 0) + { + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_COLD); + DelayCommand(1.0f + fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(1.0f + fDelay, PRCBonusDamage(oTarget)); + DelayCommand(1.0f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FROST_S), oTarget)); + }// end if - There was still damage remaining to be dealt after adjustments + + // Roll electrical damage + nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_ELECTRICAL, 1, nDieSides); + // Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nSaveDC, SAVING_THROW_TYPE_ELECTRICITY); + if(nDamage > 0) + { + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_ELECTRICAL); + DelayCommand(1.0f + fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(1.0f + fDelay, PRCBonusDamage(oTarget)); + DelayCommand(1.0f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_S), oTarget)); + }// end if - There was still damage remaining to be dealt after adjustments + + // Roll sonic damage + nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_SONIC, 1, nDieSides); + // Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nSaveDC, SAVING_THROW_TYPE_SONIC); + if(nDamage > 0) + { + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_SONIC); + DelayCommand(1.0f + fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget)); + DelayCommand(1.0f + fDelay, PRCBonusDamage(oTarget)); + DelayCommand(1.0f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SONIC), oTarget)); + }// end if - There was still damage remaining to be dealt after adjustments + }// end if - SR check + }// end if - Target validity check + + // Get next target + oTarget = MyNextObjectInShape(SHAPE_SPELLCYLINDER, 36.6f, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, vOrigin); + }// end while - Target loop + + PRCSetSchool(); +} + + + + + + + + + + + + + + + + + + + + diff --git a/35expandedspells/sp_raptr_ruptr.ncs b/35expandedspells/sp_raptr_ruptr.ncs new file mode 100644 index 00000000..c293e638 Binary files /dev/null and b/35expandedspells/sp_raptr_ruptr.ncs differ diff --git a/35expandedspells/sp_raptr_ruptr.nss b/35expandedspells/sp_raptr_ruptr.nss new file mode 100644 index 00000000..5c3241ed --- /dev/null +++ b/35expandedspells/sp_raptr_ruptr.nss @@ -0,0 +1,188 @@ +//:://///////////////////////////////////////////// +//:: Name Rapture of Rupture +//:: FileName sp_rapt_rupt.nss +//::////////////////////////////////////////////// +/** @file +Rapture of Rupture +Transmutation [Evil] +Level: Corrupt 7 +Components: V, S, Corrupt +Casting Time: 1 action +Range: Touch +Target: One living creature touched per level +Duration: Instantaneous +Saving Throw: Fortitude half +Spell Resistance: Yes + +With this spell, the caster's touch deals grievous +wounds to multiple targets. After rapture of rupture +is cast, the caster can touch one target per round +until she has touched a number of targets equal to +her caster level. The same creature cannot be +affected twice by the same rapture of rupture. A +creature with no discernible anatomy is unaffected by +this spell. + +When the caster touches a subject, his flesh bursts +open suddenly in multiple places. Each subject takes +6d6 points of damage and is stunned for 1 round; a +successful Fortitude save reduces damage by half and +negates the stun effect. Subjects who fail their +Fortitude save continue to take 1d6 points of damage +per round until they receive magical healing, succeed +at a Heal check (DC 20), or die. If a subject takes 6 +points of damage from rapture of rupture in a single +round, he is stunned in the following round. + +Corruption Cost: 1 point of Strength damage per target +touched. + +*/ +// Author: Tenjac +// Created: 5/31/2006 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent, string sScript); +void WoundLoop(object oTarget, int nDamage = 0); + + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + + /*if(GetRunningEvent() == EVENT_VIRTUAL_ONDAMAGED) + { + ConcentrationLossCode(oCaster, GetLocalObject(oCaster, PRC_SPELL_CONC_TARGET), nCasterLevel); + return; + }*/ + + object oTarget = PRCGetSpellTargetObject(); + int nSpellID = GetSpellId(); + string sScript = Get2DACache("spells", "ImpactScript", nSpellID); + + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, PRCGetCasterLevel(oCaster)); + + // Setup target tracking set. If one remains from a previous casting, delete it first + if(set_exists(oCaster, "PRC_Spell_RoRTargets")) + set_delete(oCaster, "PRC_Spell_RoRTargets"); + set_create(oCaster, "PRC_Spell_RoRTargets"); + + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent, sScript); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent, sScript)) + DecrementSpellCharges(oCaster); + } + } + + //SPEvilShift(oCaster); + + //Corrupt spells get mandatory 10 pt evil adjustment, regardless of switch + AdjustAlignment(oCaster, ALIGNMENT_EVIL, 10, FALSE); + + PRCSetSchool(); +} + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent, string sScript) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + string sCaster = GetLocalString(oCaster, "PRCRuptureID"); + string sTest = GetLocalString(oTarget, "PRCRuptureTargetID"); + + // Roll to hit + int iAttackRoll = PRCDoMeleeTouchAttack(oTarget); + if (iAttackRoll > 0) + { + // Target validity check - should not have been targeted before + // and should have discernible anatomy (excludes constructs, elementals, oozes, plants, undead) + int nRace = MyPRCGetRacialType(oTarget); + if(!set_contains_object(oCaster, "PRC_Spell_RoRTargets", oTarget) && + nRace != RACIAL_TYPE_CONSTRUCT && + nRace != RACIAL_TYPE_ELEMENTAL && + nRace != RACIAL_TYPE_OOZE && + //nRace != RACIAL_TYPE_PLANT && + nRace != RACIAL_TYPE_UNDEAD + ) + { + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + // Roll damage and apply metamagic + int nDam = d6(6+nPenetr); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 6*(6+nPenetr); + if(nMetaMagic & METAMAGIC_EMPOWER) + nDam += nDam / 2; + + // Save for half damage + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC, SAVING_THROW_TYPE_EVIL)) + { + nDam /= 2; + + // If the target has Mettle, do no damage. However, the target will still count as having been affected by the spell + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + nDam = 0; + } + // On failed save, stun for a round and start bleeding + else + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 6.0f); + WoundLoop(oTarget); // Init the wound loop. This will deal d6 damage, which in turn determines whether the target will be stunned again next round + } + + // Apply Damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + + // If this spell was a held charge, it can have multiple targets. So we need to keep track of who has been already affected + if(nEvent) + set_add_object(oCaster, "PRC_Spell_RoRTargets", oTarget); + } + } + + // Corruption cost is paid whenever something is hit + DoCorruptionCost(oCaster, ABILITY_STRENGTH, 1, 0); + } + + // Return the result of the touch attack, will be used to determine whether to reduce number of touch attacks remaining + return iAttackRoll; +} + +void WoundLoop(object oTarget, int nDamage = 0) +{ + // If previous round's damage roll was 6, stun this round + if(nDamage == 6) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 6.0f); + + // Roll and apply new damage + nDamage = d6(); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL), oTarget); + + DelayCommand(6.0f, WoundLoop(oTarget, nDamage)); +} diff --git a/35expandedspells/sp_right_smt.ncs b/35expandedspells/sp_right_smt.ncs new file mode 100644 index 00000000..dfae739d Binary files /dev/null and b/35expandedspells/sp_right_smt.ncs differ diff --git a/35expandedspells/sp_right_smt.nss b/35expandedspells/sp_right_smt.nss new file mode 100644 index 00000000..9dd5e542 --- /dev/null +++ b/35expandedspells/sp_right_smt.nss @@ -0,0 +1,121 @@ +//:://///////////////////////////////////////////// +//:: Name Righteous Smite +//:: FileName sp_right_smt.nss +//::////////////////////////////////////////////// +/**@file Righteous Smite +Evocation [Good] +Level: Clr 7, exalted arcanist 7, Wrath 7 +Components: V, S +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Area: 20-ft. radius spread +Duration: Instantaneous +Saving Throw: Will partial; see text +Spell Resistance: Yes + +You draw down holy power to smite your enemies. Only +evil and neutral creatures are harmed by the spell; +good creatures are unaffected. + +The spell deals 1d6 points of damage per caster +level (maximum 20d6) to evil creatures (or 1d8 +points of damage per caster level, maximum 20d8, +to evil outsiders) and blinds them for 1d4 rounds. +A successful Will saving throw reduces damage to +half and negates the blinding effect. + +The spell deals only half damage against creatures +that are neither good nor evil, and they are not +blinded. They can reduce that damage by half (down +to one quarter of the roll) with a successful Will +save. + +Author: Tenjac +Created: 6/22/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 6.10, lLoc, FALSE, OBJECT_TYPE_CREATURE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDam; + int nAlign; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDC; + float fDur = RoundsToSeconds(d4(1)); + + while(GetIsObjectValid(oTarget)) + { + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + nAlign = GetAlignmentGoodEvil(oTarget); + nDC = PRCGetSaveDC(oTarget, oPC); + + if((MyPRCGetRacialType(oTarget) == RACIAL_TYPE_OUTSIDER) && (nAlign == ALIGNMENT_EVIL)) + { + nDam = d8(min(nCasterLvl, 20+nCasterLvl)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 8 * (min(nCasterLvl, 20+nCasterLvl)); + } + } + + else + { + nDam = d6(min(nCasterLvl, 20+nCasterLvl)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (min(nCasterLvl, 20+nCasterLvl)); + } + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //Save for 1/2 + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + if(nAlign == ALIGNMENT_EVIL) + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), oTarget, fDur); + } + else + { + if (GetHasMettle(oTarget, SAVING_THROW_WILL)) + // This script does nothing if it has Mettle, bail + return; + nDam = (nDam/2); + } + + if(nAlign == ALIGNMENT_NEUTRAL) + { + // neutral takes 1/2 damage + nDam = (nDam/2); + } + + //Deal damage to non-good + if(nAlign != ALIGNMENT_GOOD) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 6.10, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + //SPGoodShift(oPC); + PRCSetSchool(); +} + + \ No newline at end of file diff --git a/35expandedspells/sp_rightmt.ncs b/35expandedspells/sp_rightmt.ncs new file mode 100644 index 00000000..bad1b1a5 Binary files /dev/null and b/35expandedspells/sp_rightmt.ncs differ diff --git a/35expandedspells/sp_rightmt.nss b/35expandedspells/sp_rightmt.nss new file mode 100644 index 00000000..2c4ac7a8 --- /dev/null +++ b/35expandedspells/sp_rightmt.nss @@ -0,0 +1,48 @@ +#include "prc_inc_spells" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + + // Get the target and raise the spell cast event. + object oTarget = PRCGetSpellTargetObject(); + PRCSignalSpellEvent(oTarget, FALSE); + + // Determine the spell's duration, taking metamagic feats into account. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + float fDuration = PRCGetMetaMagicDuration(RoundsToSeconds(nCasterLvl)); + + // Calculate the proper DR. + int nDR = 5; + if (nCasterLvl >= 12) nDR = 10; + if (nCasterLvl >= 15) nDR = 15; + if (nCasterLvl >= 17) nDR = 16; + if (nCasterLvl >= 19) nDR = 17; + if (nCasterLvl >= 21) nDR = 18; + if (nCasterLvl >= 23) nDR = 19; + if (nCasterLvl >= 25) nDR = 20; + if (nCasterLvl >= 27) nDR = 21; + if (nCasterLvl >= 29) nDR = 22; + if (nCasterLvl >= 31) nDR = 23; + if (nCasterLvl >= 33) nDR = 24; + if (nCasterLvl >= 35) nDR = 25; + if (nCasterLvl >= 37) nDR = 26; + if (nCasterLvl >= 39) nDR = 27; + if (nCasterLvl >= 41) nDR = 28; + + // Create the chain of buffs to apply, including the vfx. + effect eBuff = EffectAbilityIncrease(ABILITY_STRENGTH, 8); + eBuff = EffectLinkEffects (eBuff, EffectAbilityIncrease(ABILITY_CONSTITUTION, 4)); + eBuff = EffectLinkEffects (eBuff, EffectACIncrease(4, AC_NATURAL_BONUS)); + eBuff = EffectLinkEffects (eBuff, EffectDamageReduction(nDR, DAMAGE_POWER_PLUS_TWO)); + eBuff = EffectLinkEffects (eBuff, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MAJOR)); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3), oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLvl); +// SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RESTORATION_GREATER), oTarget); + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_ring_bldsC.ncs b/35expandedspells/sp_ring_bldsC.ncs new file mode 100644 index 00000000..f584ef6c Binary files /dev/null and b/35expandedspells/sp_ring_bldsC.ncs differ diff --git a/35expandedspells/sp_ring_bldsC.nss b/35expandedspells/sp_ring_bldsC.nss new file mode 100644 index 00000000..b379138e --- /dev/null +++ b/35expandedspells/sp_ring_bldsC.nss @@ -0,0 +1,69 @@ +//:://///////////////////////////////////////////// +//:: Name Ring of Blades HB +//:: FileName sp_ring_bldsc.nss +//::////////////////////////////////////////////// +/**@file Ring of Blades +Conjuration (Creation) +Level: Cleric 3, warmage 3 +Components: V,S, M +Casting Time: 1 standard action +Range: Personal +Target: You +Duration: 1 min./level + +This spell conjures a horizontal ring +of swirling metal blades around you. +The ring extends 5 feet from you, into +all squares adjacent to your space, and +it moves with you as you move. Each +round on your turn, starting when +you cast the spell, the blades deal 1d6 +points of damage +1 point per caster +level (maximum +10) to all creatures +in the affected area. + +The blades conjured by a lawful-aligned +cleric are cold iron, those conjured by +a chaotic-aligned cleric are silver, and +those conjured by a cleric who is neither +lawful nor chaotic are steel. + +Author: Tenjac +Created: 7/6/07 + +Fixed so it finally worked +Strat, Mar 7th, 2019 + +Yeah, it's been totally non-functional for 12 years. +Yay for not testing your shit. +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + if (!GetIsObjectValid(GetAreaOfEffectCreator())) + { + DestroyObject(OBJECT_SELF); + return; + } + + //Declare major variables + object oShadow = GetAreaOfEffectCreator(); + int nCasterLvl = PRCGetCasterLevel(oShadow); + + //Capture the first target object in the shape. + object oTarget = GetFirstInPersistentObject(OBJECT_SELF, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oShadow)) + { + int nDamage = d6() + min(20, nCasterLvl); + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, DAMAGE_TYPE_SLASHING, nDamage), oTarget); + } + //Select the next target within the spell shape. + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } +} diff --git a/35expandedspells/sp_ring_bldsa.ncs b/35expandedspells/sp_ring_bldsa.ncs new file mode 100644 index 00000000..93d2f278 Binary files /dev/null and b/35expandedspells/sp_ring_bldsa.ncs differ diff --git a/35expandedspells/sp_ring_bldsa.nss b/35expandedspells/sp_ring_bldsa.nss new file mode 100644 index 00000000..6943e671 --- /dev/null +++ b/35expandedspells/sp_ring_bldsa.nss @@ -0,0 +1,57 @@ +//:://///////////////////////////////////////////// +//:: Name Ring of Blades OnEnter +//:: FileName sp_ring_bldsa.nss +//::////////////////////////////////////////////// +/**@file Ring of Blades +Conjuration (Creation) +Level: Cleric 3, warmage 3 +Components: V,S, M +Casting Time: 1 standard action +Range: Personal +Target: You +Duration: 1 min./level + +This spell conjures a horizontal ring +of swirling metal blades around you. +The ring extends 5 feet from you, into +all squares adjacent to your space, and +it moves with you as you move. Each +round on your turn, starting when +you cast the spell, the blades deal 1d6 +points of damage +1 point per caster +level (maximum +10) to all creatures +in the affected area. + +The blades conjured by a lawful-aligned +cleric are cold iron, those conjured by +a chaotic-aligned cleric are silver, and +those conjured by a cleric who is neither +lawful nor chaotic are steel. + +Author: Tenjac +Created: 7/6/07 + +Fixed so it finally worked +Strat, Mar 7th, 2019 + +Yeah, it's been totally non-functional for 12 years. +Yay for not testing your shit. +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + object oTarget = GetEnteringObject(); + object oPC = GetAreaOfEffectCreator(); + int nCasterLvl = PRCGetCasterLevel(oPC); + if(nCasterLvl > 20) nCasterLvl = 20; + int nDam = d6(1) + nCasterLvl; + + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oPC) && oTarget != oPC) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, DAMAGE_TYPE_SLASHING, nDam), oTarget); + } +} \ No newline at end of file diff --git a/35expandedspells/sp_scorch_ray.ncs b/35expandedspells/sp_scorch_ray.ncs new file mode 100644 index 00000000..29b1e74b Binary files /dev/null and b/35expandedspells/sp_scorch_ray.ncs differ diff --git a/35expandedspells/sp_scorch_ray.nss b/35expandedspells/sp_scorch_ray.nss new file mode 100644 index 00000000..77ae5744 --- /dev/null +++ b/35expandedspells/sp_scorch_ray.nss @@ -0,0 +1,112 @@ +//:://///////////////////////////////////////////// +//:: Name Scorching Ray +//:: FileName sp_scorch_ray.nss +//::////////////////////////////////////////////// +/**@file Scorching Ray +Evocation [Fire] +Level: Sor/Wiz 2, Duskblade 2 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: One or more rays +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +You blast your enemies with fiery rays. You may fire +one ray, plus one additional ray for every four levels +beyond 3rd (to a maximum of three rays at 11th level). +Each ray requires a ranged touch attack to hit and deals +4d6 points of fire damage. + +The rays may be fired at the same or different targets, +but all bolts must be aimed at targets within 30 feet of +each other and fired simultaneously. + +**/ +//:://////////////////////////////////////////////// +//:: Author: Tenjac +//:: Date : 29.9.06 +//:://////////////////////////////////////////////// + + + +/* + + Modify as necessary + Most code should be put in DoSpell() + + PRC_SPELL_EVENT_ATTACK is set when a + touch or ranged attack is used + +*/ +#include "prc_inc_sp_tch" +#include "prc_add_spell_dc" +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nRays = 5; + int nDam; + int iAttackRoll; + + PRCSignalSpellEvent(oTarget, TRUE); + + if(nCasterLevel < 19) + { + nRays =4; + } + if(nCasterLevel < 15) + { + nRays =3; + } + + if(nCasterLevel < 11) + { + nRays =2; + } + + if(nCasterLevel < 7) + { + nRays = 1; + } + + while(nRays > 0) + { + nRays--; + iAttackRoll = PRCDoRangedTouchAttack(oTarget); + + //Beam + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE, oCaster, BODY_NODE_HAND, !iAttackRoll), oTarget, 1.0f); + + if (iAttackRoll > 0) + { + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + nDam = d6(4+(nPenetr/4)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(4+(nPenetr/4)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDam, ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE)); + } + } + + } + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_seeking_ray.ncs b/35expandedspells/sp_seeking_ray.ncs new file mode 100644 index 00000000..b726c453 Binary files /dev/null and b/35expandedspells/sp_seeking_ray.ncs differ diff --git a/35expandedspells/sp_seeking_ray.nss b/35expandedspells/sp_seeking_ray.nss new file mode 100644 index 00000000..e7818faa --- /dev/null +++ b/35expandedspells/sp_seeking_ray.nss @@ -0,0 +1,123 @@ +//:://///////////////////////////////////////////// +//:: Name Seeking Ray +//:: FileName sp_seeking_ray.nss +//::////////////////////////////////////////////// +/**@file Seeking Ray +Evocation +Level: Duskblade 2, sorcerer/wizard 2 +Components: V,S +Casting Time: 1 standard action +Range: Medium +Effect: Ray +Duration: Instantaneous; see text +Saving Throw: None +Spell Resistance: Yes + +You create a ray that deals 4d6 points of electricity +damage if it strikes your target. While this ray +requires a ranged touch attack to strike an opponent, +it ignores concealment and cover (but not total +concealment or total cover), and it does not take the +standard penalty for firing into melee. + +In addition to the damage it deals, the ray creates a +link of energy between you and the subject. If this +ray struck the target and dealt damage, you gain a +4 +bonus on attacks you make with ray spells (including +another casting of this one, if desired) against the +subject for 1 round per caster level. If you cast +seeking ray a second time on a creature that is still +linked to you from a previous casting, the duration +of the new link overlaps (does not stack with) the +remaining duration of the previous one. + +**/ +////////////////////////////////////////////////////// +// Author: Tenjac +// Date: 26.9.06 +////////////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + float fDur = RoundsToSeconds(nCasterLevel); + + //INSERT SPELL CODE HERE + int iAttackRoll = 0; //placeholder + + iAttackRoll = PRCDoRangedTouchAttack(oTarget); + + //Beam VFX. Ornedan is my hero. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oCaster, BODY_NODE_HAND, !iAttackRoll), oTarget, 1.0f); + + if (iAttackRoll > 0) + { + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLevel + SPGetPenetr())) + { + //Touch attack code goes here + int nDam = d6(4+(nPenetr/4)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6*(4+(nPenetr/4)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ELECTRICAL), oTarget); + + //Apply VFX for duration to enable "seeking" - add code to prc_inc_sp_touch! + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), oTarget, fDur); + } + } + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} + + \ No newline at end of file diff --git a/35expandedspells/sp_seeth_eyebn.ncs b/35expandedspells/sp_seeth_eyebn.ncs new file mode 100644 index 00000000..f0daa719 Binary files /dev/null and b/35expandedspells/sp_seeth_eyebn.ncs differ diff --git a/35expandedspells/sp_seeth_eyebn.nss b/35expandedspells/sp_seeth_eyebn.nss new file mode 100644 index 00000000..8168a5d8 --- /dev/null +++ b/35expandedspells/sp_seeth_eyebn.nss @@ -0,0 +1,96 @@ +//:://///////////////////////////////////////////// +//:: Name: Seething Eyebane +//:: Filename: sp_seeth_eyebn.nss +//:://///////////////////////////////////////////// +/**Seething Eyebane +Transmutation [Evil, Acid] +Level: Corrupt 1 +Components: V, S, Corrupt +Casting Time: 1 action +Range: Touch +Target: Creature touched +Duration: Instantaneous +Saving Throw: Fortitude negates (see text) +Spell Resistance: Yes + +The subject's eyes burst, spraying acid upon everyone +within 5 feet. The subject is blinded and takes 1d6 +points of acid damage. Those sprayed take 1d6 points +of acid damage (Reflex save for half). Creatures +without eyes can't be blinded, but they might take +acid damage if someone nearby is the subject of +seething eyebane. + +Corruption Cost: 1d6 points of Constitution damage + +@author Written By: Tenjac +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + //define vars + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + location lTarget = GetLocation(oTarget); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC = PRCGetSaveDC(oTarget, oPC); + int nType = MyPRCGetRacialType(oTarget); + + PRCSignalSpellEvent(oTarget, TRUE, SPELL_SEETHING_EYEBANE, oPC); + + if(nType != RACIAL_TYPE_CONSTRUCT && + nType != RACIAL_TYPE_OOZE && + nType != RACIAL_TYPE_ELEMENTAL && + nType != RACIAL_TYPE_UNDEAD) + { + //Spell Resistance + if (!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr())) + { + //Fort save + if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_ACID)) + { + + //Blind target permanently + effect eBlind = EffectBlindness(); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlind, oTarget); + + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 5.0, lTarget, FALSE, OBJECT_TYPE_CREATURE); + + while(GetIsObjectValid(oTarget)) + { + //nDam = 1d6 acid + int nDam = d6(1)+(nCasterLvl/4); + + // Acid Sheath adds +1 damage per die to acid descriptor spells + if (GetHasDescriptor(GetSpellId(), DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oPC)) + nDam += 1; + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_ACID); + + //apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 5.0, lTarget, FALSE, OBJECT_TYPE_CREATURE); + } + + } + } + } + //Corruption cost 1d6 CON regardless of success + int nCost = d6(1); + + DoCorruptionCost(oPC, ABILITY_CONSTITUTION, nCost, 0); + + //Corrupt spells get mandatory 10 pt evil adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_EVIL, 10, FALSE); + + //SPEvilShift(oPC); + PRCSetSchool(); + +} \ No newline at end of file diff --git a/35expandedspells/sp_serp_sigh.ncs b/35expandedspells/sp_serp_sigh.ncs new file mode 100644 index 00000000..0d0b2d93 Binary files /dev/null and b/35expandedspells/sp_serp_sigh.ncs differ diff --git a/35expandedspells/sp_serp_sigh.nss b/35expandedspells/sp_serp_sigh.nss new file mode 100644 index 00000000..7bbe7635 --- /dev/null +++ b/35expandedspells/sp_serp_sigh.nss @@ -0,0 +1,59 @@ +#include "prc_inc_spells" +#include "spinc_bolt" +#include "spinc_cone" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + // Get the number of damage dice. + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int nDice = nCasterLevel > 20 ? 20 : nCasterLevel; + int nSpell = GetSpellId(); + int nVfx; + + if(nSpell == SPELL_SERPENTS_SIGH_BOLT_ACID) + { + DoBolt(nCasterLevel, 6, 0, nDice, 447 /* VFX_BEAM_DISINTEGRATE */, VFX_IMP_ACID_S, + DAMAGE_TYPE_ACID, SAVING_THROW_TYPE_ACID, + SPELL_SCHOOL_EVOCATION, FALSE, SPELL_SERPENTS_SIGH); + nVfx = VFX_IMP_ACID_S; + } + else if(nSpell == SPELL_SERPENTS_SIGH_BOLT_LIGHTNING) + { + DoBolt(nCasterLevel, 6, 0, nDice, VFX_BEAM_LIGHTNING, VFX_IMP_LIGHTNING_S, + DAMAGE_TYPE_ELECTRICAL, SAVING_THROW_TYPE_ELECTRICITY, + SPELL_SCHOOL_EVOCATION, FALSE, SPELL_SERPENTS_SIGH); + nVfx = VFX_IMP_LIGHTNING_S; + } + else if(nSpell == SPELL_SERPENTS_SIGH_CONE_ACID) + { + DoCone(6, 0, 10, -1, VFX_IMP_ACID_S, + DAMAGE_TYPE_ACID, SAVING_THROW_TYPE_ACID, + SPELL_SCHOOL_EVOCATION, SPELL_SERPENTS_SIGH); + nVfx = VFX_IMP_ACID_S; + } + else if(nSpell == SPELL_SERPENTS_SIGH_CONE_COLD) + { + DoCone(6, 0, 10, -1, VFX_IMP_FROST_S, + DAMAGE_TYPE_COLD, SAVING_THROW_TYPE_COLD, + SPELL_SCHOOL_EVOCATION, SPELL_SERPENTS_SIGH); + nVfx = VFX_IMP_FROST_S; + } + else if(nSpell == SPELL_SERPENTS_SIGH_CONE_FIRE) + { + DoCone(6, 0, 10, -1, VFX_IMP_FLAME_S, + DAMAGE_TYPE_FIRE, SAVING_THROW_TYPE_FIRE, + SPELL_SCHOOL_EVOCATION, SPELL_SERPENTS_SIGH); + nVfx = VFX_IMP_FLAME_S; + } + + //The caster takes 1 hit point of damage per hit die of damage dealt. + ApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(OBJECT_SELF, nDice, DAMAGE_TYPE_MAGICAL), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVfx), OBJECT_SELF); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_shock_grasp.ncs b/35expandedspells/sp_shock_grasp.ncs new file mode 100644 index 00000000..276a6533 Binary files /dev/null and b/35expandedspells/sp_shock_grasp.ncs differ diff --git a/35expandedspells/sp_shock_grasp.nss b/35expandedspells/sp_shock_grasp.nss new file mode 100644 index 00000000..b9cd182f --- /dev/null +++ b/35expandedspells/sp_shock_grasp.nss @@ -0,0 +1,115 @@ +//:://///////////////////////////////////////////// +//:: Name Shocking Grasp +//:: FileName sp_shock_grasp.nss +//::////////////////////////////////////////////// +/**@file Shocking Grasp +Evocation [Electricity] +Level: Sor/Wiz 1, Duskblade 1 +Components: V, S +Casting Time: 1 standard action +Range: Touch +Target: Creature or object touched +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +Your successful melee touch attack deals 1d6 points +of electricity damage per caster level (maximum 5d6). +When delivering the jolt, you gain a +3 bonus on +attack rolls if the opponent is wearing metal armor +(or made out of metal, carrying a lot of metal, +or the like). + +**/ +//:://////////////////////////////////////////////// +//:: Author: Tenjac +//:: Date : 29.9.06 +//:://////////////////////////////////////////////// + + +/*3055 + +Modify as necessary +Most code should be put in DoSpell() + +PRC_SPELL_EVENT_ATTACK is set when a +touch or ranged attack is used + +*/ + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDie = min(nCasterLevel, 20); + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + effect eVis = EffectVisualEffect(VFX_DUR_BIGBYS_BIGBLUE_HAND2); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SHOCKING_GRASP)); + + int nAttackBonus = GetBaseAC(oArmor) >= 4 ? 3 : 0; + int iAttackRoll = PRCDoMeleeTouchAttack(oTarget, TRUE, oCaster, nAttackBonus); + + if(iAttackRoll > 0) + { + // Only creatures, and PvP check. + if(!GetIsReactionTypeFriendly(oTarget)) + { + // Check Spell Resistance + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + int nDam = d6(nDie); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 6 * nDie; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + int eDamageType = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ELECTRICAL); + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDam, eDamageType); + PRCBonusDamage(oTarget); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + + return iAttackRoll;// return TRUE if spell charges should be decremented +} + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + if (!X2PreSpellCastCode()) return; + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { + //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_shout.ncs b/35expandedspells/sp_shout.ncs new file mode 100644 index 00000000..da150823 Binary files /dev/null and b/35expandedspells/sp_shout.ncs differ diff --git a/35expandedspells/sp_shout.nss b/35expandedspells/sp_shout.nss new file mode 100644 index 00000000..5b727ba5 --- /dev/null +++ b/35expandedspells/sp_shout.nss @@ -0,0 +1,130 @@ +/* + sp_shout.nss + + Shout + Evocation [Sonic] + Level: Brd 4, Sor/Wiz 4 + Components: V + Casting Time: 1 standard action + Range: 30 ft. + Area: Cone-shaped burst + Duration: Instantaneous + Saving Throw: Fortitude partial or Reflex negates (object); see text + Spell Resistance: Yes (object) + You emit an ear-splitting yell that deafens and damages creatures in its + path. Any creature within the area is deafened for 2d6 rounds and takes + 5d6 points of sonic damage. A successful save negates the deafness and + reduces the damage by half. Any exposed brittle or crystalline object or + crystalline creature takes 1d6 points of sonic damage per caster level + (maximum 15d6). An affected creature is allowed a Fortitude save to reduce + the damage by half, and a creature holding fragile objects can negate damage + to them with a successful Reflex save. + A shout spell cannot penetrate a silence spell. + + Shout, Greater + Evocation [Sonic] + Level: Brd 6, Sor/Wiz 8 + Components: V, S, F + Range: 60 ft. + Saving Throw: Fortitude partial or Reflex negates (object); see text + This spell functions like shout, except that the cone deals 10d6 points of sonic + damage (or 1d6 points of sonic damage per caster level, maximum 20d6, against + exposed brittle or crystalline objects or crystalline creatures). It also causes + creatures to be stunned for 1 round and deafened for 4d6 rounds. A creature in + the area of the cone can negate the stunning and halve both the damage and the + duration of the deafness with a successful Fortitude save. A creature holding + vulnerable objects can attempt a Reflex save to negate the damage to those objects. + Arcane Focus: A small metal or ivory horn. + + By: Flaming_Sword + Created: Sept 9, 2006 + Modified: Sept 9, 2006 + + Label Name IconResRef School Range VS MetaMagic TargetType ImpactScript Bard Cleric Druid Paladin Ranger Wiz_Sorc Innate ConjTime ConjAnim ConjHeadVisual ConjHandVisual ConjGrndVisual ConjSoundVFX ConjSoundMale ConjSoundFemale CastAnim CastTime CastHeadVisual CastHandVisual CastGrndVisual CastSound Proj ProjModel ProjType ProjSpwnPoint ProjSound ProjOrientation ImmunityType ItemImmunity SubRadSpell1 SubRadSpell2 SubRadSpell3 SubRadSpell4 SubRadSpell5 Category Master UserType SpellDesc UseConcentration SpontaneouslyCast AltMessage HostileSetting FeatID Counter1 Counter2 HasProjectile +25 Cone_of_Cold 775 is_ConeCold V S vs 0x3d 0x3E NW_S0_ConeCold **** **** **** **** **** 5 5 1500 hand vco_swar3blue **** **** sco_swar3blue vs_chant_evoc_hm vs_chant_evoc_hf out 1700 **** var_conecold **** sar_conecold 0 **** **** **** **** path Cold 0 **** **** **** **** **** 11 **** 1 6121 1 0 **** 1 **** **** **** 1 +167 Sound_Burst 917 is_SndBurst V L vs 0x3c 0x2E NW_S0_SndBurst 2 2 **** **** **** **** 2 1500 hand **** vco_mehansonc01 **** sco_mehansonc01 vs_chant_evoc_lm vs_chant_evoc_lf out 1000 **** **** **** **** 1 vpr_los accelerating hand spr_los path Sonic 1 **** **** **** **** **** 11 **** 1 6260 1 0 **** 1 **** **** **** 1 +135 Prismatic_Spray 885 is_PrisSpray V S vs 0x38 0x2E NW_S0_PrisSpray **** **** **** **** **** 7 7 1500 hand **** vco_mehanmind03 **** sco_mehanmind03 vs_chant_evoc_hm vs_chant_evoc_hf out 1700 **** var_conepris **** sar_conepris 0 **** homing hand **** path **** 1 **** **** **** **** **** 11 **** 1 6229 1 0 **** 1 **** **** **** 1 +307 BARBARIAN_RAGE 1062 ife_rage V P s 0x00 0x09 NW_S1_BarbRage **** **** **** **** **** **** 1 500 head **** **** **** **** **** **** out 500 **** **** **** **** 0 **** **** **** **** **** **** 1 **** **** **** **** **** 16 **** 3 **** 0 0 53207 0 293 **** **** 0 + +1953 Shout 16828892 is_SndBurst V S v 0x1d 0x3E sp_shout 4 **** **** **** **** 4 4 1500 hand **** vco_smhansonc01 **** sco_mehansonc01 vs_chant_evoc_lm vs_chant_evoc_lf out 1700 **** vca_conesonc01 **** sff_howlmind 0 **** **** **** **** path Sonic 1 **** **** **** **** **** 11 **** 1 16828893 1 0 **** 1 **** **** **** 1 +1954 Greater_Shout 16828894 is_SndBurst V M vs 0x3d 0x3E sp_shout 6 **** **** **** **** 8 6 1500 hand **** vco_mehansonc01 **** sco_mehansonc01 vs_chant_evoc_hm vs_chant_evoc_hf out 1700 **** vca_conesonc01 **** sff_howlmind 0 **** **** **** **** path Sonic 1 **** **** **** **** **** 11 **** 1 16828895 1 0 **** 1 **** **** **** 1 + +*/ + +#include "prc_sp_func" +#include "prc_add_spell_dc" +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nSpellID = PRCGetSpellId(); + PRCSetSchool(GetSpellSchool(nSpellID)); + if (!X2PreSpellCastCode()) return; + location lTargetLocation = PRCGetSpellTargetLocation(); + object oTarget; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + float fDelay; + float fSize = FeetToMeters((nSpellID == SPELL_SHOUT_GREATER) ? 60.0 : 30.0); + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_SONIC); + + int nDC; + + int nDamageDice = (nSpellID == SPELL_SHOUT_GREATER) ? 10+(nPenetr/2) : 5+(nPenetr/4); + int nDeafenedDice = (nSpellID == SPELL_SHOUT_GREATER) ? 4 : 2; + int nDamage; + int nDuration; + + oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, fSize, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + { + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID)); + fDelay = GetDistanceBetween(oCaster, oTarget)/20.0; + if(!PRCDoResistSpell(oCaster, oTarget, nCasterLevel, fDelay) && (oTarget != oCaster)) + { + nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + nDamage = d6(nDamageDice); + nDuration = d6(nDeafenedDice); + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6 * nDamageDice; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage += (nDamage/2); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, + PRCGetSaveDC(oTarget, oCaster, nSpellID), + SAVING_THROW_TYPE_SONIC)) + { + nDamage /= 2; + if(GetHasMettle(oTarget, SAVING_THROW_FORT)) + nDamage = 0; + else if(nSpellID == SPELL_SHOUT_GREATER) + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDeaf(), oTarget, RoundsToSeconds(nDuration/2))); + } + else + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDeaf(), oTarget, RoundsToSeconds(nDuration))); + if(nSpellID == SPELL_SHOUT_GREATER) + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 6.0)); + } + if(nDamage > 0) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SONIC), oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDamage, EleDmg), oTarget)); + PRCBonusDamage(oTarget); + } + } + } + } + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, fSize, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_shriveling.ncs b/35expandedspells/sp_shriveling.ncs new file mode 100644 index 00000000..4de9988b Binary files /dev/null and b/35expandedspells/sp_shriveling.ncs differ diff --git a/35expandedspells/sp_shriveling.nss b/35expandedspells/sp_shriveling.nss new file mode 100644 index 00000000..37334ed5 --- /dev/null +++ b/35expandedspells/sp_shriveling.nss @@ -0,0 +1,107 @@ +//:://///////////////////////////////////////////// +//:: Name Shriveling +//:: FileName sp_shriveling.nss +//::////////////////////////////////////////////// +/**@file Shriveling +Necromancy [Evil] +Level: Clr 3, Sor/Wiz 2 +Components: V, S, Disease +Casting Time: 1 action +Range: Close (25 ft. + 5 ft./2 levels) +Target: One living creature +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: Yes + +The caster channels dark energy that blasts and +blackens the subject's flesh. The subject takes +1d4 points of damage per caster level (maximum 10d4). + +Disease Component: Soul rot. + +Author: Tenjac +Created: 05/04/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +int GetHasSoulRot(object oPC); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDC = PRCGetSaveDC(oTarget, oPC); + + //spellhook + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_SHRIVELING, oPC); + + //Check for Soul rot + if(!GetHasSoulRot(oPC)) + { + SendMessageToPC(oPC, "This spell requires the caster to have the Soul Rot disease."); + PRCSetSchool(); + return; + } + + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl + SPGetPenetr()) && PRCGetIsAliveCreature(oTarget)) + { + int nDam = d4(min(nCasterLvl, 20)); + + //eval metamagic + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 4 * (min(nCasterLvl, 20)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + //Check for save + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS)) + { + nDam = nDam/2; + } + + effect eVis = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_GREASE); + + //Apply damage & visual + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + //SPEvilShift(oPC); + PRCSetSchool(); +} + + +int GetHasSoulRot(object oPC) +{ + int bHasDisease = FALSE; + effect eTest = GetFirstEffect(oPC); + effect eDisease = EffectDisease(DISEASE_SOUL_ROT); + + if (PRCGetHasEffect(EFFECT_TYPE_DISEASE, oPC)) + { + while (GetIsEffectValid(eTest)) + { + if(eTest == eDisease) + { + bHasDisease = TRUE; + + } + eTest = GetNextEffect(oPC); + } + } + return bHasDisease; +} \ No newline at end of file diff --git a/35expandedspells/sp_slash_displ.ncs b/35expandedspells/sp_slash_displ.ncs new file mode 100644 index 00000000..6118d1d0 Binary files /dev/null and b/35expandedspells/sp_slash_displ.ncs differ diff --git a/35expandedspells/sp_slash_displ.nss b/35expandedspells/sp_slash_displ.nss new file mode 100644 index 00000000..fa0de196 --- /dev/null +++ b/35expandedspells/sp_slash_displ.nss @@ -0,0 +1,89 @@ +//:://///////////////////////////////////////////// +//:: Name Slashing Dispell +//:: FileName sp_slash_displ.nss +//::////////////////////////////////////////////// +/**@file Slashing Dispell +Abjuration/Evocation +Level: Duskblade 5, sorcerer/wizard 4 +Components: V,S +Casting Time: 1 standard action +Range: Medium +Target or Area: One creature or 20ft radius burst +Duration: Instantaneous +Saving Throw: None +Spell Resistance: No + +This spell functions like dispel magic, except as +noted here. Any creature that has a spell effect +removed from it takes 2 points of damage per level +of the dispelled effect. If a creature loses the +effects of multiple spells, it takes damage for +each one. +**/ + +#include "inc_dispel" +#include "prc_add_spell_dc" + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + if (!X2PreSpellCastCode()) return; + + object oPC = OBJECT_SELF; + effect eVis = EffectVisualEffect(VFX_IMP_BREACH); + effect eImpact = EffectVisualEffect(VFX_FNF_DISPEL); + object oTarget = PRCGetSpellTargetObject(); + location lLocal = PRCGetSpellTargetLocation(); + int nCasterLevel = PRCGetCasterLevel(oPC); + + //-------------------------------------------------------------------------- + // Dispel Magic is capped at caster level 10 + //-------------------------------------------------------------------------- + if(nCasterLevel > 40) + { + nCasterLevel = 40; + } + + if (GetIsObjectValid(oTarget)) + { + //---------------------------------------------------------------------- + // Targeted Dispel - Dispel all + //---------------------------------------------------------------------- + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact); + + } + else + { + //---------------------------------------------------------------------- + // Area of Effect - Only dispel best effect + //---------------------------------------------------------------------- + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE ); + while (GetIsObjectValid(oTarget)) + { + if(GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT) + { + //-------------------------------------------------------------- + // Handle Area of Effects + spellsDispelAoEMod(oTarget, oPC,nCasterLevel); + } + else if (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, GetSpellId())); + } + else + { + spellsDispelMagicMod(oTarget, nCasterLevel, eVis, eImpact, FALSE); + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE,lLocal, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_AREA_OF_EFFECT | OBJECT_TYPE_PLACEABLE); + } + } + + PRCSetSchool(); +} + + + + diff --git a/35expandedspells/sp_slashdark.ncs b/35expandedspells/sp_slashdark.ncs new file mode 100644 index 00000000..c7e095ec Binary files /dev/null and b/35expandedspells/sp_slashdark.ncs differ diff --git a/35expandedspells/sp_slashdark.nss b/35expandedspells/sp_slashdark.nss new file mode 100644 index 00000000..f4d061d9 --- /dev/null +++ b/35expandedspells/sp_slashdark.nss @@ -0,0 +1,90 @@ +///////////////////////////////////////////////////////////////////// +// +// Slashing Darkness - Project a damaging ray of negative energy. +// +///////////////////////////////////////////////////////////////////// +//::Added hold ray functionality - HackyKid + + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + + int nDice = (nCasterLevel + 1) / 2; + if (nDice > 20) nDice = 20; + + // Adjust the damage type if necessary. + int nDamageType = PRCGetElementalDamageType(DAMAGE_TYPE_NEGATIVE, OBJECT_SELF); + + int iAttackRoll = 0; + + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + iAttackRoll = PRCDoRangedTouchAttack(oTarget);; + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, + EffectBeam(VFX_BEAM_BLACK, OBJECT_SELF, BODY_NODE_HAND, 0 == iAttackRoll), oTarget, 1.0,FALSE); + + if (iAttackRoll > 0) + { + if (!PRCDoResistSpell(OBJECT_SELF, oTarget, nPenetr)) + { + int nDamage = PRCGetMetaMagicDamage(nDamageType, 1 == iAttackRoll ? nDice : (nDice * 2), 8); + + // Apply the damage and the vfx to the target. + + effect eEffect = PRCEffectDamage(oTarget, nDamage, nDamageType); + if (RACIAL_TYPE_UNDEAD == MyPRCGetRacialType(oTarget) || (GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD) || GetLocalInt(oTarget, "AcererakHealing")) + eEffect = PRCEffectHeal(nDamage, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY), oTarget); + } + } + } + + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if (oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_snsnow.ncs b/35expandedspells/sp_snsnow.ncs new file mode 100644 index 00000000..2e5024cc Binary files /dev/null and b/35expandedspells/sp_snsnow.ncs differ diff --git a/35expandedspells/sp_snsnow.nss b/35expandedspells/sp_snsnow.nss new file mode 100644 index 00000000..90326540 --- /dev/null +++ b/35expandedspells/sp_snsnow.nss @@ -0,0 +1,47 @@ +#include "prc_inc_sp_tch" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oTarget = PRCGetSpellTargetObject(); + + // Determine damage dice. + int nCasterLvl = PRCGetCasterLevel(); + int nDice = nCasterLvl; + if (nDice > 20) nDice = 20; + int nPenetr = nCasterLvl + SPGetPenetr(); + + // Adjust the damage type of necessary. + int nDamageType = PRCGetElementalDamageType(DAMAGE_TYPE_COLD, OBJECT_SELF); + + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + // Fire cast spell at event for the specified target + PRCSignalSpellEvent(oTarget); + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + // Make touch attack, saving result for possible critical + int nTouchAttack = PRCDoRangedTouchAttack(oTarget);; + if (nTouchAttack > 0) + { + // Roll the damage of (1d6+1) / level, doing double damage on a crit. + int nDamage = PRCGetMetaMagicDamage(nDamageType, + 1 == nTouchAttack ? nDice : (nDice * 2), 6, 1); + + // Apply the damage and the damage visible effect to the target. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, + PRCEffectDamage(oTarget, nDamage, nDamageType), oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, + EffectVisualEffect(VFX_IMP_FROST_S), oTarget); + } + } + } + + PRCSetSchool(); +} diff --git a/35expandedspells/sp_snsnowsw.ncs b/35expandedspells/sp_snsnowsw.ncs new file mode 100644 index 00000000..bb10e0d9 Binary files /dev/null and b/35expandedspells/sp_snsnowsw.ncs differ diff --git a/35expandedspells/sp_snsnowsw.nss b/35expandedspells/sp_snsnowsw.nss new file mode 100644 index 00000000..239b58ab --- /dev/null +++ b/35expandedspells/sp_snsnowsw.nss @@ -0,0 +1,19 @@ +#include "prc_inc_spells" +#include "spinc_burst" + +void main() +{ + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + if (!X2PreSpellCastCode()) return; + + // Get the damage dice. + int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDice = (nCasterLvl + 1) / 2; + if (nDice > 20) nDice = 20; + + // Ice burst is a colossal radius burst doing 1d4+10/level (cap at 10) cold damage. + DoBurst (nCasterLvl,6, 0, nDice, + VFX_IMP_FROST_L, VFX_IMP_FROST_S, + RADIUS_SIZE_MEDIUM, DAMAGE_TYPE_COLD, DAMAGE_TYPE_COLD, SAVING_THROW_TYPE_COLD); +} diff --git a/35expandedspells/sp_spiderskin.ncs b/35expandedspells/sp_spiderskin.ncs new file mode 100644 index 00000000..8949437c Binary files /dev/null and b/35expandedspells/sp_spiderskin.ncs differ diff --git a/35expandedspells/sp_spiderskin.nss b/35expandedspells/sp_spiderskin.nss new file mode 100644 index 00000000..e436739a --- /dev/null +++ b/35expandedspells/sp_spiderskin.nss @@ -0,0 +1,71 @@ +/* + sp_spiderskin + + Spiderskin toughens the target's skin, making + it more like a spider's carapace. The target + gains a bonus to natural armor, saves vs. poison, + and hide checks. The bonus is equal to 1 +1 per 3 + caster levels, to a maximum of +5 at 12th level. + + By: ??? + Created: ??? + Modified: Jul 2, 2006 +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + PRCSignalSpellEvent(oTarget, FALSE); + // Determine the spell's duration, taking metamagic feats into account. + float fDuration = PRCGetMetaMagicDuration(TenMinutesToSeconds(nCasterLevel)); + // Calculate buff amount. + int nBuff = 1 + nCasterLevel / 3; + if (nBuff > 8) nBuff = 8; + // Apply the buff and vfx. + effect eBuff = EffectACIncrease(nBuff, AC_NATURAL_BONUS); + eBuff = EffectLinkEffects(eBuff, EffectSkillIncrease(SKILL_HIDE, nBuff)); + eBuff = EffectLinkEffects(eBuff, + EffectSavingThrowIncrease(SAVING_THROW_ALL, nBuff, SAVING_THROW_TYPE_POISON)); + eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLevel); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, + EffectVisualEffect(VFX_IMP_POLYMORPH), oTarget); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_stalagmite.ncs b/35expandedspells/sp_stalagmite.ncs new file mode 100644 index 00000000..6b0b0011 Binary files /dev/null and b/35expandedspells/sp_stalagmite.ncs differ diff --git a/35expandedspells/sp_stalagmite.nss b/35expandedspells/sp_stalagmite.nss new file mode 100644 index 00000000..c846bd4f --- /dev/null +++ b/35expandedspells/sp_stalagmite.nss @@ -0,0 +1,84 @@ +/* +Sudden Stalagmite + +Conjuration (Creation) [Earth] +Level: Druid 4, +Components: V, S, +Casting Time: 1 standard action +Range: Medium (100 ft. + 10 ft./level) +Target: One creature +Duration: Instantaneous +Saving Throw: Reflex half +Spell Resistance: No + +You point your finger upward and utter a curt shout. Immediately, a razor-sharp stalagmite bursts from the ground to impale your foe. + +This spell creates a stalagmite about 1 foot wide at its base and up to 10 feet tall. The stalagmite grows from the ground under the target creature and shoots upward. + +The stalagmite deals 1d6 points of piercing damage per caster level (maximum 10d6). In addition, a target that fails to make a saving throw against this spell and takes damage from it is impaled on the stalagmite and +cannot move from its current location. The victim can break free with a DC 25 Strength check, although doing this deals it 3d6 points of slashing damage. + +A creature's damage reduction, if any, applies to the damage from this spell. The damage from sudden stalagmite is treated as piercing for the purpose of overcoming damage reduction. +*/ + +#include "prc_sp_func" +#include "prc_add_spell_dc" + +void StalagmiteBreak(object oTarget, object oCaster, effect eHold) +{ + int nStrChk = d20() + GetAbilityModifier(ABILITY_STRENGTH, oTarget); + if(nStrChk >= 25) + { + PRCRemoveSpellEffects(SPELL_SUDDEN_STALAGMITE, oCaster, oTarget); + FloatingTextStringOnCreature("*Strength check successful!*", oTarget, FALSE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, d6(3), DAMAGE_TYPE_PIERCING), oTarget); + } + else + { + DelayCommand(6.0, StalagmiteBreak(oTarget, oCaster, eHold)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eHold), oTarget, 6.0); + } +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nSaveDC = PRCGetSaveDC(oTarget, oCaster); + int nDice = nCasterLevel; + // 10d6 Max + if (nDice > 40) nDice = 40; + int nDam = d6(nDice); + effect eDam; + effect eVis = EffectVisualEffect(VFX_COM_CHUNK_STONE_SMALL); + effect eHold = EffectLinkEffects(EffectParalyze(), EffectVisualEffect(VFX_DUR_STONEHOLD)); + + int iAttackRoll = 0; + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Resolve metamagic + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + nDam = 6 * nDice; + else + //Roll damage for each target + nDam = d6(nDice); + if ((nMetaMagic & METAMAGIC_EMPOWER)) + nDam += nDam / 2; + int nCheck = nDam; + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, nSaveDC, SAVING_THROW_TYPE_SPELL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_PIERCING), oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + CreateObject(OBJECT_TYPE_PLACEABLE, "x3_plc_boulder1", PRCGetSpellTargetLocation()); + if (nDam == nCheck) // If the damage is the same after the reflex save, they failed it. + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eHold), oTarget, 6.0); //Extraordinary because it's just a piece of stone, not magical, at this point + DelayCommand(6.0, StalagmiteBreak(oTarget, oCaster, eHold)); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/sp_strm_shard.ncs b/35expandedspells/sp_strm_shard.ncs new file mode 100644 index 00000000..4ad8f898 Binary files /dev/null and b/35expandedspells/sp_strm_shard.ncs differ diff --git a/35expandedspells/sp_strm_shard.nss b/35expandedspells/sp_strm_shard.nss new file mode 100644 index 00000000..36804e64 --- /dev/null +++ b/35expandedspells/sp_strm_shard.nss @@ -0,0 +1,97 @@ +//:://///////////////////////////////////////////// +//:: Name Storm of Shards +//:: FileName sp_strm_shard.nss +//::////////////////////////////////////////////// +/**@file Storm of Shards +Evocation [Good] +Level: Sanctified 6 +Components: V, S, Sacrifice +Casting Time: 1 standard action +Range: 0 ft. +Area: 80-ft.-radius spread +Duration: Instantaneous +Saving Throw: Fortitude negates (blinding), +Reflex half (shards) +Spell Resistance: Yes + +Shards of heavenly light rain down from above. +Evil creatures within the spell's area that fail +a Fortitude save are blinded permanently. The +light shards also slice the flesh of evil +creatures, dealing 1d6 points of damage per caster +level (maximum 20d6). A successful Reflex save +halves the damage, which is of divine origin. + +Sacrifice: 1d3 points of Strength drain. + +Author: Tenjac +Created: 6/28/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = GetLocation(oPC); + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 24.38f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nDC = PRCGetSaveDC(oTarget, oPC); + int nAlign; + int nMetaMagic = PRCGetMetaMagicFeat(); + + //VFX + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIRESTORM), lLoc); + + while(GetIsObjectValid(oTarget)) + { + if(!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr())) + { + nAlign = GetAlignmentGoodEvil(oTarget); + + if(nAlign == ALIGNMENT_EVIL) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DIVINE)) + { + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectBlindness(), oTarget); + } + + int nDam = d6(min(nCasterLvl, 40)); + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 *(min(nCasterLvl, 40)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + if(PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_DIVINE)) + { + nDam = nDam/2; + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_DIVINE), oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 24.38f, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + DoCorruptionCost(oPC, ABILITY_STRENGTH, d3(1), 1); + PRCSetSchool(); +} + + + \ No newline at end of file diff --git a/35expandedspells/sp_sunmantle.ncs b/35expandedspells/sp_sunmantle.ncs new file mode 100644 index 00000000..71817f64 Binary files /dev/null and b/35expandedspells/sp_sunmantle.ncs differ diff --git a/35expandedspells/sp_sunmantle.nss b/35expandedspells/sp_sunmantle.nss new file mode 100644 index 00000000..8d0d5761 --- /dev/null +++ b/35expandedspells/sp_sunmantle.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Name Sunmantle +//:: FileName sp_sunmantle.nss +//::////////////////////////////////////////////// +/**@file Sunmantle +Abjuration +Level: Sanctified 4 +Components: S, Sacrifice +Casting Time: 1 standard action +Range: Touch +Target: One creature touched +Duration: 1 round/level +Saving Throw: None +Spell Resistance: Yes + +This spell cloaks the target in a wavering cloak of +light that illuminates an area around the target +(and dispels darkness) as a daylight spell. However, +its ability to generate bright light is not the +spell's primary function. + +The sunmantle grants the target damage reduction +5/-. Furthermore, if the target is struck by a melee +attack that deals hit point damage, a tendril of +light lashes out at the attacker, striking +unerringly and dealing 5 points of damage. + +Because of the brilliance of the sunmantle, +creatures sensitive to bright light (such as dark +elves) take the usual attack penalties when in the +light radius of the sunmantle. + +Sacrifice: 1d4 points of Strength damage. + +Author: Tenjac +Created: 6/20/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_ABJURATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + float fDur = RoundsToSeconds(nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur += fDur; + } + + //Darkness dispelling + + //DR + effect eLink = EffectLinkEffects(EffectDamageShield(4+(nCasterLvl/4), DAMAGE_BONUS_1, DAMAGE_TYPE_MAGICAL), EffectDamageResistance(DAMAGE_TYPE_BLUDGEONING, 5+(nCasterLvl/4), 0)); + eLink = EffectLinkEffects(EffectDamageResistance(DAMAGE_TYPE_PIERCING, 5+(nCasterLvl/4), 0), eLink); + eLink = EffectLinkEffects(eLink, EffectDamageResistance(DAMAGE_TYPE_SLASHING, 5+(nCasterLvl/4), 0)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur); + + DoCorruptionCost(oPC, ABILITY_STRENGTH, d4(1), 0); + + //Sanctified spells get mandatory 10 pt good adjustment, regardless of switch + AdjustAlignment(oPC, ALIGNMENT_GOOD, 10, FALSE); + + //SPGoodShift(oPC); + PRCSetSchool(); +} + + diff --git a/35expandedspells/sp_thous_ndls.ncs b/35expandedspells/sp_thous_ndls.ncs new file mode 100644 index 00000000..0a62f53d Binary files /dev/null and b/35expandedspells/sp_thous_ndls.ncs differ diff --git a/35expandedspells/sp_thous_ndls.nss b/35expandedspells/sp_thous_ndls.nss new file mode 100644 index 00000000..52dab0e4 --- /dev/null +++ b/35expandedspells/sp_thous_ndls.nss @@ -0,0 +1,108 @@ +//:://///////////////////////////////////////////// +//:: Name Thousand Needles +//:: FileName sp_thous_ndls.nss +//::////////////////////////////////////////////// +/**@file Thousand Needles +Conjuration (Creation) [Evil] +Level: Pain 5, Clr 6 +Components: V, S, M +Casting Time: 1 action +Range: Medium (100 ft. + 10 ft./levels) +Target: One living creature +Duration: 1 minute/level +Saving Throw: Fortitude partial +Spell Resistance: Yes + +A thousand needles surround the subject and pierce +his flesh, worming through armor or any type of +protection, although creatures with damage reduction +are immune to this spell. The subject takes 2d6 +points of damage immediately and takes a -4 +circumstance penalty on attack rolls, saving throws, +skill checks, and ability checks for the rest of the +spell's duration. A successful Fortitude save reduces +damage to half and negates the circumstance penalty. + +Material Component: A handful of needles all of +which have drawn blood. + +Author: Tenjac +Created: 5/18/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + //spellhook + if(!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + effect eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nPenalty = 4; + int nDC = PRCGetSaveDC(oTarget, oPC); + int nDam = d6(2+(nCasterLvl/2)); + float fDur = (60.0f * nCasterLvl); + + PRCSignalSpellEvent(oTarget,TRUE, SPELL_THOUSAND_NEEDLES, oPC); + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget, nCasterLvl + SPGetPenetr()) && PRCGetIsAliveCreature(oTarget)) + { + //metamagic + if(nMetaMagic & METAMAGIC_EXTEND) + { + fDur = (fDur * 2); + } + + if(nMetaMagic & METAMAGIC_MAXIMIZE) + { + nDam = 6 * (2+(nCasterLvl/2)); + } + + if(nMetaMagic & METAMAGIC_EMPOWER) + { + nDam += (nDam/2); + } + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Save + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)) + { + nDam = nDam/2; + + if (GetHasMettle(oTarget, SAVING_THROW_FORT)) + // This script does nothing if it has Mettle, bail + return; + } + + else + { + if(!PRCGetHasEffect(EFFECT_TYPE_DAMAGE_REDUCTION, oTarget)) + { + effect eLink = EffectAttackDecrease(nPenalty, ATTACK_BONUS_MISC); + eLink = EffectLinkEffects(eLink, EffectSavingThrowDecrease(SAVING_THROW_ALL, nPenalty, SAVING_THROW_TYPE_ALL)); + eLink = EffectLinkEffects(eLink, EffectSkillDecrease(SKILL_ALL_SKILLS, nPenalty)); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDur); + } + } + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oTarget); + } + + //SPEvilShift(oPC); + PRCSetSchool(); +} + + + + + diff --git a/35expandedspells/sp_touch_fatigue.ncs b/35expandedspells/sp_touch_fatigue.ncs new file mode 100644 index 00000000..4aaf1417 Binary files /dev/null and b/35expandedspells/sp_touch_fatigue.ncs differ diff --git a/35expandedspells/sp_touch_fatigue.nss b/35expandedspells/sp_touch_fatigue.nss new file mode 100644 index 00000000..13307056 --- /dev/null +++ b/35expandedspells/sp_touch_fatigue.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Name Touch of Fatigue +//:: FileName sp_touch_fatigue.nss +//::////////////////////////////////////////////// +/* +Level: Sor/Wiz 0, Duskblade 0, Blighter 0 +Components: V, S +Casting Time: 1 standard action +Range: Touch +Target: Creature touched +Duration: 1 round/level +Saving Throw: Fort negates +Spell Resistance: Yes + +You channel negative energy through your touch, fatiguing the target. +You must succeed on a touch attack to strike a target. +The subject is immediately fatigued for the spell's duration. +This spell has no effect on a creature that is already fatigued. +Unlike with normal fatigue, the effect ends as soon as the spell's duration expires. + +**/ +//:://////////////////////////////////////////////// +//:: Author: Strat +//:: Date : 11.4.2020 +//:://////////////////////////////////////////////// + +#include "prc_inc_sp_tch" +#include "prc_sp_func" +#include "prc_add_spell_dc" +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nDie = min(nCasterLevel, 20); + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + effect eVis = EffectVisualEffect(VFX_DUR_BIGBYS_BIGBLUE_HAND2); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); + int iAttackRoll = PRCDoMeleeTouchAttack(oTarget, TRUE, oCaster); + + if(iAttackRoll > 0) + { + // Only creatures, and PvP check. + if(!GetIsReactionTypeFriendly(oTarget)) + { + // Check Spell Resistance + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, PRCGetSaveDC(oTarget, oCaster), SAVING_THROW_TYPE_SPELL)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectFatigue(), oTarget, nCasterLevel*6.0); + } + } + } + } + + return iAttackRoll;// return TRUE if spell charges should be decremented +} + +void main() +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + if (!X2PreSpellCastCode()) return; + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { + //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/sp_unliv_weap.ncs b/35expandedspells/sp_unliv_weap.ncs new file mode 100644 index 00000000..5024987c Binary files /dev/null and b/35expandedspells/sp_unliv_weap.ncs differ diff --git a/35expandedspells/sp_unliv_weap.nss b/35expandedspells/sp_unliv_weap.nss new file mode 100644 index 00000000..27bfd5c8 --- /dev/null +++ b/35expandedspells/sp_unliv_weap.nss @@ -0,0 +1,108 @@ +//:://///////////////////////////////////////////// +//:: Name Unliving Weapon +//:: FileName sp_unliv_weap.nss +//::////////////////////////////////////////////// +/**@file Unliving Weapon +Necromancy [Evil] +Level: Clr 3 +Components: V, S, M +Casting Time: 1 full round +Range: Touch +Targets: One undead creature +Duration: 1 hour/level +Saving Throw: Will negates +Spell Resistance: Yes + +This spell causes an undead creature to explode in a +burst of powerful energy when struck for at least 1 +point of damage, or at a set time no longer than the +duration of the spell, whichever comes first. The +explosion is a 10-foot radius burst that deals 1d6 +points of damage for every two caster levels +(maximum 10d6). + +While this spell can be an effective form of attack +against an undead creature, necromancers often use +unliving weapon to create undead capable of suicide +attacks (if such a term can be applied to something +that is already dead). Skeletons or zombies with this +spell cast upon them can be very dangerous to foes +that would normally disregard them. + +Material Component: A drop of bile and a bit of sulfur. + +Author: Tenjac +Created: 5/11/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +void HiImABomb(object oTarget, int nCounter, int nHP, int nCasterLvl, int nMetaMagic); + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oPC = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nPenetr = nCasterLvl + SPGetPenetr(); + float fDur = HoursToSeconds(nCasterLvl); + int nMetaMagic = PRCGetMetaMagicFeat(); + if(nMetaMagic & METAMAGIC_EXTEND) + fDur *= 2; + int nDC = PRCGetSaveDC(oTarget, oPC); + + //only works on undead + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + if(GetMaster(oTarget) == oPC//casting on own undead + || (!PRCDoResistSpell(oPC, oTarget, nPenetr)//Spell Resistance + && !PRCMySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_SPELL)))//Saving Throw + { + int nCounter = (FloatToInt(fDur))/3; + int nHP = GetCurrentHitPoints(oTarget); + + HiImABomb(oTarget, nCounter, nHP, nCasterLvl, nMetaMagic); + } + } + PRCSetSchool(); +} + +void HiImABomb(object oTarget, int nCounter, int nHP, int nCasterLvl, int nMetaMagic) +{ + if((nCounter < 1) || GetCurrentHitPoints(oTarget) < nHP) + { + //unused? + //effect eSplode = EffectDeath(TRUE, TRUE); + // eSplode = SupernaturalEffect(eSplode); + + location lLoc = GetLocation(oTarget); + int nDice = min((nCasterLvl/2), 20); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_BLINDDEAF), oTarget); + + object oOuch = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oOuch)) + { + int nDam = d6(nDice); + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 6 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + //Apply damage + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL), oOuch); + + //Get next victim + oOuch = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + } + nCounter--; + + DelayCommand(3.0f, HiImABomb(oTarget, nCounter, nHP, nCasterLvl, nMetaMagic)); +} \ No newline at end of file diff --git a/35expandedspells/sp_wallfrosta.ncs b/35expandedspells/sp_wallfrosta.ncs new file mode 100644 index 00000000..63026985 Binary files /dev/null and b/35expandedspells/sp_wallfrosta.ncs differ diff --git a/35expandedspells/sp_wallfrosta.nss b/35expandedspells/sp_wallfrosta.nss new file mode 100644 index 00000000..0c9f8d68 --- /dev/null +++ b/35expandedspells/sp_wallfrosta.nss @@ -0,0 +1,67 @@ +//:://///////////////////////////////////////////// +//:: Wall of Frost: On Enter +//:: SP_WallFrostA.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Person within the AoE take 4d6 cold damage + per round. +*/ +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); + int CasterLvl = PRCGetCasterLevel(GetAreaOfEffectCreator()); + + //Capture the first target object in the shape. + oTarget = GetEnteringObject(); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr)) + { + //Roll damage. + nDamage = d6(4+(CasterLvl/2)); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6*(4+(CasterLvl/2));//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget,GetAreaOfEffectCreator())), SAVING_THROW_TYPE_COLD); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, ChangedElementalDamage(GetAreaOfEffectCreator(), DAMAGE_TYPE_COLD)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/sp_wallfrostc.ncs b/35expandedspells/sp_wallfrostc.ncs new file mode 100644 index 00000000..83324737 Binary files /dev/null and b/35expandedspells/sp_wallfrostc.ncs differ diff --git a/35expandedspells/sp_wallfrostc.nss b/35expandedspells/sp_wallfrostc.nss new file mode 100644 index 00000000..42d2a546 --- /dev/null +++ b/35expandedspells/sp_wallfrostc.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Wall of Frost: Heartbeat +//:: SP_WallFrostC.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Person within the AoE take 4d6 cold damage + per round. +*/ +//::////////////////////////////////////////////// +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + + +void main() +{ + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + effect eDam; + object oTarget; + //Declare and assign personal impact visual effect. + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + //Capture the first target object in the shape. + + //-------------------------------------------------------------------------- + // GZ 2003-Oct-15 + // When the caster is no longer there, all functions calling + // GetAreaOfEffectCreator will fail. Its better to remove the barrier then + //-------------------------------------------------------------------------- + if (!GetIsObjectValid(GetAreaOfEffectCreator())) + { + DestroyObject(OBJECT_SELF); + return; + } + + int CasterLvl = PRCGetCasterLevel(GetAreaOfEffectCreator()); + + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator(),CasterLvl); + int EleDmg = ChangedElementalDamage(GetAreaOfEffectCreator(), DAMAGE_TYPE_COLD); + + oTarget = GetFirstInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Declare the spell shape, size and the location. + while(GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr)) + { + //Roll damage. + nDamage = d6(4+(CasterLvl/2)); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 6*(4+(CasterLvl/2));//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + } + + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + + int nDC = PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()); + + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (nDC), SAVING_THROW_TYPE_COLD); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 1.0,FALSE); + } + } + } + //Select the next target within the spell shape. + oTarget = GetNextInPersistentObject(OBJECT_SELF,OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Getting rid of the integer used to hold the spells spell school +} diff --git a/35expandedspells/sp_wrtch_blght.ncs b/35expandedspells/sp_wrtch_blght.ncs new file mode 100644 index 00000000..8c1fd53b Binary files /dev/null and b/35expandedspells/sp_wrtch_blght.ncs differ diff --git a/35expandedspells/sp_wrtch_blght.nss b/35expandedspells/sp_wrtch_blght.nss new file mode 100644 index 00000000..7eb88887 --- /dev/null +++ b/35expandedspells/sp_wrtch_blght.nss @@ -0,0 +1,105 @@ +//:://///////////////////////////////////////////// +//:: Name Wretched Blight +//:: FileName sp_wrtch_blght.nss +//::////////////////////////////////////////////// +/**@file Wretched Blight +Evocation [Evil] +Level: Clr 7 +Components: V, S +Casting Time: 1 action +Range: Medium (100 ft. + 10 ft./level) +Area: 20-ft.-radius spread +Duration: Instantaneous +Saving Throw: Fortitude partial (see text) +Spell Resistance: Yes + +The caster calls up unholy power to smite his enemies. +The power takes the form of a soul chilling mass of +clawing darkness. Only good and neutral (not evil) +creatures are harmed by the spell. + +The spell deals 1d8 pts of damage per caster level +(maximum 15d8) to good creatures and renders them +stunned for 1d4 rounds. A successful Fortitude save +reduces damage to half and negates the stunning effect. + +The spell deals only half damage to creatures that +are neither evil nor good, and they are not stunned. +Such creatures can reduce the damage in half again +(down to one­quarter of the roll) with a successful +Reflex save. + +Author: Tenjac +Created: 5/9/06 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_add_spell_dc" +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + object oPC = OBJECT_SELF; + location lLoc = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oPC); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDice = min(nCasterLvl, 60); + int nAlign; + int nDam; + int nDC; + nCasterLvl += SPGetPenetr(); + effect eVis = EffectVisualEffect(VFX_DUR_DARKNESS); + effect eDam; + + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, FALSE, OBJECT_TYPE_CREATURE); + + //apply VFX + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, lLoc, 3.0f); + + while(GetIsObjectValid(oTarget)){ + nAlign = GetAlignmentGoodEvil(oTarget); + if(nAlign != ALIGNMENT_EVIL){ + //SR + if(!PRCDoResistSpell(oPC, oTarget, nCasterLvl)){ + nDam = d8(nDice); + + //Metmagic: Maximize + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDam = 8 * nDice; + + //Metmagic: Empower + if(nMetaMagic & METAMAGIC_EMPOWER) + nDam += (nDam/2); + + // 1/2 damage for neutral targets + if(nAlign == ALIGNMENT_NEUTRAL) + nDam = nDam/2; + + nDC = PRCGetSaveDC(oTarget, oPC); + + //Save for 1/2 dam + if(PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_EVIL)){ + //This script does nothing if it has Mettle, bail + if(GetHasMettle(oTarget, SAVING_THROW_FORT)) + continue; + nDam = nDam/2; + } + else if(nAlign == ALIGNMENT_GOOD){ + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, RoundsToSeconds(d4(1))); + } + + //Apply Damage + eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, FALSE, OBJECT_TYPE_CREATURE); + } + //SPEvilShift(oPC); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x0_s0_acidsplash.ncs b/35expandedspells/x0_s0_acidsplash.ncs new file mode 100644 index 00000000..9e045587 Binary files /dev/null and b/35expandedspells/x0_s0_acidsplash.ncs differ diff --git a/35expandedspells/x0_s0_acidsplash.nss b/35expandedspells/x0_s0_acidsplash.nss new file mode 100644 index 00000000..a1fab4b1 --- /dev/null +++ b/35expandedspells/x0_s0_acidsplash.nss @@ -0,0 +1,66 @@ + //:://///////////////////////////////////////////// +//:: Acid Splash +//:: [X0_S0_AcidSplash.nss] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +Acid Splash +Conjuration (Creation) [Acid] +Level: Sor/Wiz 0 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: One missile of acid +Duration: Instantaneous +Saving Throw: None +Spell Resistance: No + +You fire a small orb of acid at the target. You +must succeed on a ranged touch attack to hit your +target. The orb deals 1d3 points of acid damage. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 17 2002 +//::////////////////////////////////////////////// +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_sp_tch" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ACID); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); +int nCasterLevel = PRCGetCasterLevel(oCaster); + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ACID_SPLASH)); + + int iAttackRoll = PRCDoRangedTouchAttack(oTarget); + if(iAttackRoll > 0) + { + int nDamage = PRCMaximizeOrEmpower(3, nCasterLevel, nMetaMagic); //alterei o 1 por caster lvl do char + // Acid Sheath adds +1 damage per die to acid descriptor spells + if (GetHasDescriptor(SPELL_ACID_SPLASH, DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster)) + nDamage += 1; + + //Apply the VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + // perform attack roll for ray and deal proper damage + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, EleDmg); + PRCBonusDamage(oTarget); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/x0_s0_bigby2.ncs b/35expandedspells/x0_s0_bigby2.ncs new file mode 100644 index 00000000..bb438035 Binary files /dev/null and b/35expandedspells/x0_s0_bigby2.ncs differ diff --git a/35expandedspells/x0_s0_bigby2.nss b/35expandedspells/x0_s0_bigby2.nss new file mode 100644 index 00000000..470d1e96 --- /dev/null +++ b/35expandedspells/x0_s0_bigby2.nss @@ -0,0 +1,94 @@ +//:://///////////////////////////////////////////// +//:: Bigby's Forceful Hand +//:: [x0_s0_bigby2] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + dazed vs strength check (+14 on strength check); Target knocked down. + Target dazed down for 1 round per level of caster + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: September 7, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs May 01, 2003 + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_spells" +#include "prc_inc_combmove" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + //Check for metamagic extend + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) //Duration is +100% + { + nDuration = nDuration * 2; + } + if(!GetIsReactionTypeFriendly(oTarget)) + { + // Apply the impact effect + effect eImpact = EffectVisualEffect(VFX_IMP_BIGBYS_FORCEFUL_HAND); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 460, TRUE)); + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl+ SPGetPenetr())) + { + + int nCasterRoll = d20()+ (CasterLvl/2) + 14; + int nTargetRoll = d20(1) + GetAbilityModifier(ABILITY_STRENGTH, oTarget) + PRCGetSizeModifier(oTarget); + // * bullrush succesful, knockdown target for duration of spell + if (nCasterRoll >= nTargetRoll) + { + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eKnockdown = EffectDazed(); + effect eKnockdown2 = EffectKnockdown(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + //Link effects + effect eLink = EffectLinkEffects(eKnockdown, eDur); + eLink = EffectLinkEffects(eLink, eKnockdown2); + //Apply the penalty + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, RoundsToSeconds(nDuration),FALSE); + // * Bull Rush succesful + FloatingTextStrRefOnCreature(8966,OBJECT_SELF, FALSE); + } + else + { + FloatingTextStrRefOnCreature(8967,OBJECT_SELF, FALSE); + } + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + diff --git a/35expandedspells/x0_s0_bigby4.ncs b/35expandedspells/x0_s0_bigby4.ncs new file mode 100644 index 00000000..c99a73ee Binary files /dev/null and b/35expandedspells/x0_s0_bigby4.ncs differ diff --git a/35expandedspells/x0_s0_bigby4.nss b/35expandedspells/x0_s0_bigby4.nss new file mode 100644 index 00000000..134361e4 --- /dev/null +++ b/35expandedspells/x0_s0_bigby4.nss @@ -0,0 +1,143 @@ +//:://///////////////////////////////////////////// +//:: Bigby's Clenched Fist +//:: [x0_s0_bigby4] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Does an attack EACH ROUND for 1 round/level. + If the attack hits does + 1d8 +12 points of damage + + Any creature struck must make a FORT save or + be stunned for one round. + + GZ, Oct 15 2003: + Changed how this spell works by adding duration + tracking based on the VFX added to the character. + Makes the spell dispellable and solves some other + issues with wrong spell DCs, checks, etc. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: September 7, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Georg Zoeller October 15, 2003 + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + +#include "prc_add_spell_dc" + + + +int nSpellID = 462; + +void RunHandImpact(object oTarget, object oCaster,int CasterLvl, int nAbilityModifier ) +{ + //-------------------------------------------------------------------------- + // Check if the spell has expired (check also removes effects) + //-------------------------------------------------------------------------- + if (PRCGetDelayedSpellEffectsExpired(nSpellID,oTarget,oCaster)) + { + return; + } + + int nCasterModifiers = nAbilityModifier + + PRCGetCasterLevel(oCaster); + int nCasterRoll = d20(1) + nCasterModifiers + 11 + -1; + int nTargetRoll = GetAC(oTarget); + if (nCasterRoll >= nTargetRoll) + { + int nDC = GetLocalInt(oTarget,"XP2_L_SPELL_SAVE_DC_" + IntToString (nSpellID)); + + int nDam = PRCMaximizeOrEmpower(8, 1, PRCGetMetaMagicFeat(), 11+CasterLvl); + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_BLUDGEONING); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_L); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if (!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, RoundsToSeconds(1),TRUE,-1,CasterLvl); + } + + DelayCommand(6.0f,RunHandImpact(oTarget,oCaster,CasterLvl,nAbilityModifier)); + + } +} + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + /* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + object oTarget = PRCGetSpellTargetObject(); + int nClassType = PRCGetLastSpellCastClass(); + int nAbilityModifier = (GetAbilityScoreForClass(nClassType, OBJECT_SELF) -10)/2; + + //-------------------------------------------------------------------------- + // This spell no longer stacks. If there is one hand, that's enough + //-------------------------------------------------------------------------- + if (GetHasSpellEffect(nSpellID,oTarget) || GetHasSpellEffect(463,oTarget) ) + { + FloatingTextStrRefOnCreature(100775,OBJECT_SELF,FALSE); + return; + } + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + + int nMetaMagic = PRCGetMetaMagicFeat(); + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = nDuration * 2; + } + + if(!GetIsReactionTypeFriendly(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, TRUE)); + int nResult = PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl +SPGetPenetr()); + + if(nResult == 0) + { + effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_CLENCHED_FIST); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHand, oTarget, RoundsToSeconds(nDuration),FALSE); + + //---------------------------------------------------------- + // GZ: 2003-Oct-15 + // Save the current save DC on the character because + // PRCGetSaveDC won't work when delayed + //---------------------------------------------------------- + SetLocalInt(oTarget,"XP2_L_SPELL_SAVE_DC_" + IntToString (nSpellID), PRCGetSaveDC(oTarget, OBJECT_SELF)); + object oSelf = OBJECT_SELF; + RunHandImpact(oTarget,OBJECT_SELF,CasterLvl, nAbilityModifier); + + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + diff --git a/35expandedspells/x0_s0_bigby5.ncs b/35expandedspells/x0_s0_bigby5.ncs new file mode 100644 index 00000000..e62953e8 Binary files /dev/null and b/35expandedspells/x0_s0_bigby5.ncs differ diff --git a/35expandedspells/x0_s0_bigby5.nss b/35expandedspells/x0_s0_bigby5.nss new file mode 100644 index 00000000..c19c447d --- /dev/null +++ b/35expandedspells/x0_s0_bigby5.nss @@ -0,0 +1,170 @@ +//:://///////////////////////////////////////////// +//:: Bigby's Crushing Hand +//:: [x0_s0_bigby5] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Similar to Bigby's Grasping Hand. + If Grapple succesful then will hold the opponent and do 2d6 + 12 points + of damage EACH round for 1 round/level + + + // Mark B's famous advice: + // Note: if the target is dead during one of these second-long heartbeats, + // the DelayCommand doesn't get run again, and the whole package goes away. + // Do NOT attempt to put more than two parameters on the delay command. They + // may all end up on the stack, and that's all bad. 60 x 2 = 120. + +*/ + +// +// Altered to calculate grapple check correctly per pnp rules. +// + +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: September 7, 2002 +//::////////////////////////////////////////////// +//:: VFX Pass By: + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_combmove" + +int nSpellID = 463; +void RunHandImpact(object oTarget, object oCaster) +{ + + //-------------------------------------------------------------------------- + // Check if the spell has expired (check also removes effects) + //-------------------------------------------------------------------------- + if (PRCGetDelayedSpellEffectsExpired(nSpellID,oTarget,oCaster)) + { + return; + } +int CasterLvl = PRCGetCasterLevel(oCaster); + int nDam = PRCMaximizeOrEmpower(6,2,PRCGetMetaMagicFeat(), 12+CasterLvl); + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_BLUDGEONING); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_L); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + DelayCommand(6.0f,RunHandImpact(oTarget,oCaster)); +} + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + /* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + object oTarget = PRCGetSpellTargetObject(); + + //-------------------------------------------------------------------------- + // This spell no longer stacks. If there is one hand, that's enough + //-------------------------------------------------------------------------- + if (GetHasSpellEffect(nSpellID,oTarget) || GetHasSpellEffect(462,oTarget) ) + { + FloatingTextStrRefOnCreature(100775,OBJECT_SELF,FALSE); + return; + } + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl; + int nClassType = PRCGetLastSpellCastClass(); + int nAbilityModifier = (GetAbilityScoreForClass(nClassType, OBJECT_SELF) -10)/2; + + int nMetaMagic = PRCGetMetaMagicFeat(); + + //Check for metamagic extend + if ((nMetaMagic & METAMAGIC_EXTEND)) //Duration is +100% + { + nDuration = nDuration * 2; + } + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_BIGBYS_CRUSHING_HAND, TRUE)); + + //SR + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl+ SPGetPenetr())) + { + int nCasterRoll = d20(1) + + nAbilityModifier + + CasterLvl + 12 + -1; + int nTargetRoll = GetAC(oTarget); + + // Give the caster feedback about the grapple check if he is a PC. + if (GetIsPC(OBJECT_SELF)) + { + SendMessageToPC(OBJECT_SELF, nCasterRoll >= nTargetRoll ? + "Bigby's Crushing Hand hit" : "Bigby's Grasping Hand missed"); + } + + // * grapple HIT succesful, + if (nCasterRoll >= nTargetRoll) + { + // * now must make a GRAPPLE check + // * hold target for duration of spell + + nCasterRoll = d20(1) + nAbilityModifier + +CasterLvl + 12 + 4; + + int nGrapple = _DoGrappleCheck(OBJECT_INVALID, oTarget, nCasterRoll); + + // Give the caster feedback about the grapple check if he is a PC. + if (GetIsPC(OBJECT_SELF)) + { + string suffix = nCasterRoll >= nTargetRoll ? ", success" : ", failure"; + SendMessageToPC(OBJECT_SELF, "Grapple check " + IntToString(nCasterRoll) + + " vs. " + IntToString(nTargetRoll) + suffix); + } + + if (nGrapple) + { + effect eKnockdown = EffectParalyze(); + + // creatures immune to paralzation are still prevented from moving + if (GetIsImmune(oTarget, EFFECT_TYPE_PARALYZE) == FALSE) + eKnockdown = EffectCutsceneImmobilize(); + + effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_CRUSHING_HAND); + effect eLink = EffectLinkEffects(eKnockdown, eHand); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, + eLink, oTarget, + RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); + + object oSelf = OBJECT_SELF; + RunHandImpact(oTarget, oSelf); + FloatingTextStrRefOnCreature(2478, OBJECT_SELF); + + } + else + { + FloatingTextStrRefOnCreature(83309, OBJECT_SELF); + } + } + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + + diff --git a/35expandedspells/x0_s0_bombard.ncs b/35expandedspells/x0_s0_bombard.ncs new file mode 100644 index 00000000..7ec7e886 Binary files /dev/null and b/35expandedspells/x0_s0_bombard.ncs differ diff --git a/35expandedspells/x0_s0_bombard.nss b/35expandedspells/x0_s0_bombard.nss new file mode 100644 index 00000000..65238828 --- /dev/null +++ b/35expandedspells/x0_s0_bombard.nss @@ -0,0 +1,119 @@ +//:://///////////////////////////////////////////// +//:: Bombardment +//:: X0_S0_Bombard +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +// Rocks fall from sky +// 1d8 damage/level to a max of 10d8 +// Reflex save for half +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 22 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs May 01, 2003 + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oCaster = OBJECT_SELF; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nCasterLvl = CasterLvl; + CasterLvl +=SPGetPenetr(); + + + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage; + float fDelay; + effect eExplode = EffectVisualEffect(VFX_FNF_METEOR_SWARM); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + effect eDam; + //Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + //Limit Caster level for the purposes of damage + if (nCasterLvl > 60) + { + nCasterLvl = 60; + } + + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, lTarget); + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF) == TRUE) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + int nSpellDC = (PRCGetSaveDC(oTarget,OBJECT_SELF)) ; + //Roll damage for each target + nDamage = d8(nCasterLvl); + //Resolve metamagic + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = 8 * nCasterLvl; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + nDamage / 2; + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nSpellDC, SAVING_THROW_TYPE_ALL); + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_BLUDGEONING); + if(nDamage > 0) + { + + // Apply effects to the currently selected target. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + + diff --git a/35expandedspells/x0_s0_divfav.ncs b/35expandedspells/x0_s0_divfav.ncs new file mode 100644 index 00000000..b89aa54d Binary files /dev/null and b/35expandedspells/x0_s0_divfav.ncs differ diff --git a/35expandedspells/x0_s0_divfav.nss b/35expandedspells/x0_s0_divfav.nss new file mode 100644 index 00000000..49291fa7 --- /dev/null +++ b/35expandedspells/x0_s0_divfav.nss @@ -0,0 +1,70 @@ +//:://///////////////////////////////////////////// +//:: Divine Favor +//:: x0_s0_divfav.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +Evocation +Level: Clr 1, Pal 1 +Components: V, S, DF +Casting Time: 1 standard action +Range: Personal +Target: You +Duration: 1 minute + +Calling upon the strength and wisdom of a deity, +you gain a +1 luck bonus on attack and weapon +damage rolls for every three caster levels you +have (at least +1, maximum +5). The bonus doesn’t +apply to spell damage. + +NOTE: Official rules say +6, we can only go to +5 + Duration: 1 turn +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: July 15, 2002 +//::////////////////////////////////////////////// +//:: VFX Pass By: +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +//:: Updated by Strat to fix bug + +#include "prc_inc_spells" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + int CasterLvl = PRCGetCasterLevel(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDuration = TurnsToSeconds(1); // * Duration 1 turn + if(nMetaMagic & METAMAGIC_EXTEND) + fDuration *= 2; + int nScale = min(20, max(1, CasterLvl / 3)); + + effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY); + + // * determine the damage bonus to apply + effect eAttack = EffectAttackIncrease(nScale); + effect eDamage = EffectDamageIncrease(nScale, DAMAGE_TYPE_MAGICAL); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eAttack, eDamage); + eLink = EffectLinkEffects(eLink, eDur); + + //Apply Impact + effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_30); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); + + //Fire spell cast at event for target + SignalEvent(oCaster, EventSpellCastAt(oCaster, SPELL_DIVINE_FAVOR, FALSE)); + + //Apply VFX impact and bonus effects + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCaster); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, fDuration, TRUE, SPELL_DIVINE_FAVOR, CasterLvl); + + PRCSetSchool(); +} diff --git a/35expandedspells/x0_s0_earthquake.ncs b/35expandedspells/x0_s0_earthquake.ncs new file mode 100644 index 00000000..38f2652b Binary files /dev/null and b/35expandedspells/x0_s0_earthquake.ncs differ diff --git a/35expandedspells/x0_s0_earthquake.nss b/35expandedspells/x0_s0_earthquake.nss new file mode 100644 index 00000000..9bc68898 --- /dev/null +++ b/35expandedspells/x0_s0_earthquake.nss @@ -0,0 +1,138 @@ +//:://///////////////////////////////////////////// +//:: Earthquake +//:: X0_S0_Earthquake +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +// Ground shakes. 1d6 damage, max 10d6 +// LOCKINDAL: Changed to alternate: DC 15 or knock down, 25% creatures must make DC 20 or die. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 22 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs May 01, 2003 +//:: Altered By: Lockindal + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + +#include "prc_alterations" +#include "prc_add_spell_dc" + +void DoQuake(object oCaster, int nCasterLvl, location lTarget) +{ + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + int nSpectacularDeath = TRUE; + int nDisplayFeedback = TRUE; + int bInside = GetIsAreaInterior(GetArea(oCaster)); + int nProneDC = 15 + (nCasterLvl/2); + int nDamageDC = 15 + (nCasterLvl/2); + int nFissureDC = 20 + (nCasterLvl/2); + int nDamage; + float fDelay; + float fSize = FeetToMeters(80.0f); + float fProneDur = 18.0; + effect eExplode = EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM); + effect eExplode2 = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_NATURE); + effect eExplode3 = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION); + effect eVis = EffectVisualEffect(VFX_IMP_HEAD_NATURE); + effect eShake = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE2); + effect eKnockdown = EffectKnockdown(); + + // Perform screen shake + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eShake, oCaster); + + //Apply epicenter explosion on caster + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, GetLocation(oCaster)); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode2, GetLocation(oCaster)); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode3, GetLocation(oCaster)); + + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, fSize, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + // Normal targeting restriction, except also skip affecting the caster + if(oTarget != oCaster && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + // Let the target's AI know + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_EARTHQUAKE)); + + // First, always knock targets prone, DC 15 to avoid + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nProneDC, SAVING_THROW_TYPE_SPELL, oCaster)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eKnockdown, oTarget, fProneDur, FALSE, SPELL_EARTHQUAKE, nCasterLvl, oCaster); + } + + // Indoors, get hit by falling rubble for 8d6, reflex half + if(bInside) + { + nDamage = PRCGetReflexAdjustedDamage(d6(nCasterLvl), oTarget, nDamageDC, SAVING_THROW_TYPE_SPELL, oCaster); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_ENERGY), + oTarget, 0.0f, FALSE, SPELL_EARTHQUAKE, nCasterLvl, oCaster); + } + // Outdoors, 25% chance to fall into a fissure and die + else + { + if(d4() == 4) + { + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nFissureDC, SAVING_THROW_TYPE_SPELL, oCaster)) + { + DeathlessFrenzyCheck(oTarget); + /// @todo Find appropriate VFX to play here + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(nSpectacularDeath, nDisplayFeedback), + oTarget, 0.0f, FALSE, SPELL_EARTHQUAKE, nCasterLvl, oCaster); + } + } + } + } + + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, fSize, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + PRCSetSchool(); +} + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + + // Perform the earthquake + DoQuake(oCaster, nCasterLvl, lTarget); + + // Extended earthquake - apply the effects again next round + if(nMetaMagic & METAMAGIC_EXTEND) + DelayCommand(6.0f, DoQuake(oCaster, nCasterLvl, lTarget)); + +// Erasing the variable used to store the spell's spell school +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +} \ No newline at end of file diff --git a/35expandedspells/x0_s0_elecjolt.ncs b/35expandedspells/x0_s0_elecjolt.ncs new file mode 100644 index 00000000..6bf2aa4a Binary files /dev/null and b/35expandedspells/x0_s0_elecjolt.ncs differ diff --git a/35expandedspells/x0_s0_elecjolt.nss b/35expandedspells/x0_s0_elecjolt.nss new file mode 100644 index 00000000..14ba4bac --- /dev/null +++ b/35expandedspells/x0_s0_elecjolt.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Electric Jolt +//:: [x0_s0_ElecJolt.nss] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +Evocation [Electricity] +Level: Sorcerer/wizard 0 +Components: V, S +Casting Time: 1 standard action +Range: Close (25 ft. + 5 ft./2 levels) +Effect: Ray +Duration: Instantaneous +Saving Throw: None +Spell Resistance: Yes + +You release a small stroke of electrical energy. +You must succeed on a ranged touch attack with the +ray to strike a target. The spell deals 1d3 points +of electricity damage. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 17 2002 +//::////////////////////////////////////////////// +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_sp_func" +#include "prc_inc_sp_tch" + +int DoSpell(object oCaster, object oTarget, int nCasterLevel) +{ + //Declare major variables + int nPenetr = nCasterLevel + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ELECTRICAL); + int iAttackRoll = 0; + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ELECTRIC_JOLT)); + + iAttackRoll = PRCDoRangedTouchAttack(oTarget); + if(iAttackRoll > 0) + { + //Make SR Check + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr)) + { + int nDamage = PRCMaximizeOrEmpower(nPenetr, 1, nMetaMagic); //alterei o 3 por caster lvl+spell penetration + + //Apply the VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + // perform attack roll for ray and deal proper damage + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, EleDmg); + PRCBonusDamage(oTarget); + } + } + } + return iAttackRoll; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if (GetLocalInt(oCaster, PRC_SPELL_HOLD) && GetHasFeat(FEAT_EF_HOLD_RAY, oCaster) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + if(oCaster != oTarget) //cant target self with this spell, only when holding charge + DoSpell(oCaster, oTarget, nCasterLevel); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} diff --git a/35expandedspells/x0_s0_ether.ncs b/35expandedspells/x0_s0_ether.ncs new file mode 100644 index 00000000..362b441c Binary files /dev/null and b/35expandedspells/x0_s0_ether.ncs differ diff --git a/35expandedspells/x0_s0_ether.nss b/35expandedspells/x0_s0_ether.nss new file mode 100644 index 00000000..e002e1a9 --- /dev/null +++ b/35expandedspells/x0_s0_ether.nss @@ -0,0 +1,113 @@ +//:://///////////////////////////////////////////// +//:: Etherealness +//:: x0_s0_ether.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Like sanctuary except almost always guaranteed + to work. + Lasts one turn per level. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//::////////////////////////////////////////////// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" +#include "prc_inc_teleport" + + + +void main() +{ + + +//Spell Time Lock duration (in seconds, use float values) +float iLockTimer = 240.0; +//Defining time variables +float f120togo = ( 120 - iLockTimer ) * -1; +float f60togo = ( 60 - iLockTimer ) * -1; +float f10togo = ( 10 - iLockTimer ) * -1; + +//Checking spell's caster +object oTarget = PRCGetSpellTargetObject(); +//Checking if he used GS recently +int iTimer = GetLocalInt(oTarget, "GSTimer"); + + + + if (iTimer == 0) //teste + { + SetLocalInt(oTarget, "GSTimer", 1); + //Change: Checking target's area + object oArea = GetArea(oTarget); + + + + DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); + SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget = PRCGetSpellTargetObject(); + effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eSanc = EffectEthereal(); + + effect eLink = EffectLinkEffects(eVis, eSanc); + eLink = EffectLinkEffects(eLink, eDur); + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nDuration = CasterLvl/10; //nerfei a duracao aqui + //Enter Metamagic conditions + int nMetaMagic = PRCGetMetaMagicFeat(); + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ETHEREALNESS, FALSE)); + + // Make a check to see nothing is preventing extra-dimensional movement + if(GetCanTeleport(oTarget, GetLocation(oTarget), FALSE, TRUE)) + { + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl/10); //casterlvl/10 aqui antes era so casterlvl + } + + DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); + // Erasing the variable used to store the spell's spell school + + SendMessageToAllDMs("Player "+ObjectToString(oTarget)+" has just cast Greater Sanctuary. He is currently in "+ObjectToString(oArea)+"."); + SendMessageToPC(oTarget, "Greater Sanctuary has a timer of "+FloatToString(iLockTimer, 3, 1)+" seconds. You may not use GS again for this period of time. Attempting to do so will spend the spell while producing no effect."); + DelayCommand(f120togo, SendMessageToPC(oTarget, "You have two minutes left on your Greater Sanctuary Lock Timer.")); + DelayCommand(f60togo, SendMessageToPC(oTarget, "You have one minute left on your Greater Sanctuary Lock Timer.")); + DelayCommand(f10togo, SendMessageToPC(oTarget, "You have 10 seconds left on your Greater Sanctuary Lock Timer.")); + DelayCommand(iLockTimer, SendMessageToPC(oTarget, "Greater Sanctuary is once again available for use.")); + DelayCommand(iLockTimer, SetLocalInt(oTarget, "GSTimer", 0)); + } + else + { + SendMessageToPC(oTarget, "You have used Greater Sanctuary too recently, the effect has been cancelled"); + } +} + + + diff --git a/35expandedspells/x0_s0_firebrand.ncs b/35expandedspells/x0_s0_firebrand.ncs new file mode 100644 index 00000000..98f81bbb Binary files /dev/null and b/35expandedspells/x0_s0_firebrand.ncs differ diff --git a/35expandedspells/x0_s0_firebrand.nss b/35expandedspells/x0_s0_firebrand.nss new file mode 100644 index 00000000..19f2ebee --- /dev/null +++ b/35expandedspells/x0_s0_firebrand.nss @@ -0,0 +1,226 @@ +//:://///////////////////////////////////////////// +//:: Firebrand +//:: x0_x0_Firebrand +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +// * Fires a flame arrow to every target in a +// * colossal area +// * Each target explodes into a small fireball for +// * 1d6 damage / level (max = 15 levels) +// * Only nLevel targets can be affected +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 29 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: + +// +// Altered to give targets reflex saves per pnp. +// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + +#include "prc_add_spell_dc" + +void DoFirebrand(int CasterLvl,int nD6Dice, int nCap, int nSpell, + int nMIRV = VFX_IMP_MIRV, int nVIS = VFX_IMP_MAGBLUE, + int nDAMAGETYPE = DAMAGE_TYPE_MAGICAL, int nONEHIT = FALSE); + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nDamage = CasterLvl/2; + if (nDamage > 40) + nDamage = 40; + + + + // Changed to local function to add reflex save. + DoFirebrand(CasterLvl,nDamage, nDamage/2, SPELL_FIREBRAND, VFX_IMP_MIRV_FLAME, VFX_IMP_FLAME_M, ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE), FALSE); + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + + + +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 31, 2002 +//::////////////////////////////////////////////// +//:: Modified March 14 2003: Removed the option to hurt chests/doors +//:: was potentially causing bugs when no creature targets available. +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 31, 2002 +//::////////////////////////////////////////////// +//:: Modified March 14 2003: Removed the option to hurt chests/doors +//:: was potentially causing bugs when no creature targets available. +void DoFirebrand(int CasterLvl,int nD6Dice, int nCap, int nSpell, int nMIRV = VFX_IMP_MIRV, int nVIS = VFX_IMP_MAGBLUE, int nDAMAGETYPE = DAMAGE_TYPE_MAGICAL, int nONEHIT = FALSE) +{ + object oTarget = OBJECT_INVALID; + int nDamage = 0; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCnt = 1; + effect eMissile = EffectVisualEffect(nMIRV); + effect eVis = EffectVisualEffect(nVIS); + float fDist = 0.0; + float fDelay = 0.0; + float fDelay2, fTime; + location lTarget = PRCGetSpellTargetLocation(); // missile spread centered around caster + int nMissiles = CasterLvl; + + if (nMissiles > nCap) + { + nMissiles = nCap; + } + + /* New Algorithm + 1. Count # of targets + 2. Determine number of missiles + 3. First target gets a missile and all Excess missiles + 4. Rest of targets (max nMissiles) get one missile + */ + int nEnemies = 0; + int nCasterlvl = CasterLvl +SPGetPenetr(); + + + + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget) ) + { + // * caster cannot be harmed by this spell + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && (oTarget != OBJECT_SELF)) + { + // GZ: You can only fire missiles on visible targets + if (GetObjectSeen(oTarget,OBJECT_SELF)) + { + nEnemies++; + } + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + if (nEnemies == 0) return; // * Exit if no enemies to hit + int nExtraMissiles = nMissiles / nEnemies; + + // April 2003 + // * if more enemies than missiles, need to make sure that at least + // * one missile will hit each of the enemies + if (nExtraMissiles <= 0) + { + nExtraMissiles = 1; + } + + // by default the Remainder will be 0 (if more than enough enemies for all the missiles) + int nRemainder = 0; + + if (nExtraMissiles >0) + nRemainder = nMissiles % nEnemies; + + if (nEnemies > nMissiles) + nEnemies = nMissiles; + + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget) && nCnt <= nEnemies) + { + // * caster cannot be harmed by this spell + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) && (oTarget != OBJECT_SELF) && (GetObjectSeen(oTarget,OBJECT_SELF))) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpell)); + + // * recalculate appropriate distances + fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + fDelay = fDist/(3.0 * log(fDist) + 2.0); + + // Firebrand. + // It means that once the target has taken damage this round from the + // spell it won't take subsequent damage + if (nONEHIT == TRUE) + { + nExtraMissiles = 1; + nRemainder = 0; + } + + int i = 0; + //-------------------------------------------------------------- + // GZ: Moved SR check out of loop to have 1 check per target + // not one check per missile, which would rip spell mantels + // apart + //-------------------------------------------------------------- + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterlvl, fDelay)) + { + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + for (i=1; i <= nExtraMissiles + nRemainder; i++) + { + //Roll damage + int nDam = d6(nD6Dice); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = nD6Dice*6;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + if(i == 1) //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + fTime = fDelay; + fDelay2 += 0.1; + fTime += fDelay2; + + // Adjust damage for reflex save / evasion / imp evasion + nDam = PRCGetReflexAdjustedDamage(nDam, oTarget, + nDC, SAVING_THROW_TYPE_FIRE); + + // Always apply missle but only apply impact/damage if we really have damage. + DelayCommand(fDelay2, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget)); + if (nDam > 0) + { + //Set damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, nDAMAGETYPE); + //Apply the MIRV and damage effect + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0f,TRUE,-1,CasterLvl)); + DelayCommand(fTime, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + } + } + } // for + else + { // * apply a dummy visual effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget); + } + nCnt++;// * increment count of missiles fired + nRemainder = 0; + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + +} diff --git a/35expandedspells/x0_s0_flare.ncs b/35expandedspells/x0_s0_flare.ncs new file mode 100644 index 00000000..847559a8 Binary files /dev/null and b/35expandedspells/x0_s0_flare.ncs differ diff --git a/35expandedspells/x0_s0_flare.nss b/35expandedspells/x0_s0_flare.nss new file mode 100644 index 00000000..68639028 --- /dev/null +++ b/35expandedspells/x0_s0_flare.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Flare +//:: [X0_S0_Flare.nss] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creature hit by ray loses 1 to attack rolls. + + DURATION: 10 rounds. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 17 2002 +//::////////////////////////////////////////////// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + +#include "prc_add_spell_dc" + +void main() +{ + + //if (GetHasFeat(FEAT_SHADOWWEAVE,OBJECT_SELF)) return; + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nCasterLevel = CasterLvl + SPGetPenetr(); + + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 416)); + + // * Apply the hit effect so player knows something happened + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + // If already blinded no affect + if(!PRCGetHasEffect(EFFECT_TYPE_BLINDNESS, oTarget) && (GetRacialType(oTarget) != RACIAL_TYPE_OOZE) && PRCGetIsAliveCreature(oTarget)) + { + //Make SR Check + if((!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel))) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)))) + { + //Set damage effect + effect eBad = EffectAttackDecrease(1+(nCasterLevel/4)); + //Apply the VFX impact and damage effect + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10),TRUE,-1,CasterLvl); + } + } + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + diff --git a/35expandedspells/x0_s0_gmagicfang.ncs b/35expandedspells/x0_s0_gmagicfang.ncs new file mode 100644 index 00000000..52a76c7c Binary files /dev/null and b/35expandedspells/x0_s0_gmagicfang.ncs differ diff --git a/35expandedspells/x0_s0_gmagicfang.nss b/35expandedspells/x0_s0_gmagicfang.nss new file mode 100644 index 00000000..e9c41d1a --- /dev/null +++ b/35expandedspells/x0_s0_gmagicfang.nss @@ -0,0 +1,144 @@ +//:://///////////////////////////////////////////// +//:: Greater Magic Fang +//:: x0_s0_gmagicfang.nss +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + +1 enhancement bonus to attack and damage rolls. + Also applys damage reduction +1; this allows the creature + to strike creatures with +1 damage reduction. + + Checks to see if a valid summoned monster or animal companion + exists to apply the effects to. If none exists, then + the spell is wasted. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: September 6, 2002 +//::////////////////////////////////////////////// +//:: VFX Pass By: + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void CheckStillUnarmed(object oTarget) +{ + //only works if you have nothing in right & left hands + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget)) + || GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget))) + { + FloatingTextStrRefOnCreature(8962, OBJECT_SELF, FALSE); + //remove other magic fang effects + PRCRemoveSpellEffects(452, OBJECT_SELF, oTarget); + PRCRemoveSpellEffects(453, OBJECT_SELF, oTarget); + return; // has neither an animal companion + } + DelayCommand(1.0, CheckStillUnarmed(oTarget)); +} + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + + int nCasterLevel = PRCGetCasterLevel(OBJECT_SELF); + int nPower = (nCasterLevel + 1) / 3; + if (nPower > 20) + nPower = 20; // * max of +20 bonus + int nDamagePower = DAMAGE_POWER_PLUS_ONE; + + switch (nPower) + { + case 1: nDamagePower = DAMAGE_POWER_PLUS_ONE; break; + case 2: nDamagePower = DAMAGE_POWER_PLUS_TWO; break; + case 3: nDamagePower = DAMAGE_POWER_PLUS_THREE; break; + case 4: nDamagePower = DAMAGE_POWER_PLUS_FOUR; break; + case 5: nDamagePower = DAMAGE_POWER_PLUS_FIVE; break; + case 6: nDamagePower = DAMAGE_POWER_PLUS_SIX; break; + case 7: nDamagePower = DAMAGE_POWER_PLUS_SEVEN; break; + case 8: nDamagePower = DAMAGE_POWER_PLUS_EIGHT; break; + case 9: nDamagePower = DAMAGE_POWER_PLUS_NINE; break; + case 10: nDamagePower = DAMAGE_POWER_PLUS_TEN; break; + case 11: nDamagePower = DAMAGE_POWER_PLUS_ELEVEN; break; + case 12: nDamagePower = DAMAGE_POWER_PLUS_TWELVE; break; + case 13: nDamagePower = DAMAGE_POWER_PLUS_THIRTEEN; break; + case 14: nDamagePower = DAMAGE_POWER_PLUS_FOURTEEN; break; + case 15: nDamagePower = DAMAGE_POWER_PLUS_FIFTEEN; break; + case 16: nDamagePower = DAMAGE_POWER_PLUS_SIXTEEN; break; + case 17: nDamagePower = DAMAGE_POWER_PLUS_SEVENTEEN; break; + case 18: nDamagePower = DAMAGE_POWER_PLUS_EIGHTEEN; break; + case 19: nDamagePower = DAMAGE_POWER_PLUS_NINTEEN; break; + case 20: nDamagePower = DAMAGE_POWER_PLUS_TWENTY; break; + } + //DoMagicFang(nPower, nDamagePower,nCasterLevel); + //PRCversion + object oTarget = PRCGetSpellTargetObject(); + //only works if you have nothing in right & left hands + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget)) + || GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget))) + { + FloatingTextStrRefOnCreature(8962, OBJECT_SELF, FALSE); + return; // has neither an animal companion + } + //only works if target has monk levels + //or has a creature weapon + if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget)) + && !GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget)) + && !GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget)) + && !GetLevelByClass(CLASS_TYPE_MONK, oTarget)) + { + FloatingTextStrRefOnCreature(8962, OBJECT_SELF, FALSE); + return; // has neither an animal companion + } + + //remove other magic fang effects + PRCRemoveSpellEffects(452, OBJECT_SELF, oTarget); + PRCRemoveSpellEffects(453, OBJECT_SELF, oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); + int nMetaMagic = PRCGetMetaMagicFeat(); + + effect eAttack = EffectAttackIncrease(nPower); + effect eDamage = EffectDamageIncrease(nPower); + effect eReduction = EffectDamageReduction(nPower, nDamagePower); // * doing this because + // * it creates a true + // * enhancement bonus + + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eLink = EffectLinkEffects(eAttack, eDur); + eLink = EffectLinkEffects(eLink, eDamage); + eLink = EffectLinkEffects(eLink, eReduction); + + float fDuration = HoursToSeconds(nCasterLevel); // * Duration 1 hour/level + if ((nMetaMagic & METAMAGIC_EXTEND)) //Duration is +100% + { + fDuration = fDuration * 2.0; + } + + //Fire spell cast at event for target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId(), FALSE)); + //Apply VFX impact and bonus effects + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + DelayCommand(1.0, CheckStillUnarmed(oTarget)); + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} diff --git a/35expandedspells/x0_s0_inferno.ncs b/35expandedspells/x0_s0_inferno.ncs new file mode 100644 index 00000000..b6004d6c Binary files /dev/null and b/35expandedspells/x0_s0_inferno.ncs differ diff --git a/35expandedspells/x0_s0_inferno.nss b/35expandedspells/x0_s0_inferno.nss new file mode 100644 index 00000000..52eb02bb --- /dev/null +++ b/35expandedspells/x0_s0_inferno.nss @@ -0,0 +1,146 @@ +//:://///////////////////////////////////////////// +//:: Inferno +//:: x0_s0_inferno.nss +//:: Copyright (c) 2000 Bioware Corp. +//::////////////////////////////////////////////// +/* + Does 2d6 fire per round + Duration: 1 round per level +*/ +//::////////////////////////////////////////////// +//:: Created By: Aidan Scanlan +//:: Created On: 01/09/01 +//::////////////////////////////////////////////// +//:: Rewritten: Georg Zoeller, 2003-Oct-19 +//:: - VFX update +//:: - Spell no longer stacks with itself +//:: - Spell can now be dispelled +//:: - Spell is now much less cpu expensive + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_alterations" +#include "prc_add_spell_dc" + +void RunImpact(object oTarget, object oCaster, int nMetamagic,int EleDmg); + +void main() +{ + + DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); + SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); + + + + object oTarget = PRCGetSpellTargetObject(); + + //-------------------------------------------------------------------------- + // Spellcast Hook Code + // Added 2003-06-20 by Georg + // If you want to make changes to all spells, check x2_inc_spellhook.nss to + // find out more + //-------------------------------------------------------------------------- + if (!X2PreSpellCastCode()) + { + return; + } + // End of Spell Cast Hook + + //-------------------------------------------------------------------------- + // This spell no longer stacks. If there is one of that type, thats ok + //-------------------------------------------------------------------------- + if (GetHasSpellEffect(GetSpellId(),oTarget) || GetHasSpellEffect(SPELL_COMBUST,oTarget)) + { + FloatingTextStrRefOnCreature(100775,OBJECT_SELF,FALSE); + return; + } + + //-------------------------------------------------------------------------- + // Calculate the duration + //-------------------------------------------------------------------------- + int nMetaMagic = PRCGetMetaMagicFeat(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_FIRE); + + int nDuration = CasterLvl ; + int nPenetr = CasterLvl + SPGetPenetr(); + + if ((nMetaMagic & METAMAGIC_EXTEND)) + { + nDuration = nDuration * 2; + } + + if (nDuration < 1) + { + nDuration = 1; + } + + //-------------------------------------------------------------------------- + // Flamethrower VFX, thanks to Alex + //-------------------------------------------------------------------------- + effect eRay = EffectBeam(444,OBJECT_SELF,BODY_NODE_CHEST); + effect eDur = EffectVisualEffect(498); + + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId())); + + float fDelay = GetDistanceBetween(oTarget, OBJECT_SELF)/13; + + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr)) + { + //---------------------------------------------------------------------- + // Engulf the target in flame + //---------------------------------------------------------------------- + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 3.0f,FALSE); + + + //---------------------------------------------------------------------- + // Apply the VFX that is used to track the spells duration + //---------------------------------------------------------------------- + DelayCommand(fDelay,SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDur,oTarget,RoundsToSeconds(nDuration),FALSE)); + object oSelf = OBJECT_SELF; // because OBJECT_SELF is a function + DelayCommand(fDelay+0.1f,RunImpact(oTarget, oSelf,nMetaMagic,EleDmg)); + } + else + { + //---------------------------------------------------------------------- + // Indicate Failure + //---------------------------------------------------------------------- + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRay, oTarget, 2.0f,FALSE); + effect eSmoke = EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE); + DelayCommand(fDelay+0.3f,SPApplyEffectToObject(DURATION_TYPE_INSTANT,eSmoke,oTarget)); + } + +} + + +void RunImpact(object oTarget, object oCaster, int nMetaMagic,int EleDmg) +{ + //-------------------------------------------------------------------------- + // Check if the spell has expired (check also removes effects) + //-------------------------------------------------------------------------- + if (PRCGetDelayedSpellEffectsExpired(446,oTarget,oCaster)) + { + return; + } + + if (GetIsDead(oTarget) == FALSE) + { + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF);// ou seria oCaster? + int nPenetr = CasterLvl + SPGetPenetr(); + //---------------------------------------------------------------------- + // Calculate Damage + //---------------------------------------------------------------------- + int nDamage = PRCMaximizeOrEmpower(nPenetr/2,2,nMetaMagic); //troquei o 6 por nPenetr/2 + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_S); + eDam = EffectLinkEffects(eVis,eDam); // flare up + SPApplyEffectToObject (DURATION_TYPE_INSTANT,eDam,oTarget); + DelayCommand(6.0f,RunImpact(oTarget,oCaster,nMetaMagic,EleDmg)); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + diff --git a/35expandedspells/x0_s0_magicfang.ncs b/35expandedspells/x0_s0_magicfang.ncs new file mode 100644 index 00000000..fbe89fcb Binary files /dev/null and b/35expandedspells/x0_s0_magicfang.ncs differ diff --git a/35expandedspells/x0_s0_magicfang.nss b/35expandedspells/x0_s0_magicfang.nss new file mode 100644 index 00000000..13fae876 --- /dev/null +++ b/35expandedspells/x0_s0_magicfang.nss @@ -0,0 +1,143 @@ +/* + x0_s0_magicfang + + +1 enhancement bonus to attack and damage rolls. + Also applys damage reduction +1; this allows the creature + to strike creatures with +1 damage reduction. + + Checks to see if a valid summoned monster or animal companion + exists to apply the effects to. If none exists, then + the spell is wasted. + + By: Brent Knowles + Created: September 6, 2002 + Modified: Jun 29, 2006 + + Flaming_Sword: cleaned up, added greater magic fang +*/ + +#include "prc_sp_func" + + +void CheckStillUnarmed(object oTarget) +{ + //only works if you have nothing in right & left hands + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget)) + || GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget))) + { + FloatingTextStrRefOnCreature(8962, oTarget, FALSE); + //remove other magic fang effects + PRCRemoveSpellEffects(452, OBJECT_SELF, oTarget); + PRCRemoveSpellEffects(453, OBJECT_SELF, oTarget); + return; // has neither an animal companion + } + DelayCommand(1.0, CheckStillUnarmed(oTarget)); +} + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nSpellID = PRCGetSpellId(); + int bNorm = (nSpellID == 452); + + int nPower = bNorm ? 1 : (nCasterLevel + 1) / 3; //magic fang + if (nPower > 20) + nPower = 20; // * max of +5 bonus + int nDamagePower; + + switch (nPower) + { + case 1: nDamagePower = DAMAGE_POWER_PLUS_ONE; break; + case 2: nDamagePower = DAMAGE_POWER_PLUS_TWO; break; + case 3: nDamagePower = DAMAGE_POWER_PLUS_THREE; break; + case 4: nDamagePower = DAMAGE_POWER_PLUS_FOUR; break; + case 5: nDamagePower = DAMAGE_POWER_PLUS_FIVE; break; + case 6: nDamagePower = DAMAGE_POWER_PLUS_SIX; break; + case 7: nDamagePower = DAMAGE_POWER_PLUS_SEVEN; break; + case 8: nDamagePower = DAMAGE_POWER_PLUS_EIGHT; break; + case 9: nDamagePower = DAMAGE_POWER_PLUS_NINE; break; + case 10: nDamagePower = DAMAGE_POWER_PLUS_TEN; break; + case 11: nDamagePower = DAMAGE_POWER_PLUS_ELEVEN; break; + case 12: nDamagePower = DAMAGE_POWER_PLUS_TWELVE; break; + case 13: nDamagePower = DAMAGE_POWER_PLUS_THIRTEEN; break; + case 14: nDamagePower = DAMAGE_POWER_PLUS_FOURTEEN; break; + case 15: nDamagePower = DAMAGE_POWER_PLUS_FIFTEEN; break; + case 16: nDamagePower = DAMAGE_POWER_PLUS_SIXTEEN; break; + case 17: nDamagePower = DAMAGE_POWER_PLUS_SEVENTEEN; break; + case 18: nDamagePower = DAMAGE_POWER_PLUS_EIGHTEEN; break; + case 19: nDamagePower = DAMAGE_POWER_PLUS_NINTEEN; break; + case 20: nDamagePower = DAMAGE_POWER_PLUS_TWENTY; break; + } + + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget)) + || GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget))) + { + FloatingTextStrRefOnCreature(8962, OBJECT_SELF, FALSE); + return TRUE; // has neither an animal companion + } + //only works if target has monk levels + //or has a creature weapon + if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget)) + && !GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget)) + && !GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget)) + && !GetLevelByClass(CLASS_TYPE_MONK, oTarget)) + { + FloatingTextStrRefOnCreature(8962, OBJECT_SELF, FALSE); + return TRUE; // has neither an animal companion + } + + //remove other magic fang effects + PRCRemoveSpellEffects(452, OBJECT_SELF, oTarget); + PRCRemoveSpellEffects(453, OBJECT_SELF, oTarget); + int nMetaMagic = PRCGetMetaMagicFeat(); + + effect eLink = EffectLinkEffects(EffectAttackIncrease(nPower), EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink = EffectLinkEffects(eLink, EffectDamageIncrease(nPower)); + eLink = EffectLinkEffects(eLink, EffectDamageReduction(nPower, nDamagePower)); + + float fDuration = bNorm ? TurnsToSeconds(nCasterLevel) : HoursToSeconds(nCasterLevel); // * Duration 1 hour/level + if ((nMetaMagic & METAMAGIC_EXTEND)) //Duration is +100% + fDuration = fDuration * 2.0; + + //Fire spell cast at event for target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId(), FALSE)); + //Apply VFX impact and bonus effects + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HOLY_AID), oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + DelayCommand(1.0, CheckStillUnarmed(oTarget)); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x0_s0_missstorm1.ncs b/35expandedspells/x0_s0_missstorm1.ncs new file mode 100644 index 00000000..ee07489a Binary files /dev/null and b/35expandedspells/x0_s0_missstorm1.ncs differ diff --git a/35expandedspells/x0_s0_missstorm1.nss b/35expandedspells/x0_s0_missstorm1.nss new file mode 100644 index 00000000..8dc74406 --- /dev/null +++ b/35expandedspells/x0_s0_missstorm1.nss @@ -0,0 +1,50 @@ +//:://///////////////////////////////////////////// +//:: Isaacs Lesser Missile Storm +//:: x0_s0_MissStorm1 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Up to 10 missiles, each doing 1d6 damage to all + targets in area. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 31, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "spinc_bolt" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + If you want to make changes to all spells, + check x2_inc_spellhook.nss to find out more + +*/ +int nClass = GetLevelByClass(CLASS_TYPE_FMM); + +int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + if (!X2PreSpellCastCode()) + { + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + return; + } + +// End of Spell Cast Hook + + //SpawnScriptDebugger(); + PRCDoMissileStorm(1+(nCasterLvl/13), 10+(nClass/5)+(nCasterLvl/10), SPELL_ISAACS_LESSER_MISSILE_STORM); + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + diff --git a/35expandedspells/x0_s0_missstorm2.ncs b/35expandedspells/x0_s0_missstorm2.ncs new file mode 100644 index 00000000..ae16e916 Binary files /dev/null and b/35expandedspells/x0_s0_missstorm2.ncs differ diff --git a/35expandedspells/x0_s0_missstorm2.nss b/35expandedspells/x0_s0_missstorm2.nss new file mode 100644 index 00000000..187d973e --- /dev/null +++ b/35expandedspells/x0_s0_missstorm2.nss @@ -0,0 +1,51 @@ +//:://///////////////////////////////////////////// +//:: Isaacs Greater Missile Storm +//:: x0_s0_MissStorm2 +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Up to 20 missiles, each doing 3d6 damage to each + target in area. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 31, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "spinc_bolt" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + If you want to make changes to all spells, + check x2_inc_spellhook.nss to find out more + +*/ +int nClass = GetLevelByClass(CLASS_TYPE_FMM); + +int nCasterLvl = PRCGetCasterLevel(OBJECT_SELF); + if (!X2PreSpellCastCode()) + { + // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell + return; + } + +// End of Spell Cast Hook + + + + PRCDoMissileStorm(2+(nCasterLvl/12), 20+(nClass/5)+(nCasterLvl/10), SPELL_ISAACS_GREATER_MISSILE_STORM); + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + diff --git a/35expandedspells/x0_s0_quillfire.ncs b/35expandedspells/x0_s0_quillfire.ncs new file mode 100644 index 00000000..5e0c2a40 Binary files /dev/null and b/35expandedspells/x0_s0_quillfire.ncs differ diff --git a/35expandedspells/x0_s0_quillfire.nss b/35expandedspells/x0_s0_quillfire.nss new file mode 100644 index 00000000..6fd9d13d --- /dev/null +++ b/35expandedspells/x0_s0_quillfire.nss @@ -0,0 +1,102 @@ +//:://///////////////////////////////////////////// +//:: Quillfire +//:: [x0_s0_quillfire.nss] +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Fires a cluster of quills at a target. Ranged Attack. + 2d8 + 1 point /2 levels (max 5) + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 17 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs May 02, 2003 + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + +#include "prc_alterations" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 ( fDist / (3.0f * log( fDist ) + 2.0f) ) + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + int nCasterLvl = CasterLvl; + int nDamage = 0; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCnt; + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_QUILLFIRE)); + //Apply a single damage hit for each missile instead of as a single mass + //Make SR Check + { + // BK: No spell resistance for quillfire + //if(!PRCDoResistSpell(OBJECT_SELF, oTarget, fDelay)) + { + //eMissile = EffectVisualEffect(VFX_IMP_MIRV_FLAME); + //Roll damage + int nDam = d8(1); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 8;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + //* apply bonus damage for level + int nBonus = nCasterLvl/ 2; + if (nBonus > 20) + { + nBonus = 20; + } + nDam = nDam + nBonus; + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + effect eDam = PRCEffectDamage(oTarget, nDam, DAMAGE_TYPE_MAGICAL); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget,0.0f,TRUE,-1,CasterLvl); + // * also applies poison damage + effect ePoison = EffectPoison(POISON_LARGE_SCORPION_VENOM); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget,0.0f,TRUE,-1,CasterLvl); + + //Apply the MIRV and damage effect + //SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget); + } + + } + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + + diff --git a/35expandedspells/x0_s0_shieldfait.ncs b/35expandedspells/x0_s0_shieldfait.ncs new file mode 100644 index 00000000..3e19998a Binary files /dev/null and b/35expandedspells/x0_s0_shieldfait.ncs differ diff --git a/35expandedspells/x0_s0_shieldfait.nss b/35expandedspells/x0_s0_shieldfait.nss new file mode 100644 index 00000000..dd5ba6f9 --- /dev/null +++ b/35expandedspells/x0_s0_shieldfait.nss @@ -0,0 +1,63 @@ +/* + x0_s0_shieldfait + + +2 deflection AC bonus, +1 every 6 levels (max +5) + Duration: 1 turn/level + + By: Brent Knowles + Created: Sep 6, 2002 + Modified: Jun 29, 2006 +*/ + +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nMetaMagic = PRCGetMetaMagicFeat(); + int nValue = 2 + (nCasterLevel)/6; + if(nValue > 20) + nValue = 20; // * Max of 5 + effect eLink = EffectLinkEffects(EffectACIncrease(nValue, AC_DEFLECTION_BONUS), EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR)); + int nDuration = nCasterLevel; // * Duration 1 turn/level + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) //Duration is +100% + nDuration *= 2; + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 421, FALSE)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_AC_BONUS), oTarget); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,nCasterLevel); + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x0_s0_spikegroen.ncs b/35expandedspells/x0_s0_spikegroen.ncs new file mode 100644 index 00000000..85111999 Binary files /dev/null and b/35expandedspells/x0_s0_spikegroen.ncs differ diff --git a/35expandedspells/x0_s0_spikegroen.nss b/35expandedspells/x0_s0_spikegroen.nss new file mode 100644 index 00000000..00b67392 --- /dev/null +++ b/35expandedspells/x0_s0_spikegroen.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Spike Growth: On Enter +//:: x0_s0_spikegroEN.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 1d4 acid damage + per round +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: September 6, 2002 +//::////////////////////////////////////////////// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +//:://///////////////////////////////////////////// +//:: PRCDoSpikeGrowthEffect +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + 1d4 damage, plus a 24 hr slow if take damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: +//:: Created On: +//::////////////////////////////////////////////// + +void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) +{ + float fDelay = PRCGetRandomDelay(1.0, 2.2); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the target + SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), 453)); + //Spell resistance check + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr, fDelay)) + { + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam = PRCMaximizeOrEmpower(20, 1, nMetaMagic); + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + + effect eDam = EffectDamage(nDam, DAMAGE_TYPE_PIERCING); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + //effect eLink = eDam; + //Apply damage and visuals + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); + + // * only apply a slow effect from this spell once + if (GetHasSpellEffect(453, oTarget) == FALSE) + { + //Make a Reflex Save to avoid the effects of the movement hit. + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()), SAVING_THROW_ALL, GetAreaOfEffectCreator(), fDelay)) + { + effect eSpeed = EffectMovementSpeedDecrease(30); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); + } + } + } + } +} + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); + + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); + + + PRCDoSpikeGrowthEffect(GetEnteringObject(),nPenetr); + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} diff --git a/35expandedspells/x0_s0_spikegrohb.ncs b/35expandedspells/x0_s0_spikegrohb.ncs new file mode 100644 index 00000000..390b4274 Binary files /dev/null and b/35expandedspells/x0_s0_spikegrohb.ncs differ diff --git a/35expandedspells/x0_s0_spikegrohb.nss b/35expandedspells/x0_s0_spikegrohb.nss new file mode 100644 index 00000000..b7745f6f --- /dev/null +++ b/35expandedspells/x0_s0_spikegrohb.nss @@ -0,0 +1,88 @@ +//:://///////////////////////////////////////////// +//:: Spike Growth: On Heartbeat +//:: x0_s0_spikegroHB.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + All creatures within the AoE take 1d4 acid damage + per round +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: September 6, 2002 +//::////////////////////////////////////////////// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +//:://///////////////////////////////////////////// +//:: PRCDoSpikeGrowthEffect +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + 1d4 damage, plus a 24 hr slow if take damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: +//:: Created On: +//::////////////////////////////////////////////// + +void PRCDoSpikeGrowthEffect(object oTarget,int nPenetr) +{ + float fDelay = PRCGetRandomDelay(1.0, 2.2); + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator())) + { + //Fire cast spell at event for the target + SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), 453)); + //Spell resistance check + if(!PRCDoResistSpell(GetAreaOfEffectCreator(), oTarget,nPenetr, fDelay)) + { + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDam = PRCMaximizeOrEmpower(20, 1, nMetaMagic); + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + + effect eDam = EffectDamage(nDam, DAMAGE_TYPE_PIERCING); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + //effect eLink = eDam; + //Apply damage and visuals + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam/*eLink*/, oTarget)); + + // * only apply a slow effect from this spell once + if (GetHasSpellEffect(453, oTarget) == FALSE) + { + //Make a Reflex Save to avoid the effects of the movement hit. + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, PRCGetSaveDC(oTarget,GetAreaOfEffectCreator()), SAVING_THROW_ALL, GetAreaOfEffectCreator(), fDelay)) + { + effect eSpeed = EffectMovementSpeedDecrease(30); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, oTarget, HoursToSeconds(24)); + } + } + } + } +} + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); + + int nPenetr = SPGetPenetrAOE(GetAreaOfEffectCreator()); + + + object oTarget; + //Start cycling through the AOE Object for viable targets including doors and placable objects. + oTarget = GetFirstInPersistentObject(OBJECT_SELF); + while(GetIsObjectValid(oTarget)) + { + PRCDoSpikeGrowthEffect(oTarget,nPenetr); + //Get next target. + oTarget = GetNextInPersistentObject(OBJECT_SELF); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} diff --git a/35expandedspells/x0_s0_sunburst.ncs b/35expandedspells/x0_s0_sunburst.ncs new file mode 100644 index 00000000..f5fcb9e2 Binary files /dev/null and b/35expandedspells/x0_s0_sunburst.ncs differ diff --git a/35expandedspells/x0_s0_sunburst.nss b/35expandedspells/x0_s0_sunburst.nss new file mode 100644 index 00000000..8c9a4faf --- /dev/null +++ b/35expandedspells/x0_s0_sunburst.nss @@ -0,0 +1,169 @@ +//:://///////////////////////////////////////////// +//:: Sunburst +//:: X0_S0_Sunburst +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* +// Brilliant globe of heat +// All creatures in the globe are blinded and +// take 6d6 damage +// Undead creatures take 1d6 damage (max 25d6) +// The blindness is permanent unless cast to remove it +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 23 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs May 14, 2003 +//:: Notes: Changed damage to non-undead to 6d6 +//:: 2003-10-09: GZ Added Subrace check for vampire special case, bugfix + + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + +#include "prc_add_spell_dc" + +float nSize = RADIUS_SIZE_COLOSSAL; + + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + object oCaster = OBJECT_SELF; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + int nCasterLvl = CasterLvl; + int nMetaMagic = PRCGetMetaMagicFeat(); + int nDamage = 0; + float fDelay; + effect eExplode = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY); + effect eHitVis = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE); + effect eLOS = EffectVisualEffect(VFX_FNF_LOS_HOLY_30); + effect eDam; + //Get the spell target location as opposed to the spell target. + location lTarget = PRCGetSpellTargetLocation(); + //Limit Caster level for the purposes of damage + if (nCasterLvl > 60) + { + nCasterLvl = 60; + } + int nPenetr = CasterLvl + SPGetPenetr(); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eLOS, PRCGetSpellTargetLocation()); + int bDoNotDoDamage = FALSE; + + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, nSize, lTarget, TRUE, OBJECT_TYPE_CREATURE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SUNBURST)); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHitVis, oTarget); + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,nPenetr, fDelay)) + { + if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + //Roll damage for each target + nDamage = PRCMaximizeOrEmpower(6, nPenetr, nMetaMagic); + } + else + { + nDamage = PRCMaximizeOrEmpower(6, nCasterLvl/2, nMetaMagic); + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + + // * if a vampire then destroy it + if (GetAppearanceType(oTarget) == APPEARANCE_TYPE_VAMPIRE_MALE || GetAppearanceType(oTarget) == APPEARANCE_TYPE_VAMPIRE_FEMALE || GetStringLowerCase(GetSubRace(oTarget)) == "vampire" ) + { + // SpeakString("I vampire"); + // * if reflex saving throw fails no blindness + if (!ReflexSave(oTarget, (nDC), SAVING_THROW_TYPE_SPELL)) + { + effect eDead = PRCEffectDamage(oTarget, GetCurrentHitPoints(oTarget)); + //SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), oTarget); + + //Apply epicenter explosion on caster + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eExplode, oTarget); + + DelayCommand(0.5, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDead, oTarget)); + bDoNotDoDamage = TRUE; + } + } + if (bDoNotDoDamage == FALSE) + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_SPELL); + + // * Do damage + if ((nDamage > 0) && (bDoNotDoDamage == FALSE)) + { + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL); + + // Apply effects to the currently selected target. + DelayCommand(0.01, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + + + + // * if reflex saving throw fails apply blindness + if (!ReflexSave(oTarget, PRCGetSaveDC(oTarget, OBJECT_SELF), SAVING_THROW_TYPE_SPELL)) + { + effect eBlindness = EffectBlindness(); + SPApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlindness, oTarget,0.0f,TRUE,-1,CasterLvl); + } + + } // nDamage > 0 + } + + //----------------------------------------------------------------- + // GZ: Bugfix, reenable damage for next object + //----------------------------------------------------------------- + bDoNotDoDamage = FALSE; + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, nSize, lTarget, TRUE, OBJECT_TYPE_CREATURE); + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + + + + + diff --git a/35expandedspells/x2_s0_acidbrth.ncs b/35expandedspells/x2_s0_acidbrth.ncs new file mode 100644 index 00000000..83901fb4 Binary files /dev/null and b/35expandedspells/x2_s0_acidbrth.ncs differ diff --git a/35expandedspells/x2_s0_acidbrth.nss b/35expandedspells/x2_s0_acidbrth.nss new file mode 100644 index 00000000..7b726b73 --- /dev/null +++ b/35expandedspells/x2_s0_acidbrth.nss @@ -0,0 +1,88 @@ +//:://///////////////////////////////////////////// +//:: Mestil's Acid Breath +//:: X2_S0_AcidBrth +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// You breathe forth a cone of acidic droplets. The +// cone inflicts 1d6 points of acid damage per caster +// level (maximum 10d6). +*/ +//::////////////////////////////////////////////// +//:: Created By: Andrew Nobbs +//:: Created On: Nov, 22 2002 +//::////////////////////////////////////////////// +//float SpellDelay (object oTarget, int nShape); +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTargetLocation = PRCGetSpellTargetLocation(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLevel + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ACID); + int nSaveType = ChangedSaveType(EleDmg); + int nDamage; + float fDelay; + + //Limit Caster level for the purposes of damage. + if(nCasterLevel > 20) + nCasterLevel = 20; + + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = MyFirstObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + //Cycle through the targets within the spell shape until an invalid object is captured. + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster) && oTarget != oCaster) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MESTILS_ACID_BREATH)); + //Get the distance between the target and caster to delay the application of effects + fDelay = GetDistanceBetween(oCaster, oTarget)/20.0; + //Make SR check, and appropriate saving throw(s). + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay)) + { + //Detemine damage + nDamage = d6(nCasterLevel); + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nCasterLevel;//Damage is at max + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage = nDamage + (nDamage/2); //Damage/Healing is +50% + // Acid Sheath adds +1 damage per die to acid descriptor spells + if (GetHasDescriptor(GetSpellId(), DESCRIPTOR_ACID) && GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH, oCaster)) + nDamage += nCasterLevel; + + int nDC = PRCGetSaveDC(oTarget, oCaster); + + //Adjust damage according to Reflex Save, Evasion or Improved Evasion + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType); + + if(nDamage > 0) + { + // Apply effects to the currently selected target. + effect eAcid = PRCEffectDamage(oTarget, nDamage, EleDmg); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_L); + + //Apply delayed effects + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eAcid, oTarget)); + PRCBonusDamage(oTarget); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPELLCONE, 11.0, lTargetLocation, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_acidshth.ncs b/35expandedspells/x2_s0_acidshth.ncs new file mode 100644 index 00000000..90ea136c Binary files /dev/null and b/35expandedspells/x2_s0_acidshth.ncs differ diff --git a/35expandedspells/x2_s0_acidshth.nss b/35expandedspells/x2_s0_acidshth.nss new file mode 100644 index 00000000..8f056328 --- /dev/null +++ b/35expandedspells/x2_s0_acidshth.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Mestil's Acid Sheath +//:: X2_S0_AcidShth +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This spell creates an acid shield around your + person. Any creature striking you with its body + does normal damage, but at the same time the + attacker takes 1d6 points +2 points per caster + level of acid damage. Weapons with exceptional + reach do not endanger thier uses in this way. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Jan 7, 2002 +//:: 2003-07-07: Stacking Spell Pass, Georg Zoeller +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); +/* + Spellcast Hook Code + Added 2003-07-07 by Georg Zoeller + 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 + effect eVis = EffectVisualEffect(448); + int nDuration = PRCGetCasterLevel(OBJECT_SELF); + int nDamage = min(nDuration * 2, 40); + int nMetaMagic = PRCGetMetaMagicFeat(); + object oTarget = OBJECT_SELF; + effect eShield = EffectDamageShield(nDamage, 0, ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ACID)); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + //Link effects + effect eLink = EffectLinkEffects(eShield, eDur); + eLink = EffectLinkEffects(eLink, eVis); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE)); + + //Enter Metamagic conditions + if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) + { + nDuration = nDuration *2; //Duration is +100% + } + + // 2003-07-07: Stacking Spell Pass, Georg + PRCRemoveEffectsFromSpell(oTarget, GetSpellId()); + + //Apply the VFX impact and effects + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + diff --git a/35expandedspells/x2_s0_balllghtng.ncs b/35expandedspells/x2_s0_balllghtng.ncs new file mode 100644 index 00000000..306fcf70 Binary files /dev/null and b/35expandedspells/x2_s0_balllghtng.ncs differ diff --git a/35expandedspells/x2_s0_balllghtng.nss b/35expandedspells/x2_s0_balllghtng.nss new file mode 100644 index 00000000..c43a23cb --- /dev/null +++ b/35expandedspells/x2_s0_balllghtng.nss @@ -0,0 +1,45 @@ +//:://///////////////////////////////////////////// +//:: Isaacs Lesser Missile Storm +//:: x0_s0_MissStorm1 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Up to 10 missiles, each doing 1d6 damage to all + targets in area. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 31, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: + +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff +#include "spinc_bolt" +#include "prc_add_spell_dc" +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + /* + Spellcast Hook Code + Added 2003-06-20 by Georg + 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 + + //SpawnScriptDebugger(); 503 + PRCDoMissileStorm(1, 40, GetSpellId(), 503,VFX_IMP_LIGHTNING_S ,ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ELECTRICAL)); + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} diff --git a/35expandedspells/x2_s0_combust.ncs b/35expandedspells/x2_s0_combust.ncs new file mode 100644 index 00000000..bdb6309d Binary files /dev/null and b/35expandedspells/x2_s0_combust.ncs differ diff --git a/35expandedspells/x2_s0_combust.nss b/35expandedspells/x2_s0_combust.nss new file mode 100644 index 00000000..cdc22878 --- /dev/null +++ b/35expandedspells/x2_s0_combust.nss @@ -0,0 +1,145 @@ +/* + x2_s0_combust + + The initial eruption of flame causes 2d6 fire damage +1 + point per caster level(maximum +10) + with no saving throw. + + Further, the creature must make + a Reflex save or catch fire taking a further 1d6 points + of damage. This will continue until the Reflex save is + made. + + There is an undocumented artificial limit of + 10 + casterlevel rounds on this spell to prevent + it from running indefinitly when used against + fire resistant creatures with bad saving throws + + By: Georg Zoeller + Created: 2003/09/05 + Modified: Jun 30, 2006 +*/ + +#include "prc_sp_func" +#include "x2_inc_toollib" +#include "prc_add_spell_dc" +void RunCombustImpact(object oTarget, object oCaster, int nLevel, int nMetaMagic,int EleDmg) +{ + if (PRCGetDelayedSpellEffectsExpired(SPELL_COMBUST,oTarget,oCaster)) return; + + if (GetIsDead(oTarget) == FALSE) + { + int nDC = GetLocalInt(oTarget,"XP2_L_SPELL_SAVE_DC_" + IntToString (SPELL_COMBUST)); + if(!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_FIRE)) + { + int nDamageLimit = nLevel; + if (nDamageLimit > 20) nDamageLimit = 20; + int nDamage = nDamageLimit + d6(); + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nDamageLimit + 6; + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + (nDamage/2); + } + + effect eDmg = PRCEffectDamage(oTarget, nDamage,EleDmg); + effect eVFX = EffectVisualEffect(VFX_IMP_FLAME_S); + + SPApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX,oTarget); + + DelayCommand(6.0f,RunCombustImpact(oTarget,oCaster, nLevel,nMetaMagic,EleDmg)); + } + else + { + DeleteLocalInt(oTarget,"XP2_L_SPELL_SAVE_DC_" + IntToString (SPELL_COMBUST)); + GZPRCRemoveSpellEffects(SPELL_COMBUST, oTarget); + } + } +} + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nDC = (PRCGetSaveDC(oTarget,oCaster)); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_FIRE); + int nDamageLimit = nCasterLevel; + if (nDamageLimit > 20) + { + nDamageLimit = 20; + } + int nDamage = nDamageLimit + d6(2); + int nMetaMagic = PRCGetMetaMagicFeat(); + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDamage = nDamageLimit + 12;//Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDamage += nDamage / 2;//Damage/Healing is +50% + } + //nDamage += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + int nDuration = 10 + nCasterLevel; + if (nDuration < 1) + { + nDuration = 10; + } + effect eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + effect eDur = EffectVisualEffect(498); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_COMBUST)); + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,nCasterLevel+SPGetPenetr())) + { + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + TLVFXPillar(VFX_IMP_FLAME_M, GetLocation(oTarget), 5, 0.1f,0.0f, 2.0f); + if (GetHasSpellEffect(GetSpellId(),oTarget) || GetHasSpellEffect(SPELL_INFERNO,oTarget) ) + { + FloatingTextStrRefOnCreature(100775,oCaster,FALSE); + return TRUE; + } + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oTarget, RoundsToSeconds(nDuration)); + SetLocalInt(oTarget,"XP2_L_SPELL_SAVE_DC_" + IntToString (SPELL_COMBUST), nDC); + DelayCommand(6.0, RunCombustImpact(oTarget,oCaster,nCasterLevel, nMetaMagic,EleDmg)); + } + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + object oCaster = OBJECT_SELF; + int nCasterLevel = PRCGetCasterLevel(oCaster); + PRCSetSchool(GetSpellSchool(PRCGetSpellId())); + if (!X2PreSpellCastCode()) return; + object oTarget = PRCGetSpellTargetObject(); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_crumble.ncs b/35expandedspells/x2_s0_crumble.ncs new file mode 100644 index 00000000..787a53d0 Binary files /dev/null and b/35expandedspells/x2_s0_crumble.ncs differ diff --git a/35expandedspells/x2_s0_crumble.nss b/35expandedspells/x2_s0_crumble.nss new file mode 100644 index 00000000..24895a8a --- /dev/null +++ b/35expandedspells/x2_s0_crumble.nss @@ -0,0 +1,123 @@ +//:://///////////////////////////////////////////// +//:: Crumble +//:: X2_S0_Crumble +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// This spell inflicts 1d6 points of damage per +// caster level to Constructs to a maximum of 15d6. +// This spell does not affect living creatures. +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: Oct 2003/ +//::////////////////////////////////////////////// +// +// 2/25/2004 - bleedingedge - Removed SR check per bioware 1.62 change. +// +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + +#include "prc_alterations" +#include "prc_add_spell_dc" + + +void DoCrumble (int nDam, object oCaster, object oTarget); + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION); + + /* + Spellcast Hook Code + Added 2003-07-07 by Georg Zoeller + 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 + + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLvl =PRCGetCasterLevel(oCaster); + int nType = GetObjectType(oTarget); + int nRacial = MyPRCGetRacialType(oTarget); + int nMetaMagic = PRCGetMetaMagicFeat(); + + //Minimum caster level of 1, maximum of 15. + if(nCasterLvl == 0) + { + nCasterLvl = 1; + } + else if (nCasterLvl > 40) + { + nCasterLvl = 40; + } + + SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId())); + effect eCrumb = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCrumb, oTarget); + + if (nType != OBJECT_TYPE_CREATURE && nType != OBJECT_TYPE_PLACEABLE && nType != OBJECT_TYPE_DOOR ) + { + return; + } + + if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_CONSTRUCT && GetLevelByClass(CLASS_TYPE_CONSTRUCT,oTarget) == 0) + { + return; + } + + int nDam = d6(nCasterLvl); + + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 6*nCasterLvl; + } + + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; + } + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + + if (nDam>0) + { + //---------------------------------------------------------------------- + // * Sever the tie between spellId and effect, allowing it to + // * bypass any magic resistance + //---------------------------------------------------------------------- + DelayCommand(0.1f,DoCrumble(nDam, oCaster, oTarget)); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + +//------------------------------------------------------------------------------ +// This part is moved into a delayed function in order to alllow it to bypass +// Golem Spell Immunity. Magic works by rendering all effects applied +// from within a spellscript useless. Delaying the creation and application of +// an effect causes it to loose it's SpellId, making it possible to ignore +// Magic Immunity. Hacktastic! +//------------------------------------------------------------------------------ +void DoCrumble (int nDam, object oCaster, object oTarget) +{ + float fDist = GetDistanceBetween(oCaster, oTarget); + float fDelay = fDist/(3.0 * log(fDist) + 2.0); + effect eDam = PRCEffectDamage(oTarget, nDam, ChangedElementalDamage(oCaster, DAMAGE_TYPE_SONIC)); + effect eMissile = EffectVisualEffect(477); + effect eCrumb = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE); + effect eVis = EffectVisualEffect(135); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eCrumb, oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + DelayCommand(0.5f, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget)); +} diff --git a/35expandedspells/x2_s0_cureother.ncs b/35expandedspells/x2_s0_cureother.ncs new file mode 100644 index 00000000..b661669b Binary files /dev/null and b/35expandedspells/x2_s0_cureother.ncs differ diff --git a/35expandedspells/x2_s0_cureother.nss b/35expandedspells/x2_s0_cureother.nss new file mode 100644 index 00000000..fc16a633 --- /dev/null +++ b/35expandedspells/x2_s0_cureother.nss @@ -0,0 +1,135 @@ +//:://///////////////////////////////////////////// +//:: x2_s0_cureother +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Cure Critical Wounds on Others - causes 5 points + of damage to the spell caster as well. +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: Jan 2/03 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_sp_tch" +#include "prc_inc_function" +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_CONJURATION); + + /* + Spellcast Hook Code + Added 2003-07-07 by Georg Zoeller + 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 + object oTarget = PRCGetSpellTargetObject(); + int nHeal; + int nDamage = d8(4); + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM); + effect eHeal, eDam; + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nExtraDamage = CasterLvl; // * figure out the bonus damage + if (nExtraDamage > 40) + { + nExtraDamage = 40; + } + // * if low or normal difficulty is treated as MAXIMIZED + if(GetIsPC(oTarget) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES) + { + nDamage = 32 + nExtraDamage; + } + else + { + nDamage = nDamage + nExtraDamage; + } + + CasterLvl +=SPGetPenetr(); + //Make metamagic checks + int iBlastFaith = BlastInfidelOrFaithHeal(OBJECT_SELF, oTarget, DAMAGE_TYPE_POSITIVE, TRUE); + if ((nMetaMagic & METAMAGIC_MAXIMIZE) || iBlastFaith) + { + nDamage = 32 + nExtraDamage; + // * if low or normal difficulty then MAXMIZED is doubled. + if(GetIsPC(OBJECT_SELF) && GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES) + { + nDamage = nDamage + nExtraDamage; + } + } + if (nMetaMagic & METAMAGIC_EMPOWER) + { + nDamage = nDamage + (nDamage/2); + } + + + if (MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD + && !(GetHasFeat(FEAT_TOMB_TAINTED_SOUL, oTarget) && GetAlignmentGoodEvil(oTarget) != ALIGNMENT_GOOD)) + { + if (oTarget != OBJECT_SELF) + { + //Figure out the amount of damage to heal + nHeal = nDamage; + //Set the heal effect + eHeal = PRCEffectHeal(nHeal, oTarget); + //Apply heal effect and VFX impact + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + + //Apply Damage Effect to the Caster + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, 5), OBJECT_SELF); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 31, FALSE)); + } + + } + //Check that the target is undead + else + { + int nTouch = PRCDoMeleeTouchAttack(oTarget);; + if (nTouch > 0) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 31)); + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl)) + { + eDam = PRCEffectDamage(oTarget, nDamage,DAMAGE_TYPE_NEGATIVE); + //Apply the VFX impact and effects + DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } + //Apply Damage Effect to the Caster + SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectDamage(oTarget, 5), OBJECT_SELF); + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} + + + + diff --git a/35expandedspells/x2_s0_dtharm.ncs b/35expandedspells/x2_s0_dtharm.ncs new file mode 100644 index 00000000..48a78217 Binary files /dev/null and b/35expandedspells/x2_s0_dtharm.ncs differ diff --git a/35expandedspells/x2_s0_dtharm.nss b/35expandedspells/x2_s0_dtharm.nss new file mode 100644 index 00000000..aa563e3e --- /dev/null +++ b/35expandedspells/x2_s0_dtharm.nss @@ -0,0 +1,54 @@ +//:://///////////////////////////////////////////// +//:: Death Armor +//:: X2_S0_DthArm +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + You are surrounded with a magical aura that injures + creatures that contact it. Any creature striking + you with its body or handheld weapon takes 1d4 points + of damage +1 point per 2 caster levels (maximum +5). +*/ +//::////////////////////////////////////////////// +//:: Created By: Andrew Nobbs +//:: Created On: Jan 6, 2003 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs, 02/06/2003 +//:: 2003-07-07: Stacking Spell Pass, Georg Zoeller + +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +//#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + + int nDuration = PRCGetCasterLevel(oCaster); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nCasterLvl = nDuration/2; + if(nCasterLvl > 20) + nCasterLvl = 20; + + effect eLink = EffectDamageShield(nCasterLvl, DAMAGE_BONUS_1d4, DAMAGE_TYPE_MAGICAL); + eLink = EffectLinkEffects(eLink, EffectVisualEffect(463)); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_DEATH_ARMOR, FALSE)); + + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_EXTEND) + nDuration *= 2; + + //Stacking Spellpass, 2003-07-07, Georg + PRCRemoveEffectsFromSpell(oTarget, SPELL_DEATH_ARMOR); + + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_elecloop.ncs b/35expandedspells/x2_s0_elecloop.ncs new file mode 100644 index 00000000..764f4b45 Binary files /dev/null and b/35expandedspells/x2_s0_elecloop.ncs differ diff --git a/35expandedspells/x2_s0_elecloop.nss b/35expandedspells/x2_s0_elecloop.nss new file mode 100644 index 00000000..3523aff1 --- /dev/null +++ b/35expandedspells/x2_s0_elecloop.nss @@ -0,0 +1,163 @@ +//:://///////////////////////////////////////////// +//:: Gedlee's Electric Loop +//:: X2_S0_ElecLoop +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + You create a small stroke of lightning that + cycles through all creatures in the area of effect. + The spell deals 1d6 points of damage per 2 caster + levels (maximum 5d6). Those who fail their Reflex + saves must succeed at a Will save or be stunned + for 1 round. + + Spell is standard hostile, so if you use it + in hardcore mode, it will zap yourself! + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: Oct 19 2003 +//::////////////////////////////////////////////// + +//:: modified by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + + +#include "prc_add_spell_dc" + + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); + + //-------------------------------------------------------------------------- + // Spellcast Hook Code + // Added 2003-06-20 by Georg + // If you want to make changes to all spells, check x2_inc_spellhook.nss to + // find out more + //-------------------------------------------------------------------------- + if (!X2PreSpellCastCode()) + { + return; + } + // End of Spell Cast Hook + + + location lTarget = PRCGetSpellTargetLocation(); + effect eStrike = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + int nMetaMagic = PRCGetMetaMagicFeat(); + float fDelay; + effect eBeam; + int nDamage; + int nPotential; + effect eDam; + object oLastValid; + effect eStun = EffectLinkEffects(EffectVisualEffect(VFX_IMP_STUN),EffectStunned()); + + //-------------------------------------------------------------------------- + // Calculate Damage Dice. 1d per 2 caster levels, max 5d + //-------------------------------------------------------------------------- + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + + + int EleDmg = ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_ELECTRICAL); + + int nNumDice = CasterLvl/2; + if (nNumDice<1) + { + nNumDice = 1; + } + else if (nNumDice >20) + { + nNumDice = 20; + } + + CasterLvl +=SPGetPenetr(); + + //-------------------------------------------------------------------------- + // Loop through all targets + //-------------------------------------------------------------------------- + + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oTarget)) + { + if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, PRCGetSpellId())); + + //------------------------------------------------------------------ + // Calculate delay until spell hits current target. If we are the + // first target, the delay is the time until the spell hits us + //------------------------------------------------------------------ + if (GetIsObjectValid(oLastValid)) + { + fDelay += 0.2f; + fDelay += GetDistanceBetweenLocations(GetLocation(oLastValid), GetLocation(oTarget))/20; + } + else + { + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + } + + //------------------------------------------------------------------ + // If there was a previous target, draw a lightning beam between us + // and iterate delay so it appears that the beam is jumping from + // target to target + //------------------------------------------------------------------ + if (GetIsObjectValid(oLastValid)) + { + eBeam = EffectBeam(VFX_BEAM_LIGHTNING, oLastValid, BODY_NODE_CHEST); + DelayCommand(fDelay,SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam,oTarget,1.5f)); + } + + if (!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl, fDelay)) + { + + int nDC = PRCGetSaveDC(oTarget,OBJECT_SELF); + nPotential = PRCMaximizeOrEmpower(6, nNumDice, nMetaMagic); + //nPotential += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF); + nDamage = PRCGetReflexAdjustedDamage(nPotential, oTarget, (nDC), SAVING_THROW_TYPE_ELECTRICITY); + + //-------------------------------------------------------------- + // If we failed the reflex save, we save vs will or are stunned + // for one round + //-------------------------------------------------------------- + if (nPotential == nDamage || (GetHasFeat(FEAT_IMPROVED_EVASION,oTarget) && nDamage == (nPotential/2))) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (nDC), SAVING_THROW_TYPE_MIND_SPELLS, OBJECT_SELF, fDelay)) + { + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun,oTarget, RoundsToSeconds(1))); + } + + } + + + if (nDamage >0) + { + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + PRCBonusDamage(oTarget); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eStrike, oTarget)); + } + } + + //------------------------------------------------------------------ + // Store Target to make it appear that the lightning bolt is jumping + // from target to target + //------------------------------------------------------------------ + oLastValid = oTarget; + + } + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, TRUE, OBJECT_TYPE_CREATURE ); + } + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school + +} + + diff --git a/35expandedspells/x2_s0_horiboom.ncs b/35expandedspells/x2_s0_horiboom.ncs new file mode 100644 index 00000000..1ddcc6de Binary files /dev/null and b/35expandedspells/x2_s0_horiboom.ncs differ diff --git a/35expandedspells/x2_s0_horiboom.nss b/35expandedspells/x2_s0_horiboom.nss new file mode 100644 index 00000000..c368f6a2 --- /dev/null +++ b/35expandedspells/x2_s0_horiboom.nss @@ -0,0 +1,115 @@ +//:://///////////////////////////////////////////// +//:: Horizikaul's Boom +//:: X2_S0_HoriBoom +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// You blast the target with loud and high-pitched +// sounds. The target takes 1d4 points of sonic +// damage per two caster levels (maximum 5d4) and +// must make a Will save or be deafened for 1d4 +// rounds. +*/ +//::////////////////////////////////////////////// +//:: Created By: Andrew Nobbs +//:: Created On: Nov 22, 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs, 02/06/2003 + + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" + + + +#include "prc_add_spell_dc" + +void main() +{ +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_EVOCATION); +/* + Spellcast Hook Code + Added 2003-07-07 by Georg Zoeller + 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 ( fDist / (3.0f * log( fDist ) + 2.0f) ) + object oTarget = PRCGetSpellTargetObject(); + int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); + + int nCasterLvl = CasterLvl/2; + int nRounds = d4(1); + int nMetaMagic = PRCGetMetaMagicFeat(); + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + effect eDeaf = EffectDeaf(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDeaf, eDur); + + //Minimum caster level of 1, maximum of 15. + if(nCasterLvl == 0) + { + nCasterLvl = 1; + } + else if (nCasterLvl > 20) + { + nCasterLvl = 20; + } + + CasterLvl +=SPGetPenetr(); + + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) + { + if(!PRCDoResistSpell(OBJECT_SELF, oTarget,CasterLvl)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_HORIZIKAULS_BOOM)); + //Roll damage + int nDam = d4(nCasterLvl); + //Enter Metamagic conditions + if ((nMetaMagic & METAMAGIC_MAXIMIZE)) + { + nDam = 4 * nCasterLvl; //Damage is at max + } + if ((nMetaMagic & METAMAGIC_EMPOWER)) + { + nDam = nDam + nDam/2; //Damage/Healing is +50% + } + if(nMetaMagic & METAMAGIC_EXTEND) + { + nRounds *= 2; + } + //nDam += ApplySpellBetrayalStrikeDamage(oTarget, OBJECT_SELF, FALSE); + //Set damage effect + effect eDam = PRCEffectDamage(oTarget, nDam, ChangedElementalDamage(OBJECT_SELF, DAMAGE_TYPE_SONIC)); + //Apply the MIRV and damage effect + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); + PRCBonusDamage(oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Should not work on creatures already deafened or silenced + if(!PRCGetHasEffect(EFFECT_TYPE_DEAF, oTarget) && !PRCGetHasEffect(EFFECT_TYPE_SILENCE, oTarget)) + { + if(!PRCMySavingThrow(SAVING_THROW_WILL, oTarget, (PRCGetSaveDC(oTarget,OBJECT_SELF)), SAVING_THROW_TYPE_MIND_SPELLS)) + { + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDeaf, oTarget, RoundsToSeconds(nRounds)); + } + } + } + } + + +DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); +// Erasing the variable used to store the spell's spell school +} diff --git a/35expandedspells/x2_s0_icedagg.ncs b/35expandedspells/x2_s0_icedagg.ncs new file mode 100644 index 00000000..5a8f98bb Binary files /dev/null and b/35expandedspells/x2_s0_icedagg.ncs differ diff --git a/35expandedspells/x2_s0_icedagg.nss b/35expandedspells/x2_s0_icedagg.nss new file mode 100644 index 00000000..24f61152 --- /dev/null +++ b/35expandedspells/x2_s0_icedagg.nss @@ -0,0 +1,74 @@ +//:://///////////////////////////////////////////// +//:: Ice Dagger +//:: X2_S0_IceDagg +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// You create a dagger shapped piece of ice that +// flies toward the target and deals 1d4 points of +// cold damage per level (maximum od 5d4) +*/ +//::////////////////////////////////////////////// +//:: Created By: Andrew Nobbs +//:: Created On: Nov 25 , 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs, 02/06/2003 +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_sp_tch" +#include "prc_add_spell_dc" + +void main() +{ + if (!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_CONJURATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nDice = min(nCasterLvl, 20); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_COLD); + int nSaveType = ChangedSaveType(EleDmg); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + + if(!GetIsReactionTypeFriendly(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_ICE_DAGGER)); + //Get the distance between the explosion and the target to calculate delay + float fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + + int iAttackRoll = PRCDoRangedTouchAttack(oTarget); + if(iAttackRoll > 0) + { + if(!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay)) + { + //Roll damage for each target + int nDamage = d4(nDice); + //Resolve metamagic + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 4 * nDice; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage / 2; + + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget, oCaster)), nSaveType); + + if(nDamage) + { + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + + ApplyTouchAttackDamage(oCaster, oTarget, iAttackRoll, nDamage, EleDmg); + PRCBonusDamage(oTarget); + } + } + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_magcvest.ncs b/35expandedspells/x2_s0_magcvest.ncs new file mode 100644 index 00000000..bd748ed6 Binary files /dev/null and b/35expandedspells/x2_s0_magcvest.ncs differ diff --git a/35expandedspells/x2_s0_magcvest.nss b/35expandedspells/x2_s0_magcvest.nss new file mode 100644 index 00000000..e8cae0d0 --- /dev/null +++ b/35expandedspells/x2_s0_magcvest.nss @@ -0,0 +1,81 @@ +/* + x2_s0_magcvest + + Grants a +1 AC bonus to armor touched per 3 caster + levels (maximum of +5). + + By: Andrew Nobbs + Created: Nov 28, 2002 + Modified: Jun 30, 2006 +*/ +#include "prc_sp_func" + +//Implements the spell impact, put code here +// if called in many places, return TRUE if +// stored charges should be decreased +// eg. touch attack hits +// +// Variables passed may be changed if necessary +int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent) +{ + int nAmount = nCasterLevel/3; + if(nAmount < 1) + nAmount = 1; + else if(nAmount > 21) + nAmount = 21; + + float fDuration = HoursToSeconds(nCasterLevel); + int nMetaMagic = PRCGetMetaMagicFeat(); + if(nMetaMagic & METAMAGIC_EXTEND) + fDuration *= 2; //Duration is +100% + + effect eVis = EffectVisualEffect(VFX_IMP_GLOBE_USE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + object oMyArmor = IPGetTargetedOrEquippedArmor(TRUE); + if(GetIsObjectValid(oMyArmor)) + { + if(oTarget == oMyArmor) + oTarget = GetItemPossessor(oMyArmor); + + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_MAGIC_VESTMENT, FALSE)); + + DelayCommand(1.3f, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oTarget, fDuration); + IPSafeAddItemProperty(oMyArmor, ItemPropertyACBonus(nAmount), fDuration, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, TRUE); + } + else + { + FloatingTextStrRefOnCreature(83826, oCaster, FALSE); + } + + return TRUE; //return TRUE if spell charges should be decremented +} + +void main() +{ + if (!X2PreSpellCastCode()) return; + PRCSetSchool(SPELL_SCHOOL_TRANSMUTATION); + object oCaster = OBJECT_SELF; + object oTarget = PRCGetSpellTargetObject(); + int nCasterLevel = PRCGetCasterLevel(oCaster); + int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags + if(!nEvent) //normal cast + { + if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget) + { //holding the charge, casting spell on self + SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges + return; + } + DoSpell(oCaster, oTarget, nCasterLevel, nEvent); + } + else + { + if(nEvent & PRC_SPELL_EVENT_ATTACK) + { + if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent)) + DecrementSpellCharges(oCaster); + } + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_scntsphere.ncs b/35expandedspells/x2_s0_scntsphere.ncs new file mode 100644 index 00000000..213d29af Binary files /dev/null and b/35expandedspells/x2_s0_scntsphere.ncs differ diff --git a/35expandedspells/x2_s0_scntsphere.nss b/35expandedspells/x2_s0_scntsphere.nss new file mode 100644 index 00000000..242ca0c3 --- /dev/null +++ b/35expandedspells/x2_s0_scntsphere.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Scintillating Sphere +//:: X2_S0_ScntSphere +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// A scintillating sphere is a burst of electricity +// that detonates with a low roar and inflicts 1d6 +// points of damage per caster level (maximum of 10d6) +// to all creatures within the area. Unattended objects +// also take damage. The explosion creates almost no pressure. +*/ +//::////////////////////////////////////////////// +//:: Created By: Andrew Nobbs +//:: Created On: Nov 25 , 2002 +//::////////////////////////////////////////////// +//:: Last Updated By: Andrew Nobbs, 02/06/2003 +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void ApplyDamage(object oTarget, effect eDamage) +{ + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); + SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + PRCBonusDamage(oTarget); +} + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = PRCGetSpellTargetLocation(); + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int EleDmg = ChangedElementalDamage(oCaster, DAMAGE_TYPE_ELECTRICAL); + int nSaveType = ChangedSaveType(EleDmg); + int nDamage; + float fDelay; + effect eDam; + + //Limit Caster level for the purposes of damage + if (nCasterLvl > 20) + nCasterLvl = 20; + + //Apply the fireball explosion at the location captured above. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_ELECTRIC_EXPLOSION), lTarget); + + //Cycle through the targets within the spell shape until an invalid object is captured. + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + while(GetIsObjectValid(oTarget)) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_SCINTILLATING_SPHERE)); + + if (!PRCDoResistSpell(oCaster, oTarget, nPenetr, fDelay)) + { + //Roll damage for each target + nDamage = d6(nCasterLvl); + //Resolve metamagic + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nDamage = 6 * nCasterLvl; + if(nMetaMagic & METAMAGIC_EMPOWER) + nDamage += nDamage / 2; + + int nDC = PRCGetSaveDC(oTarget, oCaster); + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, nDC, nSaveType); + + if(nDamage > 0) + { + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + //Set the damage effect + eDam = PRCEffectDamage(oTarget, nDamage, EleDmg); + // Apply effects to the currently selected target. + DelayCommand(fDelay, ApplyDamage(oTarget, eDam)); + } + } + } + //Select the next target within the spell shape. + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_tidebattle.ncs b/35expandedspells/x2_s0_tidebattle.ncs new file mode 100644 index 00000000..3a857df8 Binary files /dev/null and b/35expandedspells/x2_s0_tidebattle.ncs differ diff --git a/35expandedspells/x2_s0_tidebattle.nss b/35expandedspells/x2_s0_tidebattle.nss new file mode 100644 index 00000000..90d84fed --- /dev/null +++ b/35expandedspells/x2_s0_tidebattle.nss @@ -0,0 +1,64 @@ +//:://///////////////////////////////////////////// +//:: Tide of Battle +//:: x2_s0_TideBattle +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Uses spell effect to cause d100 damage to + all enemies and friends around pc, including pc. + (Area effect always centered on PC) + Minimum 30 points of damage will be done to each target +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: Jan 2/03 +//::////////////////////////////////////////////// +//:: Updated by: Andrew Nobbs +//:: Updated on: March 28, 2003 +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff +#include "prc_inc_spells" +#include "prc_add_spell_dc" + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_EVOCATION); + + //Declare major variables + object oCaster = OBJECT_SELF; + location lTarget = GetLocation(oCaster); +int nCasterLvl = PRCGetCasterLevel(oCaster); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH_WARD); + effect eVis2 = EffectVisualEffect(VFX_FNF_METEOR_SWARM); + effect eDamage; + effect eLink; + int nDamage; + float fDelay; + + //Apply Spell Effects + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis2, lTarget); + + //ApplyDamage and Effects to all targets in area + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget); + while(GetIsObjectValid(oTarget)) + { + fDelay = PRCGetRandomDelay(); + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, GetSpellId())); + nDamage = d100() + nCasterLvl; + if(nDamage < 60) + nDamage = 60; + + //Set damage type and amount + eDamage = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_DIVINE); + //Link visual and damage effects + eLink = EffectLinkEffects(eVis, eDamage); + //Apply effects to oTarget + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget)); + + //Get next target in shape + oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget); + } + PRCSetSchool(); +} \ No newline at end of file diff --git a/35expandedspells/x2_s0_undeath.ncs b/35expandedspells/x2_s0_undeath.ncs new file mode 100644 index 00000000..7a644a8b Binary files /dev/null and b/35expandedspells/x2_s0_undeath.ncs differ diff --git a/35expandedspells/x2_s0_undeath.nss b/35expandedspells/x2_s0_undeath.nss new file mode 100644 index 00000000..f7a2bbe8 --- /dev/null +++ b/35expandedspells/x2_s0_undeath.nss @@ -0,0 +1,135 @@ +//:://///////////////////////////////////////////// +//:: Undeath to Death +//:: x2_s0_undeath.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +Necromancy +Level: Clr 6, Sor/Wiz 6 +Components: V, S, M/DF +Area: Several undead creatures within + a 40-ft.-radius burst +Saving Throw: Will negates + +This spell functions like circle of death, except +that it destroys undead creatures as noted above. + +Material Component +The powder of a crushed diamond worth at least 500 gp. +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: August 13,2003 +//::////////////////////////////////////////////// + +//:: altered by mr_bumpkin Dec 4, 2003 for prc stuff + +#include "prc_inc_spells" +#include "prc_add_spell_dc" + + +//const int SRROR_CODE_5_FIX = 1; + +void DoUndeadToDeath(object oCreature, object oCaster, int nPenetr) +{ + SignalEvent(oCreature, EventSpellCastAt(oCaster, SPELL_UNDEATH_TO_DEATH)); + + SetLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD", TRUE); + + int nSaveDC = PRCGetSaveDC(oCreature, oCaster); + if(!PRCMySavingThrow(SAVING_THROW_WILL, oCreature, nSaveDC, SAVING_THROW_TYPE_NONE, oCaster)) + { + float fDelay = PRCGetRandomDelay(0.2f,0.4f); + if(!PRCDoResistSpell(oCaster, oCreature, nPenetr, fDelay)) + { + effect eDeath = PRCEffectDamage(oCreature, GetCurrentHitPoints(oCreature), DAMAGE_TYPE_DIVINE, DAMAGE_POWER_ENERGY); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + DelayCommand(fDelay+0.5f, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oCreature)); + DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCreature)); + } + else + { + DelayCommand(1.0f, DeleteLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD")); + } + } + else + { + DelayCommand(1.0f, DeleteLocalInt(oCreature,"X2_EBLIGHT_I_AM_DEAD")); + } +} + +void main() +{ + if(!X2PreSpellCastCode()) return; + + PRCSetSchool(SPELL_SCHOOL_NECROMANCY); + + // calculation + object oCaster = OBJECT_SELF; + int nCasterLvl = PRCGetCasterLevel(oCaster); + int nPenetr = nCasterLvl + SPGetPenetr(); + int nMetaMagic = PRCGetMetaMagicFeat(); + int nLevel = nCasterLvl > 40 ? 40 : nCasterLvl; + + // calculate number of hitdice affected + int nHDLeft = d4(nLevel); + //Enter Metamagic conditions + if(nMetaMagic & METAMAGIC_MAXIMIZE) + nHDLeft = 4 * nLevel;//Damage is at max + if(nMetaMagic & METAMAGIC_EMPOWER) + nHDLeft += (nHDLeft/2); //Damage/Healing is +50% + + // Impact VFX + location lLoc = PRCGetSpellTargetLocation(); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_STRIKE_HOLY),lLoc); + //TLVFXPillar(VFX_FNF_LOS_HOLY_20, lLoc, 3, 0.0f); + + // build list with affected creatures + int nLow = 9999; + object oLow; + int nCurHD; + object oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 20.0f, lLoc); + while(GetIsObjectValid(oTarget) && nHDLeft > 0) + { + if(MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + nCurHD = GetHitDice(oTarget); + if (nCurHD <= nHDLeft) + { + if(spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)) + { + // ignore creatures already affected + if(GetLocalInt(oTarget,"X2_EBLIGHT_I_AM_DEAD") == 0 && !GetPlotFlag(oTarget) && !GetIsDead(oTarget)) + { + // store the creature with the lowest HD + if(GetHitDice(oTarget) <= nLow) + { + nLow = GetHitDice(oTarget); + oLow = oTarget; + } + } + } + } + } + // Get next target + oTarget = MyNextObjectInShape(SHAPE_SPHERE, 20.0f ,lLoc); + + // End of cycle, time to kill the lowest creature + if(!GetIsObjectValid(oTarget)) + { + // we have a valid lowest creature we can affect with the remaining HD + if (GetIsObjectValid(oLow) && nHDLeft >= nLow) + { + DoUndeadToDeath(oLow, oCaster, nPenetr); + // decrement remaining HD + nHDLeft -= nLow; + // restart the loop + oTarget = MyFirstObjectInShape(SHAPE_SPHERE, 20.0f, lLoc); + } + // reset counters + oLow = OBJECT_INVALID; + nLow = 9999; + } + } + PRCSetSchool(); +} \ No newline at end of file