Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NWN-ish Called Shot #101

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
34 changes: 27 additions & 7 deletions cdtweaks/languages/english/revised_archer.tra
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
Advantages:
– +1 to hit and damage rolls with bows every 3 levels.
– May achieve Grand Mastery (5 slots) in longbows and shortbows.
– May use the Called Shot ability (when wielding a bow) once per day. Gains one use at level 4 and an additional use every 4 levels thereafter.
– May use the Called Shot ability (when wielding a bow).

CALLED SHOT: All successful ranged attacks within the next 10 seconds have the following cumulative effects besides normal damage, according to the level of the Archer:
4th level: -1 penalty to target's THAC0.
8th level: -1 penalty to target's Saving Throws vs. Spell.
12th level: -1 penalty to the target's Strength score.
16th level: +2 bonus to damage roll.
CALLED SHOT: Grants the ability to make a potentially disabling attack against an opponent's arms or legs.
Called shots are made at a -4 thac0 penalty.
A successful called shot against the legs reduces the opponent's movement rate by 20% and gives them a -2 cumulative penalty to their dexterity.
A successful called shot against the arms applies a cumulative -2 penalty to the creature's attack rolls.

– May benefit from the Point Blank Shot passive trait.

Expand All @@ -18,4 +17,25 @@ POINT BLANK SHOT: When wielding a bow, the Archer negates the -8 thac0 penalty f
Disadvantages:
– May only wear leather, studded leather, and hide armor.
– May only become Proficient (one slot) with melee weapons.
– May not use the Charm Animal ability."
– May not use the Charm Animal ability."

@1 = "Called Shot (Arms)"
@2 = "Called Shot (Arms)

A successful called shot against the arms applies a cumulative -2 thac0 penalty."

@3 = "Called Shot (Legs)"
@4 = "Called Shot (Legs)

A successful called shot against the legs reduces the opponent's movement rate by 20% and gives them a -2 cumulative penalty to their dexterity."

@100 = "The selected target is out of range"
@101 = "THAC0 Modification"
@102 = "Dexterity Modification"
@103 = "The character must wield a bow in order to use this ability"

@200 = "The character cannot perform more than one action per round"

@300 = "The character cannot use this ability while shooting AoE missiles"

@400 = "Unaffected by effects from Called Shot"
12 changes: 10 additions & 2 deletions cdtweaks/languages/english/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ The uninstall messages above are normal and expected.

@267000 = "Dual-Wield feat for Rangers [Luke]"

@268000 = ~"Force" the Archer kit to use bows [Luke]~

@269000 = "NWN-ish Armor vs. Dexterity [Luke]"

@270000 = "Defensive Roll feat for Thieves [Luke]"
Expand Down Expand Up @@ -802,3 +800,13 @@ Use Baldur.lua options: a7_interval_ini
@504000 = ~Allow Yeslick to Use Axes~

@505000 = ~Ensure Shar-Teel Doesn't Die in the Original Challenge~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// NWN-ish feats collection \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

@600170 = ~"Force" the Archer kit to use bows [Luke]~
35 changes: 27 additions & 8 deletions cdtweaks/languages/italian/revised_archer.tra
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
Vantaggi:
- Bonus pari a +1 ai tiri per colpire e al danno con qualsiasi arco ogni 3 livelli.
- Può diventare Gran Maestro (cinque punti) con l'arco lungo e l'arco corto.
- Può utilizzare l'abilità Colpo Mirato (quando impugna un arco) una volta al giorno (inizia al 4° livello con un uso e ne ottiene uno addizionale ogni 4 livelli).
- Può utilizzare l'abilità Colpo Mirato (quando impugna un arco).

COLPO MIRATO: Tutti gli attacchi a distanza messi a segno nei successivi 10 secondi, oltre ad infliggere un normale danno, hanno i seguenti effetti cumulativi a seconda del livello:

4° Livello: Penalità pari a -1 al THAC0 del bersaglio.
8° Livello: Penalità pari a -1 ai tiri-salvezza contro Incantesimi del bersaglio.
12° Livello: Penalità pari a -1 alla Forza del bersaglio.
16° Livello: Bonus pari a +2 al danno.
COLPO MIRATO: Conferisce la capacità di effettuare un attacco potenzialmente incapacitante contro le braccia o le gambe di un avversario.
I Colpi Mirati vengono effettuati con una penalità di -4 ai tiri per colpire.
Un Colpo Mirato contro le gambe riduce la velocità di movimento dell'avversario del 20% e gli applica una penalità cumulativa di -2 alla destrezza.
Un Colpo Mirato contro le braccia applica una penalità cumulativa di -2 ai tiri per colpire dell'avversario.

- Può beneficiare dell'abilità passiva Tiro Ravvicinato.

Expand All @@ -19,4 +17,25 @@ TIRO RAVVICINATO: Quando l'arciere impugna un arco, può negare la penalità di
Svantaggi:
- Può indossare soltanto armature di cuoio, armature di cuoio borchiato e armature di pelle.
- Può diventare soltanto Competente (un punto) nelle armi da mischia.
- Non può utilizzare l'abilità Charmare Animali."
- Non può utilizzare l'abilità Charmare Animali."

@1 = "Colpo Mirato (Braccia)"
@2 = "Colpo Mirato (Braccia)

Un Colpo Mirato contro le braccia applica una penalità cumulativa di -2 ai tiri per colpire dell'avversario."

@3 = "Colpo Mirato (Gambe)"
@4 = "Colpo Mirato (Gambe)

Un Colpo Mirato contro le gambe riduce la velocità di movimento dell'avversario del 20% e gli applica una penalità cumulativa di -2 alla destrezza."

@100 = "Il bersaglio selezionato è fuori portata"
@101 = "Modificatore al THAC0"
@102 = "Modificatore alla Destrezza"
@103 = "Il personaggio deve impugnare un arco per poter utilizzare questa abilità"

@200 = "Il personaggio non può compiere più di un'azione per round"

@300 = "Il personaggio non può utilizzare questa abilità mentre sta scoccando frecce con effetto ad area"

@400 = "Non soggetto agli effetti di Colpo Mirato"
10 changes: 10 additions & 0 deletions cdtweaks/languages/italian/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -718,3 +718,13 @@ Usa opzioni di Baldur.lua: a7_interval_ini
@504000 = ~Permettere a Yeslick di usare le asce~

@505000 = ~Assicura che Shar-Teel non muoia nella sfida iniziale~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Raccolta di talenti in stile NWN \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

@600170 = ~"Costringi" l'Arciere ad utilizzare gli archi [Luke]~
2 changes: 2 additions & 0 deletions cdtweaks/lib/comp_2680.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
WITH_SCOPE BEGIN
INCLUDE "cdtweaks\ardanis\functions.tph"
INCLUDE "cdtweaks\lib\revised_archer.tph"
INCLUDE "cdtweaks\luke\misc.tph"
//
WITH_TRA "cdtweaks\languages\english\revised_archer.tra" "cdtweaks\languages\%LANGUAGE%\revised_archer.tra" BEGIN
LAF "REVISED_ARCHER" END
END
Expand Down
141 changes: 84 additions & 57 deletions cdtweaks/lib/revised_archer.tph
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
DEFINE_ACTION_FUNCTION "REVISED_ARCHER"
BEGIN
WITH_SCOPE BEGIN
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Functions to be invoked via op402" "sourceFileSpec" = "cdtweaks\luke\lua\revised_archer_402.lua" "destRes" = "m_gt#402" END
// Listener: run 'func' each time a sprite has finished evaluating its effects
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Listeners" "sourceFileSpec" = "cdtweaks\luke\lua\revised_archer_listener.lua" "destRes" = "m_gtlstn" END
//
ACTION_IF !(FILE_EXISTS_IN_GAME "m_gttbls.lua") BEGIN
COPY "cdtweaks\luke\lua\m_gttbls.lua" "override"
END
LAF "GT_ADD_SPELL"
INT_VAR
"level" = 1
"type" = 4
"preferredSlot" = 21
STR_VAR
"idsName" = "ARCHER_CALLED_SHOT"
RET
"ARCHER_CALLED_SHOT" = "resName"
END
LAF "GT_ADD_SPELL"
INT_VAR
"level" = 1
"type" = 4
"preferredSlot" = 22
STR_VAR
"idsName" = "ARCHER_KIT_BONUS"
RET
"ARCHER_KIT_BONUS" = "resName"
END
//
//LAF "ADD_EXTENDED_STAT" INT_VAR "max" = 25 STR_VAR "identifier" = "GT_IGNORE_ACTION_ADD_SPRITE_STARTED_ACTION_LISTENER" END
// update description
WITH_SCOPE BEGIN
OUTER_SET "new_desc" = RESOLVE_STR_REF (@0)
COPY_EXISTING "kitlist.2da" "override"
Expand All @@ -25,14 +38,15 @@ BEGIN
END
END
BUT_ONLY
//
// remove passive trait + Called Shot from CLAB file
WITH_SCOPE BEGIN
COPY_EXISTING "%clabfile%.2da" "override"
PATCH_IF (GAME_IS "bgee bg2ee eet") BEGIN
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "AP_SPCL122" "****"
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "AP_SPCL122" "****" // Missile thac0/damage bonus
END ELSE BEGIN
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "AP_SPCL124" "****"
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "AP_SPCL124" "****" // Missile thac0/damage bonus
END
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "GA_SPCL121" "****" // Called Shot
// formatting
PRETTY_PRINT_2DA
BUT_ONLY
Expand All @@ -52,55 +66,50 @@ BEGIN
BUT_ONLY
END
END
// Called Shot (bows only!)
// Called Shot (bows only!): Split it into two (arms/legs)
WITH_SCOPE BEGIN
WITH_SCOPE BEGIN
COPY_EXISTING "spcl121.spl" "override\cdcl121.spl"
WRITE_LONG NAME1 "-1" // blank name
WRITE_LONG NAME2 "-1"
WRITE_LONG UNIDENTIFIED_DESC "-1" // blank description
WRITE_LONG DESC "-1"
WRITE_SHORT 0x1C 4 // innate
WRITE_LONG 0x34 1 // level
//
LPF "DELETE_EFFECT" END // fresh start
//
LPF "ADD_SPELL_EFFECT" INT_VAR "opcode" = 54 "target" = 2 "parameter1" = "-1" "duration" = 20 END // Base THAC0 bonus
//
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 2 "opcode" = 37 "target" = 2 "parameter1" = "-1" "duration" = 15 END // Save vs. spell bonus
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 3 "opcode" = 37 "target" = 2 "parameter1" = "-1" "duration" = 15 END // Save vs. spell bonus
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 4 "opcode" = 37 "target" = 2 "parameter1" = "-1" "duration" = 15 END // Save vs. spell bonus
//
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 3 "opcode" = 44 "target" = 2 "parameter1" = "-1" "duration" = 10 END // Strength bonus
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 4 "opcode" = 44 "target" = 2 "parameter1" = "-1" "duration" = 10 END // Strength bonus
//
LPF "ADD_SPELL_EFFECT" INT_VAR "header" = 4 "opcode" = 12 "target" = 2 "parameter1" = 2 "parameter2" = IDS_OF_SYMBOL ("dmgtype" "missile") "timing" = 1 END // +2 (missile) Damage
BUT_ONLY
END
ACTION_TO_LOWER "ARCHER_CALLED_SHOT"
// Arms
CREATE "spl" "%ARCHER_CALLED_SHOT%b"
COPY_EXISTING "%ARCHER_CALLED_SHOT%b.spl" "override"
WRITE_LONG NAME1 RESOLVE_STR_REF (@1)
WRITE_LONG NAME2 "-1"
WRITE_LONG UNIDENTIFIED_DESC RESOLVE_STR_REF (@2)
WRITE_LONG DESC "-1"
WRITE_LONG 0x18 (BIT14 BOR BIT25) // ignore dead/wild magic, castable when silenced
WRITE_SHORT 0x1C 4 // innate
WRITE_LONG 0x34 1 // level
WRITE_ASCII 0x3A "%DEST_RES%" #8 // icon
//
LPF "ADD_SPELL_HEADER" INT_VAR "range" = 30 STR_VAR "icon" = "%DEST_RES%" END
//
LPF "ADD_SPELL_EFFECT" INT_VAR "opcode" = 402 "target" = 2 "parameter1" = 1 STR_VAR "resource" = "%ARCHER_CALLED_SHOT%" END // Invoke lua
BUT_ONLY
// Legs
COPY_EXISTING "%ARCHER_CALLED_SHOT%b.spl" "override\%ARCHER_CALLED_SHOT%c.spl"
WRITE_LONG NAME1 RESOLVE_STR_REF (@3)
WRITE_LONG UNIDENTIFIED_DESC RESOLVE_STR_REF (@4)
WRITE_ASCII 0x3A "%DEST_RES%" #8 // icon
//
LPF "ALTER_SPELL_HEADER" STR_VAR "icon" = "%DEST_RES%" END
//
LPF "ALTER_SPELL_EFFECT" INT_VAR "match_opcode" = 402 "parameter1" = 2 END
BUT_ONLY
// EFFs
CREATE "eff" "%ARCHER_CALLED_SHOT%b"
COPY_EXISTING "%ARCHER_CALLED_SHOT%b.eff" "override"
WRITE_LONG 0x10 146 // Cast spell
WRITE_LONG 0x14 2 // Projectile target
WRITE_LONG 0x20 1 // Mode: instant/ignore level
WRITE_SHORT 0x2C 100 // prob1
WRITE_ASCII 0x30 "%DEST_RES%" #8 // spl file
BUT_ONLY
//
WITH_SCOPE BEGIN
COPY_EXISTING "spcl121.spl" "override"
GET_OFFSET_ARRAY "ab_array" SPL_V10_HEADERS
PHP_EACH "ab_array" AS "ab_ind" => "ab_off" BEGIN
PATCH_IF SHORT_AT ("%ab_off%" + 0x10) > 1 BEGIN
WRITE_BYTE "%ab_off%" 0xFF // mark for later deletion
END
END
LPF "DELETE_SPELL_HEADER" INT_VAR "header_type" = 0xFF END // enable deletion
//
LPF "ALTER_EFFECT" INT_VAR "match_opcode" = 249 STR_VAR "resource" = "cdcl121" END // Ranged hit effect
BUT_ONLY
END
COPY_EXISTING "%ARCHER_CALLED_SHOT%b.eff" "override\%ARCHER_CALLED_SHOT%c.eff"
WRITE_ASCII 0x30 "%DEST_RES%" #8 // spl file
BUT_ONLY
//
WITH_SCOPE BEGIN
CREATE "eff" "cdcl121"
COPY_EXISTING "cdcl121.eff" "override"
WRITE_LONG 0x10 402 // Invoke Lua
WRITE_LONG 0x14 1 // Self
WRITE_SHORT 0x2C 100 // prob1
WRITE_ASCII 0x30 "GTCLDSHT" #8 // Lua function
BUT_ONLY
END
COPY "cdtweaks\luke\bam\kit\archer\called_shot_arms.bam" "override\%ARCHER_CALLED_SHOT%b.bam" "cdtweaks\luke\bam\kit\archer\called_shot_legs.bam" "override\%ARCHER_CALLED_SHOT%c.bam"
END
// Point Blank Shot (bows only!)
WITH_SCOPE BEGIN
Expand All @@ -117,4 +126,22 @@ BEGIN
PRETTY_PRINT_2DA
BUT_ONLY
END
// lua
WITH_SCOPE BEGIN
OUTER_SET "feedback_strref_thac0_mod" = RESOLVE_STR_REF (@101)
OUTER_SET "feedback_strref_dex_mod" = RESOLVE_STR_REF (@102)
OUTER_SET "feedback_strref_bow_only" = RESOLVE_STR_REF (@103)
OUTER_SET "feedback_strref_aura_free" = RESOLVE_STR_REF (@200)
OUTER_SET "feedback_strref_AoE" = RESOLVE_STR_REF (@300)
//
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Class/Kit Abilities" "sourceFileSpec" = "cdtweaks\luke\lua\kit\archer\passive_traits.lua" "destRes" = "m_gtspcl" END
// Listener: run 'func' each time a sprite has finished evaluating its effects
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Class/Kit Abilities" "sourceFileSpec" = "cdtweaks\luke\lua\kit\archer\called_shot.lua" "destRes" = "m_gtspcl" END
END
//
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Utility Functions / Listeners" "sourceFileSpec" = "cdtweaks\luke\lua\utility\effect_check.lua" "destRes" = "m_gtutil" END
//
ACTION_IF !(FILE_EXISTS_IN_GAME "m_gttbls.lua") BEGIN
COPY "cdtweaks\luke\lua\m_gttbls.lua" "override"
END
END
Binary file added cdtweaks/luke/bam/kit/archer/called_shot_arms.bam
Binary file not shown.
Binary file added cdtweaks/luke/bam/kit/archer/called_shot_legs.bam
Binary file not shown.
Loading