From 5dc240e9ff85d3909b6436e54b56297d3b61e33b Mon Sep 17 00:00:00 2001 From: DavidMWWallace Date: Thu, 21 Nov 2024 00:17:41 -0500 Subject: [PATCH] Collated v35.21 updates --- stratagems/doc/readme-stratagems.html | 29 ++- stratagems/fiend/fiend.tpa | 15 +- stratagems/fiend/fiend_shared.tph | 2 +- stratagems/gameplay/shapeshift.tpa | 3 - stratagems/gameplay/spellhold_cost.tpa | 18 ++ stratagems/genai/ssl/hla.ssl | 9 +- stratagems/help/help.tpa | 2 +- .../iwdspells/data/New Text Document.txt | 0 stratagems/iwdspells/data/skip_sr.2da | 13 +- stratagems/iwdspells/iwdspells_arcane.tpa | 3 +- stratagems/iwdspells/iwdspells_divine.tpa | 4 +- .../iwdspells/lib/move_spell_resources.tph | 4 +- stratagems/iwdspells/lib/obg2_arcane.tpa | 2 +- stratagems/iwdspells/lib/obg2_divine.tpa | 2 +- stratagems/lang/english/initial.tra | 4 +- stratagems/lib/always.tph | 34 ++- stratagems/lib/initialise_hla_feat.tph | 5 +- .../mage/ssl/combatblocks/kill_summons.ssl | 1 + .../combatblocks/kill_summons_if_no_pc.ssl | 2 + stratagems/newspell/extra_arcane_spells.tpa | 3 +- stratagems/priest/ssl/generalblocks/easy.ssl | 11 +- stratagems/priest/ssl/generalblocks/rest.ssl | 2 +- stratagems/psionic/ssl/gith/githcapt.ssl | 70 +++++- stratagems/setup-stratagems.tp2 | 4 +- stratagems/sfo/filetype/lib_genai.tpa | 7 +- stratagems/sfo/install_sfo.tpa | 24 +- stratagems/sfo2e/alter_effect.tph | 226 ++++++++++++++++++ stratagems/sfo2e/lib_data.tph | 2 + stratagems/sfo2e/lib_sfo.tph | 48 +++- stratagems/sfo2e/lib_struct.tph | 22 +- stratagems/sfo2e/lua/New Text Document.txt | 0 stratagems/sfo2e/lua/data/onopen.ini | 6 +- stratagems/sfo2e/lua/ui_add_subraces.tph | 11 +- stratagems/sfo2e/lua/ui_detect_class_kit.tph | 10 +- stratagems/sfo2e/lua/ui_hide_spellbook.tph | 109 +++++++++ stratagems/sfo2e/lua/ui_spell_system.tph | 2 +- stratagems/sfo2e/structures/str_cre_v1.2da | 3 +- stratagems/spell/data/spelltweaks.2da | 2 +- .../spell/data/spelltweaks_descriptions.ini | 4 +- stratagems/spell/death_spell_summons.tpa | 1 + stratagems/spell/death_spell_summons_iwd.tpa | 1 + stratagems/spell/enhance_cure_cause.tpa | 1 + stratagems/spell/larloch.tpa | 6 +- stratagems/spell/monster_summoning_iwd.tpa | 17 ++ stratagems/spell/use_iwd_color_spray.tpa | 2 +- stratagems/tactical_bg1/carsa.tpa | 1 + stratagems/test/test.tpa | 37 ++- stratagems/test/testmage.ssl | 19 ++ 48 files changed, 695 insertions(+), 108 deletions(-) create mode 100644 stratagems/iwdspells/data/New Text Document.txt create mode 100644 stratagems/sfo2e/lua/New Text Document.txt create mode 100644 stratagems/sfo2e/lua/ui_hide_spellbook.tph create mode 100644 stratagems/test/testmage.ssl diff --git a/stratagems/doc/readme-stratagems.html b/stratagems/doc/readme-stratagems.html index 858530a3..0ffddb63 100644 --- a/stratagems/doc/readme-stratagems.html +++ b/stratagems/doc/readme-stratagems.html @@ -32,7 +32,7 @@

Sword Coast Stratagems

A Gibberlings Three Mod
Author: DavidW

-

Version 35.20
+

Version 35.21
Languages: English, French, German, Italian, Polish, Russian, Spanish, and Traditional Chinese.
Platforms: Windows, Linux (Enhanced Edition only), Mac OS X (Enhanced Edition only)

Sword Coast Stratagems (SCS @@ -3620,15 +3620,40 @@

Version 30 (January 2015)

  • A handful of EE items no longer have doubled-up 'usable by' blocks.
  • -
  • Version 35.20 (8th September 2024) +
  • Version 35.20 (8th September 2024)
    • Updated Chinese translation.
    • +
    • Fixed some issues with NPC auto-levelling that arose when games were saved and loaded.
    • Seven Eyes spell now works correctly.
    • "NPC Customization and Management" was failing to fully remove dual class flags from dual-class characters, leading to awkward consequences if they multiclassed.
    • Interjections in Watcher's Keep are no longer messed up by the 'go to Watcher's Keep early' component.
    • 'Thieves gain skill points in multiples of 5' is no longer offered for install if you already have its functionality via Talents of Faerun.
  • +
  • Version 35.21 (21st November 2024) +
      +
    • Fixed some issues with NPC auto-levelling that arose when games were saved and loaded.
    • +
    • Fixed a (SFO1e) library bug that was interfering with the detection of shields and offhand weapons.
    • +
    • Corrected several oBG2 installation issues that had crept in since 35.0 was released.
    • +
    • Tanar'ri spies had inserted a bug that made all Baatezu Chaotic Evil. Fixing this hopefully ends the Great Baatezu Civil War.
    • +
    • The cosmetic effects of the Balor vorpal sword now grant a saving throw (to match the saving throw SCS already gives against the main vorpal effect).
    • +
    • The Gith captain (along with other high level paladins/blackguards) waits till he can see enemies before summoning an ally.
    • +
    • Enemy mages have read the readme and no longer use Death Spell on creatures it doesn't affect.
    • +
    • Carsa, while still traumatized by her ordeal with Kahrk, doesn't endlessly relive it in Gullykin by constantly respawning.
    • +
    • Fixed some awkward interactions between shapeshift tokens and mods that alter the proficiency system.
    • +
    • Fixed a library glitch that was causing compatibility issues between IWDification random items and SCS (it was replacing some shortbows with swords).
    • +
    • 'Increased Spellhold cost' now updates journal entries.
    • +
    • Nishruu have been slightly lowered in level so that Death Spell still affects them.
    • +
    • The Ascension version of the innate Cure Light Wounds bhaalspawn ability is now affected by the Enhance Cure/Cause spell tweak.
    • +
    • The Larloch's Minor Drain tweak no longer does an extra 4 hp of damage.
    • +
    • Stonefist now grants the listed +2 bonus to AC.
    • +
    • The IWD-style color spray component now installs properly.
    • +
    • Slight tweak to the SFO library to handle possible (unconfirmed) compatibility errors on level-zero creatures.
    • +
    • The IWD spells now overwrite previous versions of the spells installed by other mods (except Spell Revisions) - not doing so was leading to subsequent install failures when the other-mod version of an IWD spell was configured differently from our version.
    • +
    • Removed some (harmless) WARNINGs if you install the IWD spells and the spell tweaks on oBG2.
    • + +
    +
  • diff --git a/stratagems/fiend/fiend.tpa b/stratagems/fiend/fiend.tpa index a3fd0aba..98c9a432 100644 --- a/stratagems/fiend/fiend.tpa +++ b/stratagems/fiend/fiend.tpa @@ -176,13 +176,14 @@ END // Balor sword: extra SCS edits - MAKE_PATCH - patch_ability_inline=>~ability_range=>3~ - proficiency=>PROFICIENCYLONGSWORD - enchantment=>5 - patch_effect_inline=>"match=>~opcode=13~ parameter2=>4 save_vs_death=>1 save_bonus=>~-4~" - END - LAF edit_item STR_VAR item=balor edits=patch_data END + itm.edit[balor] + [ + m.ab.alter{s_range=3} + m_proficiency:=PROFICIENCYLONGSWORD + m_enchantment=5 + m.ab_fx.alter{s_save_vs_poison=1 s_savebonus="-4"} + ] + // Baalor explosion, borrowed from Ascension diff --git a/stratagems/fiend/fiend_shared.tph b/stratagems/fiend/fiend_shared.tph index dcd214cb..713defb5 100644 --- a/stratagems/fiend/fiend_shared.tph +++ b/stratagems/fiend/fiend_shared.tph @@ -21,7 +21,7 @@ DEFINE_PATCH_MACRO baatezu BEGIN m_resist_magic_cold=50 m_resist_acid=0 m.resist_electricity=100 - m_alignment:=CHAOTIC_EVIL + m_alignment:=LAWFUL_EVIL END DEFINE_PATCH_MACRO fiend_general_2e BEGIN diff --git a/stratagems/gameplay/shapeshift.tpa b/stratagems/gameplay/shapeshift.tpa index 5d3e00c8..f07cd908 100644 --- a/stratagems/gameplay/shapeshift.tpa +++ b/stratagems/gameplay/shapeshift.tpa @@ -114,18 +114,15 @@ BEGIN unusable_cleric_thief=>1 unusable_mage_thief=>1 twohanded=>1 - proficiency=>PROFICIENCYKATANA icon_ground=>gward01 icon_carried=>cmisc6p enchantment=>~%enchantment%~ add_ability => core_ability_data - add_effect_global_inline=>~opcode=>233 parameter1=>1 parameter2=>96~ add_effect_global_inline'=>~opcode=>0 parameter1=>"%AC%" parameter2=>0x10~ add_effect_global_inline''=>~opcode=>53 parameter1=>%animation%~ // animation add_effect_global_inline'''=>~opcode=>145 parameter2=>0~ // no spells add_effect_global_inline''''=>~opcode=>145 parameter2=>1~ // no spells add_effect_global_inline'0=>~opcode=>215 target=>1 duration=>1 resource=>SPPOLYMP~ // swirly lights on start - add_effect_global_inline'99=>~opcode=>233 parameter1=>1 parameter2=>94~ // set Katana proficiency to 1 END ACTION_IF enhanced_edition BEGIN OUTER_SPRINT $patch_data(forbid_offhand) 1 diff --git a/stratagems/gameplay/spellhold_cost.tpa b/stratagems/gameplay/spellhold_cost.tpa index d24bd60f..33df2a72 100644 --- a/stratagems/gameplay/spellhold_cost.tpa +++ b/stratagems/gameplay/spellhold_cost.tpa @@ -63,6 +63,24 @@ BEGIN LPF strref_apply STR_VAR function=swap_strref_spellhold END IF_EXISTS END + + // these journal strings also mention it + + OUTER_PATCH "" BEGIN + PATCH_FOR_EACH arguments IN + 34187 + BEGIN + LPF swap_strref_spellhold STR_VAR arguments END + END + PATCH_IF enhanced_edition BEGIN + PATCH_FOR_EACH arguments IN + 74374 + 96385 + BEGIN + LPF swap_strref_spellhold STR_VAR arguments END + END + END + END END DEFINE_PATCH_FUNCTION swap_strref_spellhold diff --git a/stratagems/genai/ssl/hla.ssl b/stratagems/genai/ssl/hla.ssl index 4fce7c51..54a2252c 100644 --- a/stratagems/genai/ssl/hla.ssl +++ b/stratagems/genai/ssl/hla.ssl @@ -76,7 +76,8 @@ THEN DO END IF TRIGGER - !GlobalTimerNotExpired("summondeva","LOCALS") + See(NearestEnemyOf(Myself)) + !GlobalTimerNotExpired("summondeva","LOCALS") RequireBlock(IsPaladin) IgnoreBlock(IsBlackguard) RequireBlock(IsHighLevel) @@ -89,6 +90,7 @@ THEN DO END IF TRIGGER + See(NearestEnemyOf(Myself)) !GlobalTimerNotExpired("summondeva","LOCALS") RequireBlock(IsBlackguard) RequireBlock(IsHighLevel) @@ -102,6 +104,7 @@ THEN DO END IF TRIGGER + See(NearestEnemyOf(Myself)) RequireBlock(IsBlackguard) RequireBlock(Talents) RequireBlock(IsHighLevel) @@ -125,7 +128,7 @@ IF TRIGGER Alignment(scstarget,CHAOTIC_EVIL) !HasItem("harm",Myself) THEN DO - Action(AbilityRES,"%BLACKGUARD_ABYSSAL_PACT%") + Action(SpellRES,"%BLACKGUARD_ABYSSAL_PACT%") END IF TRIGGER @@ -139,7 +142,7 @@ IF TRIGGER Alignment(scstarget,LAWFUL_EVIL) !HasItem("harm",Myself) THEN DO - Action(AbilityRES,"%BLACKGUARD_INFERNAL_CONTRACT%") + Action(SpellRES,"%BLACKGUARD_INFERNAL_CONTRACT%") END IF TRIGGER diff --git a/stratagems/help/help.tpa b/stratagems/help/help.tpa index d3e0bfe9..087b4a47 100644 --- a/stratagems/help/help.tpa +++ b/stratagems/help/help.tpa @@ -193,7 +193,7 @@ DEFINE_ACTION_FUNCTION install_bg1_help BEGIN LAF edit_creature INT_VAR tv=1 STR_VAR creature=~geltik malkax bhobgob hobgob hobjoia zargal baruk hakt ihobgob hobgo5 nevill~ editstring= ~strip_script=>"%tutu_var%shout %tutu_var%hobgobf %tutu_var%hobgoba" insert_script_high=>dw#gpsht specifics=>72~ END - LAF edit_creature STR_VAR creature= ~%tutu_var%hobgoba~ ~%tutu_scripth%obelite %tutu_scripth%obgob_a %tutu_scripth%obgob_b %tutu_scripth%obgob_c %tutu_scripth%obgob_d %tutu_scripth%obgob_e + LAF edit_creature STR_VAR creature= ~%tutu_var%hobgoba %tutu_scripth%obelite %tutu_scripth%obgob_a %tutu_scripth%obgob_b %tutu_scripth%obgob_c %tutu_scripth%obgob_d %tutu_scripth%obgob_e %tutu_scripth%obelite %tutu_scripth%obgoa_a %tutu_scripth%obgoa_b %tutu_scripth%obgoa_c %tutu_scripth%obgoa_d %tutu_scripth%obgoa_e %tutu_scripth%obgzhur~ editstring= ~strip_script=>"%tutu_var%hobgobf %tutu_var%hobgoba dw#gpsht" insert_script_high=>dw#gpsht specifics=>72~ diff --git a/stratagems/iwdspells/data/New Text Document.txt b/stratagems/iwdspells/data/New Text Document.txt new file mode 100644 index 00000000..e69de29b diff --git a/stratagems/iwdspells/data/skip_sr.2da b/stratagems/iwdspells/data/skip_sr.2da index 65e78bd7..09a4ad0f 100644 --- a/stratagems/iwdspells/data/skip_sr.2da +++ b/stratagems/iwdspells/data/skip_sr.2da @@ -5,4 +5,15 @@ WIZARD_MONSTER_SUMMONING_4 WIZARD_MONSTER_SUMMONING_5 WIZARD_MONSTER_SUMMONING_6 CLERIC_CAUSE_SERIOUS_WOUNDS_IWD -CLERIC_CAUSE_CRITICAL_WOUNDS_IWD \ No newline at end of file +CLERIC_CAUSE_CRITICAL_WOUNDS_IWD +CLERIC_CAUSE_LIGHT_WOUNDS +CLERIC_SUNSCORCH +CLERIC_CURE_MODERATE_WOUNDS +CLERIC_CAUSE_MODERATE_WOUNDS +CLERIC_CAUSE_MEDIUM_WOUNDS +WIZARD_ICELANCE +WIZARD_VITRIOLIC_SPHERE +WIZARD_CONJURE_LESSER_EARTH_ELEMENTAL +WIZARD_CONJURE_LESSER_FIRE_ELEMENTAL +WIZARD_CONJURE_LESSER_AIR_ELEMENTAL +WIZARD_SUMMON_SHADOW \ No newline at end of file diff --git a/stratagems/iwdspells/iwdspells_arcane.tpa b/stratagems/iwdspells/iwdspells_arcane.tpa index 72d4f525..fb50a824 100644 --- a/stratagems/iwdspells/iwdspells_arcane.tpa +++ b/stratagems/iwdspells/iwdspells_arcane.tpa @@ -10,7 +10,8 @@ DEFINE_ACTION_FUNCTION iwdspells_arcane STR_VAR version="" BEGIN LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=no_cap_at_level_20 RET value END OUTER_SET truncate_at_level=value?"-1":20 - LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=overwrite_old_spells RET overwrite_always=value END + LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=do_not_overwrite_old_spells RET value END + OUTER_SET overwrite_always=!value OUTER_SPRINT resource_loc "%MOD_FOLDER%/%component_loc%/copyover" // greenify a few summoning spell icons diff --git a/stratagems/iwdspells/iwdspells_divine.tpa b/stratagems/iwdspells/iwdspells_divine.tpa index d0e099c2..950ba28c 100644 --- a/stratagems/iwdspells/iwdspells_divine.tpa +++ b/stratagems/iwdspells/iwdspells_divine.tpa @@ -12,7 +12,8 @@ DEFINE_ACTION_FUNCTION iwdspells_divine STR_VAR version="" BEGIN LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=no_cap_at_level_20 RET value END OUTER_SET truncate_at_level=value?"-1":20 - LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=overwrite_old_spells RET overwrite_always=value END + LAF check_ini INT_VAR silent=1 STR_VAR section=iwdspells ini=do_not_overwrite_old_spells RET value END + OUTER_SET overwrite_always=!value OUTER_SPRINT resource_loc "%MOD_FOLDER%/%component_loc%/copyover" @@ -35,6 +36,7 @@ DEFINE_ACTION_FUNCTION iwdspells_divine STR_VAR version="" BEGIN ACTION_IF MOD_IS_INSTALLED "spell_rev/setup-spell_rev.tp2" 0 BEGIN OUTER_SPRINT overwrite_these_spells "overwrite_sr.2da" + OUTER_SPRINT skip_these_spells "skip_sr.2da" END ELSE BEGIN OUTER_SPRINT overwrite_these_spells "overwrite.2da" diff --git a/stratagems/iwdspells/lib/move_spell_resources.tph b/stratagems/iwdspells/lib/move_spell_resources.tph index d4e9c85a..77347a51 100644 --- a/stratagems/iwdspells/lib/move_spell_resources.tph +++ b/stratagems/iwdspells/lib/move_spell_resources.tph @@ -728,7 +728,7 @@ BEGIN ACTION_IF "%afterwards%" STR_CMP "" BEGIN // because IWDspells assumes UTF-8 encoding, whereas e.g. SCS assumes localized encoding, we need special attention to the tra file, and can't just load it from sfo_tra_loc WITH_SCOPE BEGIN // needed so we don't permanently redefine sfo_tra_loc - ACTION_IF !VARIABLE_IS_SET sfo_iwdspells_extern_loaded || !sfo_iwdspells_extern_loaded BEGIN + //ACTION_IF (!VARIABLE_IS_SET sfo_iwdspells_extern_loaded || !sfo_iwdspells_extern_loaded) BEGIN ACTION_IF !enhanced_edition BEGIN LAF HANDLE_CHARSETS INT_VAR from_utf8=1 @@ -741,7 +741,7 @@ BEGIN END ELSE BEGIN OUTER_SPRINT sfo_tra_loc "%MOD_FOLDER%/%component_loc%/lang" END - END + //END LAF run STR_VAR file="%afterwards%" location=lib tra="%afterwards_tra%" END END END diff --git a/stratagems/iwdspells/lib/obg2_arcane.tpa b/stratagems/iwdspells/lib/obg2_arcane.tpa index e869926a..31c88d3f 100644 --- a/stratagems/iwdspells/lib/obg2_arcane.tpa +++ b/stratagems/iwdspells/lib/obg2_arcane.tpa @@ -544,7 +544,7 @@ opcodes to oBG2 counterparts. ACTION_IF VARIABLE_IS_SET $IWD_spell_installed("WIZARD_EMOTION_HOPELESSNESS") BEGIN COPY_EXISTING ~spwi411.spl~ ~override~ // emotion: hopelessness - LPF DELETE_EFFECT INT_VAR silent = 1 match_opcode = 321 END // use silent in case we're not using IWDspell version + LPF DELETE_EFFECT INT_VAR match_opcode = 321 END PATCH_IF VARIABLE_IS_SET $IWD_spell_installed("WIZARD_EMOTION_HOPE") BEGIN LPF CLONE_EFFECT INT_VAR match_opcode = 45 opcode = 206 STR_VAR resource = EVAL ~%WIZARD_EMOTION_HOPE%~ END END diff --git a/stratagems/iwdspells/lib/obg2_divine.tpa b/stratagems/iwdspells/lib/obg2_divine.tpa index 67a2d88e..98443ff1 100644 --- a/stratagems/iwdspells/lib/obg2_divine.tpa +++ b/stratagems/iwdspells/lib/obg2_divine.tpa @@ -243,7 +243,7 @@ opcodes to oBG2 counterparts. COPY_EXISTING ~%spell%.spl~ ~override~ READ_LONG 0x34 level - LPF DELETE_EFFECT INT_VAR match_opcode = 324 silent = 1 END + LPF DELETE_EFFECT INT_VAR match_opcode = 324 END LPF CD_CONVERT_61 END // op 61 crashes oBG2, so convert it to seven op 50s for body glow LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 177 power = level parameter1 = 4 parameter2 = 3 resist_dispel = 2 STR_VAR resource = EVAL ~%eff%~ END // undead immune PATCH_FOR_EACH race IN 121 139 144 145 147 156 157 158 159 169 BEGIN diff --git a/stratagems/lang/english/initial.tra b/stratagems/lang/english/initial.tra index 30c72c27..64592117 100644 --- a/stratagems/lang/english/initial.tra +++ b/stratagems/lang/english/initial.tra @@ -14,7 +14,7 @@ The Merchant of Nashkel has promised us gold if we were to bring back a winter w 'The unitarily branching state has an emergent branching structure, with each branch giving approximately definite positions and momenta to macroscopic objects and with those objects evolving in an approximately classical way within their branch' -Presumably the author is, or was, a past inmate of the Asylum. +Presumably the author is, or was, an inmate of the Asylum. STATISTICS: @@ -25,7 +25,7 @@ Weight: 2~ 'The essence of reversibility is that reversible laws can equally well be used to predict the past - to retrodict, as philosophers sometimes say. The motion of the planets is reversible: the present data about the planets can be used just as easily to determine past and future eclipses. The mixing of milk or the melting of ice is irreversible, information is lost in the process, so that many early states are compatible with the same later state.' -An acerbic note in a later hand criticizes the author's apparent ignorance of Wild Space, the planar multiverse, or even the weave, and suggests that the tome probably originates from a society too primitive to develop magic. +An acerbic note in a later hand criticizes the author's apparent ignorance of Wild Space, the planar multiverse, or even the weave, and suggests that the tome probably originates from a society too primitive to have developed magic. STATISTICS: diff --git a/stratagems/lib/always.tph b/stratagems/lib/always.tph index 688e7bf6..a0db13e8 100644 --- a/stratagems/lib/always.tph +++ b/stratagems/lib/always.tph @@ -236,7 +236,7 @@ END END - // Construct HLA table if it doesn't exist (do this every time, it might change + // Construct HLA table if it doesn't exist (do this every time, it might change) LAF include STR_VAR file=initialise_hla_feat.tph locbase=lib END @@ -265,7 +265,7 @@ //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// -ACTION_IF !(VARIABLE_IS_SET ~initialise~ && FILE_EXISTS "%workspace%/do_once_marker.mrk") BEGIN +ACTION_IF !(VARIABLE_IS_SET ~initialise~ && FILE_EXISTS "%workspace%/do_once_marker_scs.mrk") BEGIN ACTION_IF FILE_EXISTS "%workspace%/do_once_marker_scs.mrk" BEGIN DELETE + "%workspace%/do_once_marker_scs.mrk" @@ -286,6 +286,36 @@ ACTION_IF !(VARIABLE_IS_SET ~initialise~ && FILE_EXISTS "%workspace%/do_once_mar LAM indirect_load +//////////////////////////////////////////////////////// +//// On IWDEE, point the 'BEHOLDER_XX' spell.ids entries at +/// the INNATE_BEHOLDER_XX spells (likewise a few Symbols) +///////////////////////////////////////////////////////// + + + +ACTION_IF GAME_IS iwdee BEGIN + ACTION_DEFINE_ASSOCIATIVE_ARRAY spell_ids_missing BEGIN + 1716=>CLERIC_SYMBOL_HOPELESSNESS + 1714=>CLERIC_SYMBOL_PAIN + 3137=>BEHOLDER_ANTIMAGIC_RAY + 3141=>BEHOLDER_CHARM_PERSON + 3142=>BEHOLDER_SLEEP + 3143=>BEHOLDER_FLESH_TO_STONE + 3144=>BEHOLDER_DISINTEGRATE + 3145=>BEHOLDER_FEAR + 3146=>BEHOLDER_SLOW + 3147=>BEHOLDER_CAUSE_SERIOUS_WOUNDS + 3148=>BEHOLDER_DEATH_RAY + END + ACTION_PHP_EACH spell_ids_missing AS code=>name BEGIN + + ACTION_IF !FILE_CONTAINS_EVALUATED ("override/spell.ids" "%code%[ %TAB%]+%name%") BEGIN + APPEND "spell.ids" "%code% %name%" + END + END +END + + //////////////////////////////////////////////////////// //// Set up hotkeys //////////////////////////////////////////////////////// diff --git a/stratagems/lib/initialise_hla_feat.tph b/stratagems/lib/initialise_hla_feat.tph index 4af63e84..a65e3861 100644 --- a/stratagems/lib/initialise_hla_feat.tph +++ b/stratagems/lib/initialise_hla_feat.tph @@ -1,6 +1,5 @@ DEFINE_ACTION_FUNCTION initialise_hla_feat STR_VAR extant_list="" - extant_list_dir=lib BEGIN // if we're bg2 then... @@ -8,7 +7,7 @@ BEGIN ACTION_IF is_bg2 BEGIN // read extant HLAs not in spell.ids onto the list - MAKE_PATCH + MAKE_PATCH USE_ANY_ITEM=>spcl915 EXTRA_LEVEL_6=>spcl928 EXTRA_LEVEL_7=>spcl929 @@ -67,7 +66,7 @@ DEFINE_ACTION_MACRO read_hla_feat BEGIN OUTER_SET spelltype=0 OUTER_SPRINT resref EVAL "%%hla%%" COPY_EXISTING - "%%hla%%.spl" nowhere - READ_SHORT 0x1e spelltype + READ_SHORT 0x1c spelltype READ_LONG 0x34 level IF_EXISTS OUTER_SET $hla_spelltype("%hla%")=spelltype diff --git a/stratagems/mage/ssl/combatblocks/kill_summons.ssl b/stratagems/mage/ssl/combatblocks/kill_summons.ssl index 40eea953..942489c4 100644 --- a/stratagems/mage/ssl/combatblocks/kill_summons.ssl +++ b/stratagems/mage/ssl/combatblocks/kill_summons.ssl @@ -12,6 +12,7 @@ IF TRIGGER OR(2) Gender(scstarget,SUMMONED) Gender(scstarget,20) + !CheckStatGT(scstarget,8,LEVEL) TriggerBlock(Enemy|Helpless) /*slowspell*/ THEN DO diff --git a/stratagems/mage/ssl/combatblocks/kill_summons_if_no_pc.ssl b/stratagems/mage/ssl/combatblocks/kill_summons_if_no_pc.ssl index 1aa5b79f..23a60437 100644 --- a/stratagems/mage/ssl/combatblocks/kill_summons_if_no_pc.ssl +++ b/stratagems/mage/ssl/combatblocks/kill_summons_if_no_pc.ssl @@ -7,6 +7,7 @@ IF TRIGGER Target([GOODCUTOFF.0.0.0.0.SUMMONED]) Target([GOODCUTOFF.0.0.0.0.20]) + !CheckStatGT(scstarget,8,LEVEL) IgnoreBlock(SeeInvisible) BEGIN LOOP(scsvar||1;2;3;4;5;6) OR(3) @@ -23,6 +24,7 @@ END IF TRIGGER Target([GOODCUTOFF.0.0.0.0.SUMMONED]) Target([GOODCUTOFF.0.0.0.0.20]) + !CheckStatGT(scstarget,8,LEVEL) RequireBlock(SeeInvisible) BEGIN LOOP(scsvar||1;2;3;4;5;6) OR(2) diff --git a/stratagems/newspell/extra_arcane_spells.tpa b/stratagems/newspell/extra_arcane_spells.tpa index dd5e51a0..5a1c51d4 100644 --- a/stratagems/newspell/extra_arcane_spells.tpa +++ b/stratagems/newspell/extra_arcane_spells.tpa @@ -421,6 +421,7 @@ DEFINE_ACTION_FUNCTION stonefist BEGIN m_both_names:=@7 m_unidentified_description:=@8 m.fx.alter{s_parameter1=1} // 1 APR + m.fx.add{s_opcode=0 s_target=2 s_timing=2 s_parameter1=2} m.fx.add{s_opcode=7 s_target=2 s_timing=2 s_parameter1=42 s_parameter2=entry_index|number:i=7} //color m.ab.alter{s_attack_bonus=32767 s_dicesize=6 s_dicenumber=2 s_add_strength_bonus=0 s_number_charges=1} m.ab_fx.add{s_opcode=45 s_target=2 s_duration=6 s_save_vs_spell=1} @@ -434,7 +435,7 @@ DEFINE_ACTION_FUNCTION stonefist BEGIN END ] - OUTER_FOR (power=3;power<=6;++power) BEGIN + OUTER_FOR (power=2;power<=6;++power) BEGIN itm.copy[dwstnfi1=>"dwstnfi%power%"] [m.ab.alter{s_dicenumber=power}] END diff --git a/stratagems/priest/ssl/generalblocks/easy.ssl b/stratagems/priest/ssl/generalblocks/easy.ssl index 1c73368f..c997b782 100644 --- a/stratagems/priest/ssl/generalblocks/easy.ssl +++ b/stratagems/priest/ssl/generalblocks/easy.ssl @@ -42,6 +42,15 @@ END // close range spells, L6-7 +IF TRIGGER + RequireBlock(IsIWDDivine) + Target(NearestEnemyOf(Myself)) + Range(scstarget,10) + TriggerBlock(Easiest) +THEN DO + Action(Spell,CLERIC_DESTRUCTION) +END + IF TRIGGER Target(NearestEnemyOf(Myself)) Range(scstarget,10) @@ -49,7 +58,6 @@ IF TRIGGER THEN DO Action(SpellL7Myself,CLERIC_NATURE_BEAUTY) Action(SpellL7Myself,CLERIC_HOLY_WORD) - Action(Spell,CLERIC_DESTRUCTION) Action(SpellL7Myself,CLERIC_UNHOLY_WORD) Action(Spell,CLERIC_DOLOROUS_DECAY) Action(SpellReplaceMyself,ENEMY_CLERIC_HARM,CLERIC_HARM) @@ -164,6 +172,7 @@ THEN DO END IF TRIGGER + RequireBlock(IsIWDDivine) TargetBlock(DistantEnemies) TriggerBlock(Easiest) THEN DO diff --git a/stratagems/priest/ssl/generalblocks/rest.ssl b/stratagems/priest/ssl/generalblocks/rest.ssl index 7695237e..07fd7512 100644 --- a/stratagems/priest/ssl/generalblocks/rest.ssl +++ b/stratagems/priest/ssl/generalblocks/rest.ssl @@ -35,7 +35,7 @@ THEN RESPONSE #100 SetGlobalTimer("castspell","LOCALS",0) SetGlobal("shapeshift","LOCALS",0) - ApplySpell(Myself,DRUID_SHAPESHIFT_NATURAL_FORM) + ApplySpell(Myself,DRUID_HUMAN_FORM) Continue() END diff --git a/stratagems/psionic/ssl/gith/githcapt.ssl b/stratagems/psionic/ssl/gith/githcapt.ssl index 5e0e4305..b0965522 100644 --- a/stratagems/psionic/ssl/gith/githcapt.ssl +++ b/stratagems/psionic/ssl/gith/githcapt.ssl @@ -28,13 +28,81 @@ END IF TRIGGER TriggerBlock(CorePlus) + IgnoreBlock(Talents) RequireBlock(EnhancedEdition) - TargetBlock(PCsPreferringWeak) + TargetBlock(PCsPreferringWeak) + TriggerBlock(Enemy) THEN DO Combine() Action(SpellArea,BLACKGUARD_SUMMON_FALLEN_DEVA|300|100) END + +IF TRIGGER + See(NearestEnemyOf(Myself)) + RequireBlock(Talents) + TargetBlock(PCsPreferringWeak) + TriggerBlock(CorePlus) + Allegiance(Myself,ENEMY) + !HasItem("harm",Myself) +THEN DO + Action(SpellAreaRES,"%BLACKGUARD_SUMMON_BALOR%"|300|100) + Action(SpellAreaRES,"%BLACKGUARD_SUMMON_PIT_FIEND%"|300|100) +END + +IF TRIGGER + RequireBlock(Talents) + TargetBlock(Fiends) + TriggerBlock(CorePlus) + Allegiance(Myself,ENEMY) + !Allegiance(scstarget,ENEMY) + Alignment(scstarget,CHAOTIC_EVIL) + !HasItem("harm",Myself) +THEN DO + Action(SpellRES,"%BLACKGUARD_ABYSSAL_PACT%") +END + +IF TRIGGER + RequireBlock(Talents) + TargetBlock(Fiends) + TriggerBlock(CorePlus) + Allegiance(Myself,ENEMY) + !Allegiance(scstarget,ENEMY) + Alignment(scstarget,LAWFUL_EVIL) + !HasItem("harm",Myself) +THEN DO + Action(SpellRES,"%BLACKGUARD_INFERNAL_CONTRACT%") +END + +IF TRIGGER + RequireBlock(IsBlackguard) + RequireBlock(Talents) + RequireBlock(IsHighLevel) + TargetBlock(PCsInOrderShort) + Range(scstarget,10) + !CheckStat(scstarget,4,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS) + TriggerBlock(SpellTurn|MR|Enemy|SINecromancy|ResistMagicDamage) + !HPPercentLT(scstarget,10) + !HasItem("harm",Myself) +THEN DO + Action(AbilityRES,"%BLACKGUARD_HARM%"|200|100) +END + + +IF TRIGGER + RequireBlock(IsBlackguard) + RequireBlock(Talents) + RequireBlock(IsHighLevel) + TriggerBlock(CorePlus|HardPlusOrMarker) + Allegiance(Myself,ENEMY) + TargetBlock(Celestials) + TargetBlock(PCsPreferringWeak) + !Allegiance(scstarget,ENEMY) + !HasItem("harm",Myself) +THEN DO + Action(SpellRES,"%BLACKGUARD_PROFANE_FIRE%"|300|100) +END + IF TRIGGER !StateCheck(Myself,State_INVISIBLE) TriggerBlock(TruesightSafe) diff --git a/stratagems/setup-stratagems.tp2 b/stratagems/setup-stratagems.tp2 index 91adcbea..d4019aca 100644 --- a/stratagems/setup-stratagems.tp2 +++ b/stratagems/setup-stratagems.tp2 @@ -1,7 +1,7 @@ BACKUP ~weidu_external/backup/stratagems~ AUTHOR ~For help troubleshooting installation problems, go to the Sword Coast Stratagems forum at gibberlings3.net.~ //MODDER setup_tra none area_variables none missing_extern none missing_resref none ict2_actions none missing_eval none overwriting_file none fun_args warn -VERSION ~35.20~ +VERSION ~35.21~ README ~stratagems/doc/readme-stratagems.html~ AUTO_EVAL_STRINGS @@ -1501,7 +1501,7 @@ LAF run STR_VAR file=c7throne location=tactical_bg1 END BEGIN @24126 DESIGNATED 7150 GROUP @16056 REQUIRE_PREDICATE !GAME_IS iwdee @50009 -REQUIRE_PREDICATE MOD_IS_INSTALLED "setup-stratagems.tp2" 5900 || IS_AN_INT stratagems_component_5900_installed @16025 +//REQUIRE_PREDICATE MOD_IS_INSTALLED "setup-stratagems.tp2" 5900 || IS_AN_INT stratagems_component_5900_installed @16025 REQUIRE_PREDICATE GAME_IS ~bgt tutu tutu_totsc bgee eet~ @16001 LAF run STR_VAR file=carsa location=tactical_bg1 END diff --git a/stratagems/sfo/filetype/lib_genai.tpa b/stratagems/sfo/filetype/lib_genai.tpa index 0170fa64..1f8ca426 100644 --- a/stratagems/sfo/filetype/lib_genai.tpa +++ b/stratagems/sfo/filetype/lib_genai.tpa @@ -265,7 +265,7 @@ BEGIN CDRDGAXE=>AX1H01 CDRDXVRT=>SW1H07 CDRDCBLT=>XBOW04 - CDRDSBOW=>SW1H04 + CDRDSBOW=>BOW05 CDRDCB5=>BOW03 CDRDCS1=>SW1H04 RNDTRE58=>ULBOW4A @@ -493,8 +493,9 @@ BEGIN END END READ_SHORT (2*2+item_slot_off) shield_slot - PATCH_IF VARIABLE_IS_SET $itm_arr("%shield_slot") BEGIN - itm_off=$itm_arr("%slot_num%") + PATCH_IF VARIABLE_IS_SET $itm_arr("%shield_slot%") BEGIN + PATCH_PRINT "has offhand" + itm_off=$itm_arr("%shield_slot%") READ_ASCII itm_off weaponfile LPF identify_weapon STR_VAR weaponfile RET type proftype ench_here=enchantment damagetype_here=damagetype END PATCH_IF type=0 BEGIN diff --git a/stratagems/sfo/install_sfo.tpa b/stratagems/sfo/install_sfo.tpa index 372d97dc..8fe8be84 100644 --- a/stratagems/sfo/install_sfo.tpa +++ b/stratagems/sfo/install_sfo.tpa @@ -241,6 +241,7 @@ ACTION_IF !FILE_EXISTS "override/spell.ids" BEGIN END ACTION_DEFINE_ASSOCIATIVE_ARRAY spell_ids_missing BEGIN +/* // all these should be done by SFO 2e now 4611=>DRUID_SHAPESHIFT_BROWNBEAR 4612=>DRUID_SHAPESHIFT_WOLF 4613=>DRUID_SHAPESHIFT_BLACKBEAR @@ -279,28 +280,9 @@ ACTION_DEFINE_ASSOCIATIVE_ARRAY spell_ids_missing BEGIN 3701=>DEATHKNIGHT_FIREBALL 2985=>RED_HOLY_MIGHT 3890=>DEMON_FEAR + */ END -ACTION_IF GAME_IS iwdee BEGIN - ACTION_DEFINE_ASSOCIATIVE_ARRAY spell_ids_missing BEGIN - 1716=>CLERIC_SYMBOL_HOPELESSNESS - 1714=>CLERIC_SYMBOL_PAIN - 3137=>BEHOLDER_ANTIMAGIC_RAY - 3141=>BEHOLDER_CHARM_PERSON - 3142=>BEHOLDER_SLEEP - 3143=>BEHOLDER_FLESH_TO_STONE - 3144=>BEHOLDER_DISINTEGRATE - 3145=>BEHOLDER_FEAR - 3146=>BEHOLDER_SLOW - 3147=>BEHOLDER_CAUSE_SERIOUS_WOUNDS - 3148=>BEHOLDER_DEATH_RAY - END -END -ACTION_PHP_EACH spell_ids_missing AS code=>name BEGIN - - ACTION_IF !FILE_CONTAINS_EVALUATED ("override/spell.ids" "%code%[ %TAB%]+%name%") BEGIN - APPEND "spell.ids" "%code% %name%" - END -END + ACTION_IF enhanced_edition BEGIN diff --git a/stratagems/sfo2e/alter_effect.tph b/stratagems/sfo2e/alter_effect.tph index 60583c0b..2abcff64 100644 --- a/stratagems/sfo2e/alter_effect.tph +++ b/stratagems/sfo2e/alter_effect.tph @@ -988,6 +988,232 @@ BEGIN END +/* +document{ADD EFFECT} +{ +SFO function with the same syntax as CLONE/ALTER effect. By default, effect is added to headers but not globals. Set globals=1 to add to globals instead. If you set header=n, effect is added only to nth header (counting from 1, to match ADD_SPELL_EFFECT syntax). +By default, effect is added as last effect. Set insert_point=n to add it as effect n (counting from zero). +} + +*/ + +DEFINE_PATCH_FUNCTION ADD_EFFECT + // insert variables + INT_VAR header = 0 + insert_point = "-1" + global = 0 + // everything from below here just copied from the CLONE_EFFECT var block + + // variables for the new effect + opcode = 0 // force opcode, so as to change our dummy value to zero + target = "-1" + power = "-1" + parameter1 = "-11" + parameter2 = "-11" + timing = "-1" + resist_dispel = "-1" + duration = "-1" + duration_high = "-1" + probability1 = 100 + probability2 = "-1" + dicenumber = "-1" + dicesize = "-1" + savingthrow = "-1" + savebonus = "-11" + special = "-1" + + // DavidW's additional variables for the new effect + + save_vs_spell = "-1" + save_vs_breath = "-1" + save_vs_poison = "-1" + save_vs_wand = "-1" + save_vs_polymorph = "-1" + ignore_primary = "-1" + ignore_secondary = "-1" + bypass_mirror_image = "-1" + ignore_difficulty = "-1" + drain_hp_to_caster = "-1" + transfer_hp_to_target = "-1" + fist_damage_only = "-1" + drain_to_max_hp = "-1" + suppress_feedback = "-1" + save_for_half = "-1" + made_save = "-1" + does_not_wake = "-1" + + // same for match and new STR_VAR + STR_VAR resource = "SAME" + + // DavidW's additional functional variables + + function = "" + +BEGIN + check_globals=global + check_headers=!global + + // get parameters (from CamDawg's code) + SET new_fx = 0 + READ_ASCII 0 sig ELSE "fail" (4) + READ_ASCII 0x04 version (4) + PATCH_MATCH "%sig%" WITH + "SPL " + BEGIN + PATCH_IF ("%version%" STRING_COMPARE_CASE "V2.0" = 0) BEGIN // iwd2, spl 2.0 + SET min_size = 0x82 + END ELSE BEGIN + SET min_size = 0x72 + END + READ_LONG 0x6a fx_off ELSE 0 + SET counter_offset = 0x70 + SET abil_length = 0x28 + SET fx_type = 0 + READ_LONG 0x64 abil_off ELSE 0 + READ_SHORT 0x68 abil_num ELSE 0 + END + + "ITM " + BEGIN + PATCH_IF ("%version%" STRING_COMPARE_CASE "V1.1" = 0) BEGIN // pst, itm v1.1 + SET min_size = 0x9a + END ELSE BEGIN + SET min_size = 0x72 + END + READ_LONG 0x6a fx_off ELSE 0 + SET counter_offset = 0x70 + SET abil_length = 0x38 + SET fx_type = 0 + READ_LONG 0x64 abil_off ELSE 0 + READ_SHORT 0x68 abil_num ELSE 0 + END + + "CRE " + BEGIN + PATCH_IF ("%version%" STRING_COMPARE_CASE "V1.2" = 0) BEGIN // pst, cre v1.2 + SET min_size = 0x378 + READ_LONG 0x368 fx_off + SET counter_offset = 0x36c + END ELSE + PATCH_IF ("%version%" STRING_COMPARE_CASE "V2.2" = 0) BEGIN // iwd2, cre v2.2 + SET min_size = 0x62e + READ_LONG 0x61e fx_off + SET counter_offset = 0x622 + END ELSE + PATCH_IF ("%version%" STRING_COMPARE_CASE "V9.0" = 0) BEGIN // iwd, cre v9.0 + SET min_size = 0x33c + READ_LONG 0x32c fx_off + SET counter_offset = 0x330 + END ELSE BEGIN // everything else, cre v1.0 + SET min_size = 0x2d4 + READ_LONG 0x2c4 fx_off + SET counter_offset = 0x2c8 + END + SET abil_off = 0 // basically prevents the ability effect loop + SET abil_num = 0 + SET abil_length = 0 + SET check_globals = 1 + READ_BYTE 0x33 fx_type ELSE 2 + END + "fail" + BEGIN + PATCH_FAIL "ERROR: ADD_EFFECT does not think %SOURCE_FILE% appears to be a valid file" + END + DEFAULT + SET min_size = "-1" // kill macro as the file type is not recognized + PATCH_FAIL "ERROR: ADD_EFFECT does not support file type %sig%" + END + + fx_length=(0x30 + (0xd8 * fx_type)) + delta=0 + global_count=SHORT_AT counter_offset + // add the effect - global + PATCH_IF check_globals BEGIN + PATCH_IF global_countremove + from missile.ids
  • on BGEE, add some spell.ids entries missing that are present on SoD
  • on EE, fix a couple of UI errors +
  • on oBG2, add '155 PROFICIENCYCLUB' to stats.ids } */ @@ -809,35 +810,66 @@ IDS // this is missing on oBG2 APPEND ~animate.ids~ ~0xEF10 WATER_WEIRD~ UNLESS ~0xEF10~ + APPEND ~stats.ids~ ~115 PROFICIENCYCLUB~ UNLESS ~PROFICIENCYCLUB~ + APPEND ~spell.ids~ ~2921 WIZARD_IMPROVED_ALACRITY~ UNLESS ~WIZARD_IMPROVED_ALACRITY~ // append some sometimes-missing spell.ids entries ACTION_IF (is_bg && !GAME_IS "bg1 totsc")|| is_bg2 || GAME_IS "IWDEE" BEGIN ACTION_CLEAR_ARRAY extra_spell_ids_entries ACTION_DEFINE_ASSOCIATIVE_ARRAY extra_spell_ids_entries BEGIN + 1718=>CLERIC_SYMBOL_STUN + 1719=>CLERIC_SYMBOL_DEATH + 2222=>WIZARD_CHAOS_SHIELD 2302=>WIZARD_REMOVE_MAGIC + 2490=>WIZARD_POLYMORPH_NATURAL_FORM + 2493=>WIZARD_POLYMORPH_FLIND + 2494=>WIZARD_POLYMORPH_OGRE + 2495=>WIZARD_POLYMORPH_SPIDER + 2496=>WIZARD_POLYMORPH_MUSTARD_JELLY + 2497=>WIZARD_POLYMORPH_BROWN_BEAR + 2498=>WIZARD_POLYMORPH_BLACK_BEAR + 2499=>WIZARD_POLYMORPH_WOLF 2705=>WIZARD_KHELBENS_WARDING_WHIP + 2723=>WIZARD_IMPROVED_CHAOS_SHIELD + 2985=>RED_HOLY_MIGHT + 3101=>INNATE_CURE_LIGHT_WOUNDS + 3102=>INNATE_SLOW_POISON + 3103=>INNATE_DRAW_UPON_HOLY_MIGHT + 3104=>INNATE_LARLOCHS_MINOR_DRAIN + 3105=>INNATE_HORROR + 3106=>INNATE_VAMPIRIC_TOUCH 3122=>AVENGER_SHAPESHIFT_NATURAL_FORM 3123=>DRUID_SHAPESHIFT_FROM_BLACKBEAR 3124=>SHAPESHIFTER_SHAPESHIFT_NATURAL_FORM 3150=>SHAPESHIFT_NATURAL_FORM_1 3151=>SHAPESHIFT_NATURAL_FORM_2 + 3701=>DEATHKNIGHT_FIREBALL + 3890=>DEMON_FEAR + 3996=>TANARI_DEATH_GAZE + 3997=>TANARI_VAMPIRIC_TOUCH + 3998=>TANARI_SILENCE + 3999=>TANARI_PARALYZE + 4212=>PALADIN_DETECT_EVIL + 4213=>PALADIN_PROTECTION_FROM_EVIL 4611=>DRUID_SHAPESHIFT_BROWNBEAR 4612=>DRUID_SHAPESHIFT_WOLF 4613=>DRUID_SHAPESHIFT_BLACKBEAR 4632=>AVENGER_SHAPESHIFT_SWORDSPIDER 4633=>AVENGER_SHAPESHIFT_BABYWYVERN 4634=>AVENGER_SHAPESHIFT_FIRESALAMANDER + 4721=>TALOS_STORMSHIELD + 4722=>TALOS_LIGHTNING_BOLT + 4732=>HELM_TRUE_SIGHT 4643=>SHAPESHIFTER_SHAPESHIFT_WEREWOLF 4644=>SHAPESHIFTER_SHAPESHIFT_GREATERWEREWOLF - 2490=>WIZARD_POLYMORPH_NATURAL_FORM - 2493=>WIZARD_POLYMORPH_FLIND - 2494=>WIZARD_POLYMORPH_OGRE - 2495=>WIZARD_POLYMORPH_SPIDER - 2496=>WIZARD_POLYMORPH_MUSTARD_JELLY - 2497=>WIZARD_POLYMORPH_BROWN_BEAR - 2498=>WIZARD_POLYMORPH_BLACK_BEAR - 2499=>WIZARD_POLYMORPH_WOLF + END + ACTION_IF enhanced_edition BEGIN + ACTION_DEFINE_ASSOCIATIVE_ARRAY extra_spell_ids_entries BEGIN + 4238=>SUN_SOUL_FLAMING_FISTS + 4103=>BLACKGUARD_AURA_OF_DESPAIR + 4935=>BLACKGUARD_SUMMON_FALLEN_DEVA + END END ACTION_PHP_EACH extra_spell_ids_entries AS ind=>sym BEGIN APPEND spell.ids "%ind%%TAB%%sym%" UNLESS "%sym%" diff --git a/stratagems/sfo2e/lib_struct.tph b/stratagems/sfo2e/lib_struct.tph index e25e473e..749b2da2 100644 --- a/stratagems/sfo2e/lib_struct.tph +++ b/stratagems/sfo2e/lib_struct.tph @@ -4149,21 +4149,21 @@ BEGIN READ_LONG 0x1c $s(dicenumber) READ_LONG 0x20 $s(dicesize) READ_BYTE 0x24 saves - SET $s(save_vs_spell)=saves BAND BIT0 - SET $s(save_vs_breath)=saves BAND BIT1 - SET $s(save_vs_poison)=saves BAND BIT2 - SET $s(save_vs_wand)=saves BAND BIT3 - SET $s(save_vs_polymorph)=saves BAND BIT4 + SET $s(save_vs_spell)=(saves BAND BIT0)?1:0 + SET $s(save_vs_breath)=(saves BAND BIT1)?1:0 + SET $s(save_vs_poison)=(saves BAND BIT2)?1:0 + SET $s(save_vs_wand)=(saves BAND BIT3)?1:0 + SET $s(save_vs_polymorph)=(saves BAND BIT4)?1:0 READ_BYTE 0x25 byte - SET $s(ignore_primary_target) = byte BAND BIT2 - SET $s(ignore_secondary_target)=byte BAND BIT3 + SET $s(ignore_primary_target) = (byte BAND BIT2)?1:0 + SET $s(ignore_secondary_target)=(byte BAND BIT3)?1:0 READ_BYTE 0x27 byte - SET $s(bypass_mirror_image) = byte BAND BIT0 - SET $s(ignore_difficulty) = byte BAND BIT1 + SET $s(bypass_mirror_image) = (byte BAND BIT0)?1:0 + SET $s(ignore_difficulty) = (byte BAND BIT1)?1:0 SET $s(savebonus)=LONG_AT 0x28 SET $s(special)=LONG_AT 0x2c - SET $s(save_for_half)=(BYTE_AT 0x2d) BAND BIT0 - SET $s(drain_hp_to_caster)=(BYTE_AT 0x2c) BAND BIT3 + SET $s(save_for_half)=((BYTE_AT 0x2d) BAND BIT0)?1:0 + SET $s(drain_hp_to_caster)=((BYTE_AT 0x2c) BAND BIT3)?1:0 SET $s(extended)=0 SPRINT $s(header) "" SPRINT $s(strtype) "spl_v1_fx" diff --git a/stratagems/sfo2e/lua/New Text Document.txt b/stratagems/sfo2e/lua/New Text Document.txt new file mode 100644 index 00000000..e69de29b diff --git a/stratagems/sfo2e/lua/data/onopen.ini b/stratagems/sfo2e/lua/data/onopen.ini index 3911f901..1fc72510 100644 --- a/stratagems/sfo2e/lua/data/onopen.ini +++ b/stratagems/sfo2e/lua/data/onopen.ini @@ -29,11 +29,11 @@ main=dwUpdateID,dwCharacterScreenRecordRace,dwXPAdjust,DEFAULT [MAGE] -main=dwUpdateCurrentID,dwSetAsNotPriest,DEFAULT +main=dwUpdateCurrentID,dwSetAsNotPriest,dwHideSpellbookSetup,DEFAULT [PRIEST] -main=dwUpdateCurrentID,dwSetAsPriest,DEFAULT +main=dwUpdateCurrentID,dwSetAsPriest,dwHideSpellbookSetup,DEFAULT [INVENTORY] @@ -73,7 +73,7 @@ main=dwImposeLegalAbilityMinimums,dwAbilityPointBuy,DEFAULT [CHARGEN_PROFICIENCIES] -main=dwGrantDefaultProficiencies,dw_thiefskill_initialize,dwBuildProficiencyTableWrap,dwPassSubraceData,dwRangerProfSetup,DEFAULT,dwProficiencyOnOpenEnd +main=dwSubraceResetBio,dwGrantDefaultProficiencies,dw_thiefskill_initialize,dwBuildProficiencyTableWrap,dwPassSubraceData,dwRangerProfSetup,DEFAULT,dwProficiencyOnOpenEnd [LEVELUP_PROFICIENCIES] diff --git a/stratagems/sfo2e/lua/ui_add_subraces.tph b/stratagems/sfo2e/lua/ui_add_subraces.tph index d9f7dbd8..1f9ab752 100644 --- a/stratagems/sfo2e/lua/ui_add_subraces.tph +++ b/stratagems/sfo2e/lua/ui_add_subraces.tph @@ -612,6 +612,7 @@ BEGIN // edit the UI to hide race-transmission icons and to show the race itself REPLACE_TEXTUALLY "chargen\.information" "dwChargenInformation()" REPLACE_TEXTUALLY ~addCharacterDetail(v\.bam,v\.current,Infinity_FetchString(v\.strRef))~ ~dwAddCharacterIcon(v.bam,v.current,v.strRef)~ // IWDEE + REPLACE_TEXTUALLY EXACT_MATCH ~addCharacterDetail(v.bam,v.current,dwFilterKitDesc(Infinity_FetchString(v.strRef)))~ ~dwAddCharacterIcon(v.bam,v.current,v.strRef)~ // IWDEE REPLACE_TEXTUALLY ~Infinity_FetchString(statusEffects\[rowNumber\]\.strRef)~ ~Infinity_FetchString(dwAddCharacterIcon2(statusEffects[rowNumber].strRef))~ REPLACE_TEXTUALLY ~Infinity_FetchString(char\.race)~ ~dwDisplayRace(char)~ // edit the UI to show 'correct' skill values @@ -1819,6 +1820,13 @@ function dwSubraceChargenBioBypass() end +function dwSubraceResetBio() + + dwAutoBioSet=false + dwUpdatedBio=false + +end + function dwCharacterScreenRecordRace() dwRecordedRace[currentID]=dwFindSubraceData(characters[currentID]) @@ -2005,7 +2013,8 @@ function dwPassSubraceData() else -- dual-classing or zero-level creatures local subrace=dwFindSubraceData(characters[currentID]) signal=0 -- no need to pass a signal, indeed it's actively problematic to do so - extraprof=subrace.extraprof + -- consensus seems to be that you shouldn't get extra profs when dualclassing + -- extraprof=subrace.extraprof end diff --git a/stratagems/sfo2e/lua/ui_detect_class_kit.tph b/stratagems/sfo2e/lua/ui_detect_class_kit.tph index fd55e1bc..84e09f1d 100644 --- a/stratagems/sfo2e/lua/ui_detect_class_kit.tph +++ b/stratagems/sfo2e/lua/ui_detect_class_kit.tph @@ -715,7 +715,8 @@ end function dwFilterKitDesc(str) if type(str)=="string" then - return string.gsub(str,"{[^}]*}","") + local ret=string.gsub(str,"{[^}]*}","") + return ret elseif type(str)=="table" then local ret={} for k,v in pairs(str) do @@ -803,17 +804,20 @@ function dwFindPortraitMatch() end end -- get names associated with current IDs and match + -- only use most recent one, characters from previous save games persist local dwPortraitLookup={} local dwPortraitLookupBackwards={} for id,char in pairs (characters) do for n=0,nmax do if (dwPortraitNames[n]==char.name) then - dwPortraitLookup[id]=n dwPortraitLookupBackwards[n]=id end end - end + for n,id in pairs(dwPortraitLookupBackwards) do + dwPortraitLookup[id]=n + end + return dwPortraitLookup,dwPortraitLookupBackwards end diff --git a/stratagems/sfo2e/lua/ui_hide_spellbook.tph b/stratagems/sfo2e/lua/ui_hide_spellbook.tph new file mode 100644 index 00000000..c72efeed --- /dev/null +++ b/stratagems/sfo2e/lua/ui_hide_spellbook.tph @@ -0,0 +1,109 @@ +/* +describe-library{ + +This library contains a function to disable spellbook and spell use on a per-kit basis. (This needs a UI edit to disable the spellbook itself.)

    +} +brief-desc{allows some kits to disable the mage/priest spellbook} + +*/ + +/* +document{ui_hide_spellbook_setup} +{ +Sets up the ui_hide_spellbook function +} + + +*/ + +DEFINE_ACTION_FUNCTION ui_hide_spellbook_setup +BEGIN + + ACTION_IF !FILE_EXISTS_IN_GAME "m_dw_hsd.lua" BEGIN + + // copy over LUA entries + COPY ".../stratagems-inline/m_dw_hsd.lua" override EVALUATE_BUFFER + COPY ".../stratagems-inline/m_dw_hsf.lua" override EVALUATE_BUFFER + + // initialize on_open + LAF ui_on_open_setup END + + // make spell to disable quickbar buttons + CREATE spl "dwhdspl" + LPF add_basic_spell_ability END + LPF ADD_EFFECT INT_VAR opcode=144 target=1 timing=9 parameter2=2 END // disable spell select + LPF ADD_EFFECT INT_VAR opcode=145 target=1 timing=9 special=1 parameter2=0 END // disable wizard spellcasting ability + LPF ADD_EFFECT INT_VAR opcode=145 target=1 timing=9 special=1 parameter2=1 END // disable priest spellcasting ability + END + + +END + +/* +document{ui_hide_spellbook_} +{ +Given a space-separated list of kits (identified by their KITLIST ID), block all spellcasting for those kits, including access to the spellbook. At present doesn't block spell selection in character creation. + +By default we reload the kit detection code; put skip_dk_reload=1 to skip.} + + +*/ + +DEFINE_ACTION_FUNCTION ui_hide_spellbook + INT_VAR skip_dk_reload=0 + STR_VAR kit="" +BEGIN + + // initialize + LAF ui_hide_spellbook_setup END + + // sort out class/kit detection + ACTION_IF !skip_dk_reload BEGIN + LAF ui_detect_class_kit END + END + + // load kits for ID lookup + + LAF 2daq_extract STR_VAR resref=kitlist column=ROWNAME RET_ARRAY kitmap=array END + LAF array_invert STR_VAR array=kitmap RET_ARRAY kitmap_reversed=array END + + // go through entries + + OUTER_WHILE "%kit%" STR_CMP "" BEGIN + LAF return_first_entry STR_VAR list="%kit%" RET this_kit=entry kit=list END + + // get kit number + ACTION_TO_UPPER this_kit + OUTER_SET kitnumber=$kitmap_reversed("%this_kit%") + + // add block spell to CLAB + + LAF kit_edit STR_VAR kit="%this_kit%" edits="k.kit_apply_powers{dwhdspl 1}" END + + // mark up kit for UI block + + APPEND "m_dw_hsd.lua" "dwHideSpellbookByKit[%kitnumber%]=true%WNL%" KEEP_CRLF + + + END + + + +END + + + +<<<<<<<<.../stratagems-inline/m_dw_hsd.lua +dwHideSpellbookByKit={} +>>>>>>>> + +<<<<<<<<.../stratagems-inline/m_dw_hsf.lua +function dwHideSpellbookSetup() + + local _,k=dwFindClassKit() + + priestBookEnabled = priestBookEnabled and not dwHideSpellbookByKit[k] + mageBookEnabled = mageBookEnabled and not dwHideSpellbookByKit[k] + +end +>>>>>>>> diff --git a/stratagems/sfo2e/lua/ui_spell_system.tph b/stratagems/sfo2e/lua/ui_spell_system.tph index b7f16422..49feca3e 100644 --- a/stratagems/sfo2e/lua/ui_spell_system.tph +++ b/stratagems/sfo2e/lua/ui_spell_system.tph @@ -1330,7 +1330,7 @@ BEGIN parameter2=0 END set_to BEGIN - parameter2=2 + parameter2=1 parameter1=val END DEFAULT diff --git a/stratagems/sfo2e/structures/str_cre_v1.2da b/stratagems/sfo2e/structures/str_cre_v1.2da index 52db9d3e..3cb2a26a 100644 --- a/stratagems/sfo2e/structures/str_cre_v1.2da +++ b/stratagems/sfo2e/structures/str_cre_v1.2da @@ -5,8 +5,6 @@ name_long 0x8 strref name_short 0xc strref both_names -1 multiple_name_long,name_short both_names-strref -1 multiple_name_long-strref,name_short-strref -hp -1 multiple_hp_current,hp_max -level_all -1 multiple_level1,evel2,level3 ac -1 multiple_ac_natural,ac_effective show_longname 0x10 flag_0 no_corpse 0x10 flag_1 @@ -39,6 +37,7 @@ alignment_tracking 0x13 flag_6 xp_value 0x14 long xp 0x18 long power 0x18 long +gold 0x1c long status_sleeping 0x20 flag_0 status_berserk 0x20 flag_1 status_panic 0x20 flag_2 diff --git a/stratagems/spell/data/spelltweaks.2da b/stratagems/spell/data/spelltweaks.2da index 5dee3430..cc26d8aa 100644 --- a/stratagems/spell/data/spelltweaks.2da +++ b/stratagems/spell/data/spelltweaks.2da @@ -48,7 +48,7 @@ use_iwd_call_lightning iwd bg,bg2 not_sr use_iwd_shocking_grasp_targeting iwd bg,bg2 not_sr use_iwd_slay_living_targeting iwd bg,bg2 not_sr eldath_rename boost all iwd_divine -ilmater_rename boost all iwd_divine +ilmater_rename boost all ee,iwd_divine use_bg_flame_strike_damage bg iwd * use_bg_flame_strike_targeting bg iwd * use_bg_ghost_armor bg iwd * diff --git a/stratagems/spell/data/spelltweaks_descriptions.ini b/stratagems/spell/data/spelltweaks_descriptions.ini index 7fd41e70..a8a88cc8 100644 --- a/stratagems/spell/data/spelltweaks_descriptions.ini +++ b/stratagems/spell/data/spelltweaks_descriptions.ini @@ -268,8 +268,8 @@ name=Flame Strike is now targeted on a creature rather than a point FLAME_STRIKE=The spell is targeted on a creature rather than a point [use_bg_ghost_armor] -name=Ghost Armor gives an AC of 1 (rather than 2) and lasts for 1 hour rather than 1 round per level -GHOST_ARMOR=The spell gives an AC of 1 (rather than 2) and lasts for 1 hour rather than 1 round per level. +name=Ghost Armor gives an AC of 2 (rather than 3) and lasts for 1 hour rather than 1 round per level +GHOST_ARMOR=The spell gives an AC of 2 (rather than 3) and lasts for 1 hour rather than 1 round per level. [use_bg_holy_smite_unholy_blight] name=Holy Smite and Unholy Blight now do 1d4 damage per level, rather than 1d6 per two levels with a cap at 5d6 diff --git a/stratagems/spell/death_spell_summons.tpa b/stratagems/spell/death_spell_summons.tpa index 13ceb67d..d1152534 100644 --- a/stratagems/spell/death_spell_summons.tpa +++ b/stratagems/spell/death_spell_summons.tpa @@ -29,6 +29,7 @@ DEFINE_ACTION_FUNCTION death_spell_summons BEGIN COPY_EXISTING sword01.cre override bearposu.cre override + nishrusu.cre override WRITE_BYTE 0x234 8 BUT_ONLY IF_EXISTS diff --git a/stratagems/spell/death_spell_summons_iwd.tpa b/stratagems/spell/death_spell_summons_iwd.tpa index 98d877a9..78c364f5 100644 --- a/stratagems/spell/death_spell_summons_iwd.tpa +++ b/stratagems/spell/death_spell_summons_iwd.tpa @@ -5,6 +5,7 @@ DEFINE_ACTION_FUNCTION death_spell_summons_iwd BEGIN COPY_EXISTING sword01.cre override bearposu.cre override + nishrusu.cre override WRITE_BYTE 0x234 8 BUT_ONLY IF_EXISTS diff --git a/stratagems/spell/enhance_cure_cause.tpa b/stratagems/spell/enhance_cure_cause.tpa index ecf2028f..1f8f9b07 100644 --- a/stratagems/spell/enhance_cure_cause.tpa +++ b/stratagems/spell/enhance_cure_cause.tpa @@ -29,6 +29,7 @@ DEFINE_ACTION_FUNCTION enhance_cure_cause BEGIN CLERIC_CURE_CRITICAL_WOUNDS 5 27 1 ULITHARID_CURE_SERIOUS_WOUNDS 4 -1 0 INNATE_CURE_LIGHT_WOUNDS 1 -1 0 + FINP101 1 -1 0 >>>>>>>> LAF 2da_process_table INT_VAR inline=1 STR_VAR table="cure_table" function=patch_cure_spell END diff --git a/stratagems/spell/larloch.tpa b/stratagems/spell/larloch.tpa index 5d445fa5..728ba437 100644 --- a/stratagems/spell/larloch.tpa +++ b/stratagems/spell/larloch.tpa @@ -14,13 +14,13 @@ DEFINE_ACTION_FUNCTION larloch BEGIN spl.edit[%WIZARD_LARLOCH_MINOR_DRAIN% %INNATE_LARLOCHS_MINOR_DRAIN%|allow_missing:i=1 edit_strrefs_in_place:i=1] [ m_description:=@27 - m.ab_fx.alter{s_parameter1=0 s_parameter2=1|match="s_opcode=146"} + m.ab_fx.alter{s_parameter2=1|match="s_opcode=146"} ] spl.edit[%WIZARD_LARLOCH_MINOR_DRAIN%A %INNATE_LARLOCHS_MINOR_DRAIN%A|allow_missing:i=1 edit_strrefs_in_place:i=1] [ m.ab.clone{s_level=3+2*entry_index|number:i=4} - m.ab_fx.alter{s_dicenumber=p_level/2 + 1 s_dicesize=4 s_drain_hp_to_caster=1|match="s_opcode=12"} + m.ab_fx.alter{s_parameter1=0 s_dicenumber=p_level/2 + 1 s_dicesize=4 s_drain_hp_to_caster=1|match="s_opcode=12"} ] END ELSE BEGIN spl.edit[%WIZARD_LARLOCH_MINOR_DRAIN% %INNATE_LARLOCHS_MINOR_DRAIN%|allow_missing:i=1 edit_strrefs_in_place:i=1] @@ -28,7 +28,7 @@ DEFINE_ACTION_FUNCTION larloch BEGIN m_description:=@27 m.ab.clone{s_level=3+2*entry_index|number:i=4} m.ab_fx.delete{s_opcode=146} - m.ab_fx.add{s_opcode=12 s_target=2 s_timing=1 s_parameter2b=64 s_dicenumber=p_level/2 + 1 s_dicesize=4} + m.ab_fx.add{s_opcode=12 s_target=2 s_timing=1 s_parameter2b=64 s_parameter1=0 s_dicenumber=p_level/2 + 1 s_dicesize=4} m.ab_fx.add{s_opcode=18 s_target=1 s_timing=0 s_duration=60 s_parameter1=(p_level/2 + 1)*3} ] diff --git a/stratagems/spell/monster_summoning_iwd.tpa b/stratagems/spell/monster_summoning_iwd.tpa index c51c7d67..ce3e4b07 100644 --- a/stratagems/spell/monster_summoning_iwd.tpa +++ b/stratagems/spell/monster_summoning_iwd.tpa @@ -249,6 +249,23 @@ DEFINE_ACTION_FUNCTION monster_summoning_iwd BEGIN m.cre_swap_scripts{wtasight=>gnsummm} m.item.alter{s_unstealable=1 s_undroppable=1} ] + + array.new[comp_wpns] + [[ + bow05=>compb05 + sw1h01=>comps01 + ]] + + ACTION_PHP_EACH comp_wpns AS old=>new BEGIN + ACTION_IF !FILE_EXISTS_IN_GAME "%new%.itm" BEGIN + itm.copy[%old%=>%new%] + [ + m.ab.alter{s_breakable=0} + m.ab_fx.delete{s_opcode=309 OR s_opcode=146} + m_droppable=0 + ] + END + END cre.copy[orc01=>dw#ms1ow orc02=>dw#ms1oa|source_location=resource] [ diff --git a/stratagems/spell/use_iwd_color_spray.tpa b/stratagems/spell/use_iwd_color_spray.tpa index 6a275952..a35d8017 100644 --- a/stratagems/spell/use_iwd_color_spray.tpa +++ b/stratagems/spell/use_iwd_color_spray.tpa @@ -2,7 +2,7 @@ DEFINE_ACTION_FUNCTION use_iwd_color_spray BEGIN OUTER_SET stun_string= is_bg2?1280:26050 - spl.copy[spwi105=>"%WIZARD_COLOR_SPRAY%"] + spl.copy[spwi105=>"%WIZARD_COLOR_SPRAY%"|source_location=resource] [ m.ab_fx.delete{s_opcode=215 OR s_opcode=174} m.ab_fx.alter{ diff --git a/stratagems/tactical_bg1/carsa.tpa b/stratagems/tactical_bg1/carsa.tpa index a542a2be..1fce0e55 100644 --- a/stratagems/tactical_bg1/carsa.tpa +++ b/stratagems/tactical_bg1/carsa.tpa @@ -81,6 +81,7 @@ DEFINE_ACTION_FUNCTION carsa BEGIN COPY_EXISTING "%tutu_var%carsa.cre" "override/dw#carsa.cre" WRITE_ASCII SCRIPT_OVERRIDE "" (8) + WRITE_ASCII SCRIPT_CLASS "" (8) WRITE_ASCIIE DIALOG "dw#carsa" // give her a dialog diff --git a/stratagems/test/test.tpa b/stratagems/test/test.tpa index 4f5b470d..3b3b989c 100644 --- a/stratagems/test/test.tpa +++ b/stratagems/test/test.tpa @@ -1,18 +1,33 @@ +INCLUDE ~%MOD_FOLDER%/lib/ai_wrap.tph~ DEFINE_ACTION_FUNCTION test BEGIN - // prevent blade barrier (etc) from firing >1 / rd - ACTION_FOR_EACH spell IN - "%CLERIC_BLADE_BARRIER%D" - "%CLERIC_CIRCLE_OF_BONES%D" - "%CLERIC_GLOBE_OF_BLADES%D" - "%NPC_BLADE_BARRIER%D" - BEGIN - COPY_EXISTING "%spell%.spl" override - LPF ADD_SPELL_EFFECT INT_VAR opcode=318 target=2 timing=0 duration=5 STR_VAR resource="%SOURCE_RES%" END - IF_EXISTS - END + COPY_EXISTING "drasus.cre" override + LPF identify_weapon_preferences STR_VAR filename="%SOURCE_RES%" RET onhandprof + offhandprof + rangedprof + style + skip_me + has_ranged + damagetype + enchantment + no_weapon + END + PATCH_FOR_EACH var IN + onhandprof + offhandprof + rangedprof + style + skip_me + has_ranged + damagetype + enchantment + no_weapon + BEGIN + SPRINT val EVAL "%%var%%" + PATCH_PRINT "%var%=%val%" + END END diff --git a/stratagems/test/testmage.ssl b/stratagems/test/testmage.ssl new file mode 100644 index 00000000..d87fee63 --- /dev/null +++ b/stratagems/test/testmage.ssl @@ -0,0 +1,19 @@ +INCLUDE FILE(%MOD_FOLDER%/caster_shared/caster_definitions.ssl) + + + +IF TRIGGER + IgnoreBlock(IsBG1Only) + IgnoreBlock(Indiscriminate) + TargetBlock(PCsInOrder) + TriggerBlock(ResistFire|Enemy|SIEvocation|HLAMage) +THEN DO + Combine() + Action(SpellL9AreaRES,WIZARD_DRAGONS_BREATH|200|50) + Action(SpellL9AreaRES,WIZARD_COMET|200|50) +END + +IF TRIGGER +THEN DO + Action(Literal,Kill(Myself)) +END \ No newline at end of file