Spell Compendium Mod

Discussion in 'General Modification' started by Sagenlicht, Feb 28, 2021.

Remove all ads!
  1. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    I am working on adding spells from the WotC Sourcebook Spell Compendium.

    @anatoliy suggested to open a new threat for code review, I am happily doing so :)

    So here we go. First of all, I'd like to say thank you to @Sitra Achara as he helped me alot in understanding what I am actually doing and @_doug_ for the moment of prescience spell, it was a great starting point. Whoever did the Blackguard prestige class helped me to understand how to do the AoE spells.

    Before I start, I want to mention, that if you want to test the spells, you have to either
    a) delete the class021_assassin.py and the class022_blackguard.py from the overrides folder or
    b) you have manually add some lines to your own constants.py (located usually at C:\Users\[your user]\AppData\Local\TemplePlus\app-[current version]\tpdata\templeplus\lib\templeplus) or your game will crash! If you delete the files, both classes won't have access to the new spells, but nothing else changes.

    add the lines after: spell_waves_of_exhaustion = 1004

    spell_sound_lance = 1050
    spell_critical_strike = 1051
    spell_camouflage = 1052
    spell_appraising_touch = 1053
    spell_phantom_threat = 1054
    spell_distort_speech = 1055
    spell_distract = 1056
    spell_focusing_chant = 1057
    spell_heralds_call = 1058
    spell_improvisation = 1059
    spell_joyful_noise = 1060
    spell_inspirational_boost = 1061
    spell_invisibility_swift = 1062
    spell_ironguts = 1063
    spell_ironthunder_horn = 1064
    spell_insidious_rhythm = 1065
    spell_masters__touch = 1066
    spell_serene_visage = 1067
    spell_shock_and_awe = 1068
    spell_sticky_fingers = 1069
    spell_undersong = 1070
    spell_distract_assailant = 1071
    spell_insightfull_feint = 1072
    spell_lightfoot = 1073
    spell_snipers_shot = 1074
    spell_sonic_weapon = 1075
    spell_bonefiddle = 1076
    spell_cloud_of_bewilderment = 1077
    spell_curse_of_impending_blades = 1078
    spell_wave_of_grief = 1079
    spell_harmonic_chorus = 1080
    spell_iron_silence = 1081
    spell_war_cry = 1082
    spell_bladeweave = 1084
    spell_fell_the_greatest_foe = 1085
    spell_fire_shuriken = 1086
    spell_phantom_foe = 1087
    spell_veil_of_shadow = 1088
    spell_curse_of_impending_blades_mass = 1089
    spell_dissonant_chord = 1090
    spell_haunting_tune = 1091
    spell_loves_lament = 1092
    spell_ray_of_dizziness = 1093
    spell_wounding_whispers = 1094
    spell_dirge_of_discord = 1095
    spell_allegro = 1096
    spell_find_the_gap = 1097
    spell_wraithstrike = 1098
    spell_resonating_Bolt = 1099
    spell_resistance_greater = 1100
    spell_fugue = 1101
    spell_sirines_grace = 1102
    spell_dolorous_blow = 1103
    spell_bolts_of_bedevilment = 1104
    spell_cacophonic_burst = 1105
    spell_wail_of_doom = 1106
    spell_heart_ripper = 1107
    spell_dirge = 1108
    spell_nixies_grace = 1109
    spell_ray_of_light = 1110
    spell_resistance_superior = 1111
    spell_strategic_charge = 1112
    spell_blessed_aim = 1113
    spell_clear_mind = 1114
    spell_deafening_clang = 1115
    spell_faith_healing = 1118
    spell_summon_undead_i = 1119
    spell_angelskin = 1120
    spell_demonhide = 1121
    spell_summon_undead_ii = 1122
    spell_hand_of_divinity = 1123
    spell_curse_of_ill_fortune = 1124
    spell_awaken_sin = 1125
    spell_checkmates_light = 1126
    spell_cloak_of_bravery = 1127
    spell_divine_protection = 1128
    spell_quick_march = 1129
    spell_shield_of_warding = 1130
    spell_blessing_of_bahamut = 1131
    spell_diamondsteel = 1132
    spell_righteous_fury = 1133
    spell_undead_bane_weapon = 1134
    spell_weapon_of_the_deity = 1135
    spell_axiomatic_storm = 1136
    spell_holy_storm = 1137
    spell_unholy_storm = 1138
    spell_summon_undead_iii = 1139

    The goal of the mod is for a more diverse gameplay for spell caster classes (e.g. open up a melee or controller bard) and to offer modder some more spells to give players a tougher challenge (e.g Wave of Grief is a very strong spell for an Evil Cleric behind some mindless undead :))

    Some spells should be swift actions, they are not atm, but this might change soon as Sitra is working on a swift action implementaion for temple+. Speaking of Temple +, it is needed to work for those spells and once they are fully working I am happy to add them to temple+, so you do not have to manually download them to your overrides folder.

    I used and will use mainly already existing effects in the game as spell effects as I am limited in time (as we are all) and I am more interested in adding functionallity than a better look. But if anyone wants to change that feel free to post it here and I will add it :)

    In addition if you find any errors please let me know so I can fix them, and there will be errors as I am still learning how to do things in the best way.

    Ok so here is what I've done so far (now alphabetically sorted :) )
    Allegro
    Angelskin
    Appraising Touch
    Awaken Sin
    Axiomatic Storm
    Bladeweave
    Blessed Aim
    Blessing of Bahamut
    Bolts of Bedevilment
    Bonefiddle
    Cacophonic Burst
    Camouflage
    Checkmates Light
    Clear Mind
    Cloak of Bravery
    Cloud of Bewilderment
    Critical Strike
    Curse of Ill Fortune
    Curse of Imp. Blades, Mass
    Curse of Impending Blades
    Deafening Clang
    Demonhide
    Diamondsteel
    Dirge
    Dirge of Discord
    Dissonant Chord
    Distort Speech
    Distract
    Distract Assailant
    Divine Protection
    Dolorous Blow
    Faith Healing
    Fell the Greatest Foe
    Find the Gap
    Fire Shuriken
    Focusing Chant
    Fugue
    Grave Strike
    Hand of Divinity
    Harmonic Chorus
    Haunting Tune
    Heart Ripper
    Herald's Call
    Holy Storm
    Improvisation
    Insidious Rhythm
    Insightfull Feint
    Inspirational Boost
    Invisibility, Swift
    Iron Silence
    Ironguts
    Ironthunder Horn
    Joyful Noise
    Lightfoot
    Love's Lament
    Master's Touch
    Nixie's Grace
    Phantom Foe
    Phantom Threat
    Quick March
    Ray of Dizziness
    Ray of Light
    Resistance, Greater
    Resistance, Superior
    Resonating Bolt
    Righteous Fury
    Serene Visage
    Shield of Warding
    Shock and Awe
    Sirine's Grace
    Sniper's Shot
    Sonic Weapon
    Sound Lance
    Sticky Fingers
    Strategic Charge
    Summon Undead I
    Summon Undead II
    Summon Undead III
    Undead Bane Weapon
    Undersong
    Unholy Storm
    Veil of Shadow
    Wail of Doom
    War Cry
    Wave of Grief
    Weapon of the Deity
    Wounding Whispers
    Wraithstrike

    All spells come with a full help integration, which is also included, I also modifed the help.tab a little bit, so you can see the full spell list easily in the help.

    You can savely use the overrides.zip, I always used custom file names, so I do not overwrite anything existing. This includes all help.tab changes. The only exception to this is the damage.mes and the combat.mes. Please be careful with them, if you have custom version of those files. I also used Protos.tab ID 4998 for the spell Fire Shuriken. If this is a problem let me know.

    In addition I added now Hand of Divinity, which requires a modified deity.mes. I did this in a way, that if you use a modified deity.mes you can either skip my modified version or add the modification to yours, both will work with the spell.

    What spells are missing from the spell list I've already done?
    Bard 1: Inspirational Boost, Joyful Noise
    Bard 2: Whirling Blade
    Assassin 3: Fangs of the Vampire King, Spider Poison
    Bard 5: Bolts of Bedevilment
    Paladin 1: Grave Strike, Rhino's Charge, Bless Weapon Swift, Lionheart, Divine Sacrifice
    Paladin 3: Diamondsteel, Weapon of the Deity

    Latest Changes:
    Changes:
    Summon Undead II now allows to summon two level 1 skeletons or a single level 2 summon.

    Fixed:
    Improvisation has now correct Bonus Type (Luck),
    Redid Buff symbols, now they all link to the help file properly.

    Spells Added:
    Blessing of Bahamut
    Righteous Fury
    Undead Bane Weapon
    Axiomatic Storm
    Holy Storm
    Unholy Storm
    Summon Undead III

    Old, but might be of relevance if you did not do this yet:
    I have updated the help file structure, if you use an older version you either have to manually delete a file or remove the overrides folder entierly and use the new one. Do the latter one only if you do not use any other files than mine in your overrides folder!!! I think this will be the only time you ever have to do this, sorry about that.
    The file is: [your ToEE folder]\overrides\mes\help\help_assassin_spells.tab


    Known Bugs:
    Deafening Clank does not deafen, I have disabled that part in the script as it is not working.
    Please keep an eye on Fugue, if it behaves strange report it.
    Dirge visual too small


    Keep in mind, that this is a work in progress, I still learn new things even after having done 75+ spells now.
     

    Attached Files:

    Last edited: Apr 5, 2021
    August, Allyx, Pygmy and 2 others like this.
  2. Endarire

    Endarire Ronald Rynnwrathi

    Joined:
    Jan 7, 2004
    Messages:
    953
    Likes Received:
    112
    Alleluia and thankee!

    I'm still looking forward to inspirational boost and draconic polymorph!

    Will this mod also be compatible with/include Ted's domain spells mod and Bucket o' Spells?
     
  3. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    200
    Code:
    evt_obj.append("Veil of Shadow (" + str(args.get_arg(1)) + " round)")
    vs
    vs evt_obj.append("Veil of Shadow ({} round)".format(args.get_arg(1)))
    Just a hint - perhaps format would be more readable.

    Code:
    attachee.obj_set_int(obj_f_weapon_crit_range, (attachee.obj_get_int(obj_f_weapon_crit_range)*2))
    Have you considered ET_OnGetCriticalHitRange = 23?
    Moreover, isn't obj_f_weapon_crit_range applied to weapon only, e.g. "weapon" field?
     
  4. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    200
  5. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    200
    Code:
            weaponUsedForAttack = evt_obj.attack_packet.get_weapon_used()
            if args.get_arg(2) == weaponUsedForAttack.obj_get_int(obj_f_weapon_type): #check if weapon is still the weapon type Masters Gift was used for
    
    That could fail for natural weapon obviously.

    But these are some tiny issues. Overall - great job!!
     
    Sagenlicht likes this.
  6. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Bucket 'o spells should be no problem, I don't think Ted used any of my spell enums for his spells. I have not looked into his domain mod but I don't think this should interfere as well.
     
  7. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    I did invest more time in criticial strike than in every other spell due to the crit range issue. I dont think that there is solution atm to not have it stack with keen edge.
    Critical Strike expanded crit range should work only on weapons, I need to add a check there.
    The bonus damage should work on all melee attacks (I might have not range excluded there as well). Critical Strike was one of the first spells I did, I will have to revisit for sure.

    1) I thought this feels more modern, besides the game always floats a successful save.
    2) I will look into that, I am unhappy with my result as well.

    I will add a check for natural weapons to skip this altogether, you should be proficient with your natural weapons after all :) This being said, I will check where I missed to add such checks elsewhere as well.

    Thank you for taking your time to look into the code - much appreciated :)
     
    anatoliy likes this.
  8. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    The Domain spells mod doesn't add much in the way of news spells, just allows existing ones to be cast as Cleric domain spells.
     
  9. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    674
    Likes Received:
    71
    Thank you for the fantastic work. I have managed to confirm that Sniper's shot works perfectly with a shortbow, but it doesn't appear to work in identical conditions with a ranged touch attack (Melf's Acid Arrow). I cannot find any relevant exclusion in Spell Compendium. As someone with a long-standing Arcane Trickster obsession this is a cause of considerable distress! Please help!
     
  10. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Thanks for the report, I guess this is doomed to fail because I try to get the weapon damage type, which is of course not the case if you cast a ranged touch spell and have no weapon equipped. Correct me if I am wrong, but you had no weapon equipped right? Just to narrow down the error it should of course work with no weapon equipped.

    In either case my fault, I'm gonna fix it :)
     
  11. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    674
    Likes Received:
    71
    Thank you for your quick reply. Since my last post I had a look at your code and spotted the line referring to weapon damage. I have now tested a ranged touch spell with no weapon and with the caster armed with a longsword; in neither case was the Sniper's Shot successfully triggered.
     
  12. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Yeah unfortunaly I found the main error, it's tougher to fix than expected.

    ET_OnDealingDamage does not trigger on ranged touch attacks, only ET_OnDealingDamage2. @Sitra Achara is this a bug or not?

    Will do a workaround for now.

    EDIT: Attached is a modified sp_sniper_shot.py with a workaround. It will now work with ranged touch attacks though the damage added in those cases is unspecified for now. Copy it to overrides\scr\tpModifiers\.

    As the fix has to use ET_OnDealingDamage2 you cannot directly see the damage roll of the sneak dice in the history as the hook is actually after dice rolling, so I have to do it manually and add the result. You can see the dice results in the console though. You can however see the result in the history window as normal.

    If it is not possible to get the ET_OnDamageDealing trigger on ranged touch attacks I will revisit the workaround and fix the unspecified damage.
     

    Attached Files:

    Last edited: Mar 1, 2021
  13. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    674
    Likes Received:
    71
    Thanks I've deleted the old file in tpmodifiers and replaced with above as instructed. I have noted your new lines of code. I have re-run the previous Melf's Acid Arrow scenario but have to report that I saw no Sniper's Shot caption and that the 7HD Greater Temple Bugbear I have been spawning did not die sufficiently quickly for it to have been sustaining sneak attack damage. Sniper's shot still works with a shortbow. As an aside the way you are calculating damage for Sniper's Shots is by-passing Craven and Deadly Precision.
     
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    I think ET_OnDamageDealing is indeed reserved for strict melee attacks.
    However I've added a similar event for weapon-like spells, which covers the touch spells such as Shocking Grasp, Chill Touch etc. See DealWeaponlikeSpellDamage in damage.cpp (and compare vs. DealAttackDamage). So you should probably hook that event too with the same callback.
     
  15. Sagenlicht

    Sagenlicht Established Member

    Joined:
    Apr 14, 2004
    Messages:
    338
    Likes Received:
    119
    Screenshot 2021-03-01 220926.jpg
    This is the way it should look like when you take a look into the history and click on the damage. I've tested it with scorching rays and not with a melf's but this should hopefully not make a difference.

    I will look into the deadly precsion and craven feats.
     
Our Host!