Skip to content

Commit

Permalink
Merge pull request GrognardsFromHell#802 from doug1234/SagenlichtAssa…
Browse files Browse the repository at this point in the history
…ssin

Sagenlicht Assassin Spells:  Critical Strike, Fell the Greates Foe, Find the Gab, Sniper's Shot, Wrathstrike
  • Loading branch information
doug1234 authored Dec 17, 2024
2 parents 5e85678 + f02f538 commit 135093d
Show file tree
Hide file tree
Showing 20 changed files with 418 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tpdatasrc/tpgamefiles/rules/indicators/critical_strike.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ID_string: CRITICAL_STRIKE
effect_type: 0
texture_file: art\interface\player_conditions\buffs\Spell True Strike.tga
help_topic: TAG_SPELLS_CRITICAL_STRIKE
tooltip_base_text: Critical Strike
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ID_string: FELL_THE_GREATEST_FOE
effect_type: 0
texture_file: art\interface\player_conditions\buffs\Spell True Strike.tga
help_topic: TAG_SPELLS_FELL_THE_GREATEST_FOE
tooltip_base_text: Fell the Greatest Foe
5 changes: 5 additions & 0 deletions tpdatasrc/tpgamefiles/rules/indicators/find_the_gap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ID_string: FIND_THE_GAP
effect_type: 0
texture_file: art\interface\player_conditions\buffs\Spell True Strike.tga
help_topic: TAG_SPELLS_FIND_THE_GAP
tooltip_base_text: Find the Gap
5 changes: 5 additions & 0 deletions tpdatasrc/tpgamefiles/rules/indicators/snipers_shot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ID_string: SNIPER'S_SHOT
effect_type: 0
texture_file: art\interface\player_conditions\buffs\Spell True Strike.tga
help_topic: TAG_SPELLS_SNIPERS_SHOT
tooltip_base_text: Snipers Shot
5 changes: 5 additions & 0 deletions tpdatasrc/tpgamefiles/rules/indicators/wraithstrike.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ID_string: WRAITHSTRIKE
effect_type: 0
texture_file: art\interface\player_conditions\buffs\Spell True Strike.tga
help_topic: TAG_SPELLS_WRAITHSTRIKE
tooltip_base_text: Wraithstrike
20 changes: 20 additions & 0 deletions tpdatasrc/tpgamefiles/rules/spells/1051 - Critical Strike.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
School: Divination
Level: Brd 1
Level: Sor 1
Level: Wiz 1
Component: V
Casting Time: Swift Action
Range: Personal
Saving Throw: None
Spell Resistance: No
Projectile: No
flags_Target: Range
inc_flags_Target: Self
exc_flags_Target: Other
exc_flags_Target: Dead
exc_flags_Target: Non-critter
mode_Target: Personal
min_Target: 1
max_Target: 1
radius_Target: 0
ai_type: ai_action_defensive
21 changes: 21 additions & 0 deletions tpdatasrc/tpgamefiles/rules/spells/1074 - Snipers Shot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
School: Divination
Level: Rgr 1
Level: Sor 1
Level: Wiz 1
Component: V
Component: S
Casting Time: Swift Action
Range: Personal
Saving Throw: None
Spell Resistance: No
Projectile: No
flags_Target: Range
inc_flags_Target: Self
exc_flags_Target: Other
exc_flags_Target: Dead
exc_flags_Target: Non-critter
mode_Target: Personal
min_Target: 1
max_Target: 1
radius_Target: 0
ai_type: ai_action_defensive
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
School: Transmutation
Level: Clr 3
Level: Pal 2
Level: Rgr 2
Component: V
Component: S
Casting Time: 1 action
Range: Touch
Saving Throw: None
Spell Resistance: No
Projectile: No
flags_Target: Range
inc_flags_Target: Self
inc_flags_Target: Other
exc_flags_Target: Dead
exc_flags_Target: Non-critter
mode_Target: Single
min_Target: 1
max_Target: 1
radius_Target: 0
ai_type: ai_action_defensive
19 changes: 19 additions & 0 deletions tpdatasrc/tpgamefiles/rules/spells/1097 - Find the Gap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
School: Divination
Level: Pal 3
Level: Rgr 3
Component: V
Casting Time: 1 action
Range: Personal
Saving Throw: None
Spell Resistance: No
Projectile: No
flags_Target: Range
inc_flags_Target: Self
exc_flags_Target: Other
exc_flags_Target: Dead
exc_flags_Target: Non-critter
mode_Target: Personal
min_Target: 1
max_Target: 1
radius_Target: 0
ai_type: ai_action_defensive
20 changes: 20 additions & 0 deletions tpdatasrc/tpgamefiles/rules/spells/1098 - Wraithstrike.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
School: Transmutation
Level: Sor 2
Level: Wiz 2
Component: V
Component: S
Casting Time: Swift Action
Range: Personal
Saving Throw: None
Spell Resistance: No
Projectile: No
flags_Target: Range
inc_flags_Target: Self
exc_flags_Target: Other
exc_flags_Target: Dead
exc_flags_Target: Non-critter
mode_Target: Personal
min_Target: 1
max_Target: 1
radius_Target: 0
ai_type: ai_action_defensive
32 changes: 32 additions & 0 deletions tpdatasrc/tpgamefiles/scr/Spell1051 - Critical Strike.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from toee import *

def OnBeginSpellCast(spell):
print "Critical Strike OnBeginSpellCast"
print "spell.spellTarget_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level

def OnSpellEffect(spell):
print "Critical Strike OnSpellEffect"
spell.duration = 0 #Active only for current round
spellTarget = spell.target_list[0]
mainhandWeapon = spell.caster.item_worn_at(item_wear_weapon_primary)

if mainhandWeapon == OBJ_HANDLE_NULL:
spell.caster.float_text_line("Weapon required", tf_red)
game.particles('Fizzle', spell.caster)
spell.target_list.remove_target(spellTarget.obj)
else:
if spellTarget.obj.condition_add_with_args('sp-Critical Strike', spell.id, spell.duration):
spellTarget.partsys_id = game.particles('sp-True Strike', spellTarget.obj)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30000)
game.particles('Fizzle', spellTarget.obj)
spell.target_list.remove_target(spellTarget.obj)
spell.spell_end(spell.id)


def OnBeginRound(spell):
print "Critical Strike OnBeginRound"

def OnEndSpellCast(spell):
print "Critical Strike OnEndSpellCast"
26 changes: 26 additions & 0 deletions tpdatasrc/tpgamefiles/scr/Spell1074 - Snipers Shot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from toee import *

def OnBeginSpellCast(spell):
print "Snipers Shot OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level

def OnSpellEffect(spell):
print "Snipers Shot OnSpellEffect"

spell.duration = 0 #Snipers Shot is a Swift Action, works in the current round
spellTarget = spell.target_list[0]

if spellTarget.obj.condition_add_with_args('sp-Snipers Shot', spell.id, spell.duration, 0):
spellTarget.partsys_id = game.particles('sp-True Strike', spellTarget.obj)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30000)
game.particles('Fizzle', spellTarget.obj)
spell.target_list.remove_target(spellTarget.obj)
spell.spell_end(spell.id)

def OnBeginRound(spell):
print "Snipers Shot OnBeginRound"

def OnEndSpellCast(spell):
print "Snipers Shot OnEndSpellCast"
26 changes: 26 additions & 0 deletions tpdatasrc/tpgamefiles/scr/Spell1085 - Fell the Greatest Foe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from toee import *

def OnBeginSpellCast(spell):
print "Fell the Greatest Foe OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level

def OnSpellEffect(spell):
print "Fell the Greatest Foe OnSpellEffect"

spell.duration = 1 * spell.caster_level # 1 round/cl
spellTarget = spell.target_list[0]

if spellTarget.obj.condition_add_with_args('sp-Fell the Greatest Foe', spell.id, spell.duration, 0):
spellTarget.partsys_id = game.particles('sp-True Strike', spell.caster)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30000)
game.particles('Fizzle', spellTarget.obj)
spell.target_list.remove_target(spellTarget.obj)
spell.spell_end(spell.id)

def OnBeginRound(spell):
print "Fell the Greatest Foe OnBeginRound"

def OnEndSpellCast(spell):
print "Fell the Greatest Foe OnEndSpellCast"
26 changes: 26 additions & 0 deletions tpdatasrc/tpgamefiles/scr/Spell1097 - Find the gap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from toee import *

def OnBeginSpellCast(spell):
print "Find the Gap OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level

def OnSpellEffect(spell):
print "Find the Gap OnSpellEffect"

spell.duration = 1 * spell.caster_level # 1 round/cl
spellTarget = spell.target_list[0]

if spellTarget.obj.condition_add_with_args('sp-Find the Gap', spell.id, spell.duration, 0, 0):
spellTarget.partsys_id = game.particles('sp-True Strike', spellTarget.obj)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30000)
game.particles('Fizzle', spellTarget.obj)
spell.target_list.remove_target(spellTarget.obj)
spell.spell_end(spell.id)

def OnBeginRound(spell):
print "Find the Gap OnBeginRound"

def OnEndSpellCast(spell):
print "Find the Gap OnEndSpellCast"
26 changes: 26 additions & 0 deletions tpdatasrc/tpgamefiles/scr/Spell1098 - Wraithstrike.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from toee import *

def OnBeginSpellCast(spell):
print "Wraithstrike OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level

def OnSpellEffect(spell):
print "Wraithstrike OnSpellEffect"

spell.duration = 0 # current round
spellTarget = spell.target_list[0]

if spellTarget.obj.condition_add_with_args('sp-Wraithstrike', spell.id, spell.duration, 0):
spellTarget.partsys_id = game.particles('sp-True Strike', spellTarget.obj)
else:
spellTarget.obj.float_mesfile_line('mes\\spell.mes', 30000)
game.particles('Fizzle', spellTarget.obj)
spell.target_list.remove_target(spellTarget.obj)
spell.spell_end(spell.id)

def OnBeginRound(spell):
print "Wraithstrike OnBeginRound"

def OnEndSpellCast(spell):
print "Wraithstrike OnEndSpellCast"
64 changes: 64 additions & 0 deletions tpdatasrc/tpgamefiles/scr/tpModifiers/sp_critical_strike.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from templeplus.pymod import PythonModifier
from toee import *
import tpdp
from utilities import *
from spell_utils import SpellPythonModifier, getSpellHelpTag

print "Registering sp-Critical Strike"

def verifyCriticalStrikeConditions(attackPacket):
flags = attackPacket.get_flags()
weaponUsed = attackPacket.get_weapon_used()
target = attackPacket.target
attacker = attackPacket.attacker

if weaponUsed.obj_get_int(obj_f_type) != obj_t_weapon:
return False
elif attacker.can_sneak_attack(target):
return True
return False


def criticalStrikeSpellModifyThreatRange(attachee, args, evt_obj):
attackPacket = evt_obj.attack_packet
if verifyCriticalStrikeConditions(attackPacket):
weaponKeenRange = attackPacket.get_weapon_used().obj_get_int(obj_f_weapon_crit_range)
bonusType = bonus_type_enhancement
bonusHelpTag = game.get_mesline("mes\\bonus_description.mes", bonusType)
spellId = args.get_arg(0)
spellHelpTag = getSpellHelpTag(spellId)
evt_obj.bonus_list.add(weaponKeenRange, bonusType, "{} : {}".format(bonusHelpTag, spellHelpTag))
return 0

def criticalStrikeSpellBonusToConfirmCrit(attachee, args, evt_obj):
attackPacket = evt_obj.attack_packet
if verifyCriticalStrikeConditions(attackPacket):
bonusValue = 4 #+4 to confirm crits
bonusType = bonus_type_insight
bonusHelpTag = game.get_mesline("mes\\bonus_description.mes", bonusType)
spellId = args.get_arg(0)
spellHelpTag = getSpellHelpTag(spellId)
evt_obj.bonus_list.add(bonusValue, bonusType, "{} : {}".format(bonusHelpTag, spellHelpTag))
return 0

def criticalStrikeSpellBonusToDamage(attachee, args, evt_obj):
attackPacket = evt_obj.attack_packet
if verifyCriticalStrikeConditions(attackPacket):
target = attackPacket.target
#Check if opponent is immnue to precision based damage
if target.d20_query(Q_Critter_Is_Immune_Critical_Hits):
#evt_obj.damage_packet.bonus_list.add_zeroed(325) #ID 325 = Creature Immune to ~Sneak Attack~[TAG_CLASS_FEATURES_ROGUE_SNEAK_ATTACK]
evt_obj.damage_packet.bonus_list.add_zeroed(375) #ID 375 = NEW!
else:
bonusDice = dice_new('1d6') #Critical Strike Bonus Damage
damageType = D20DT_UNSPECIFIED
damageMesId = 3000 #ID3000 added in damage.mes
evt_obj.damage_packet.add_dice(bonusDice, damageType, damageMesId)
else:
evt_obj.damage_packet.bonus_list.add_zeroed(376) #ID 376 = NEW!
return 0

criticalStrikeSpell = SpellPythonModifier("sp-Critical Strike") # spell_id, duration, empty
criticalStrikeSpell.AddHook(ET_OnGetCriticalHitRange, EK_NONE, criticalStrikeSpellModifyThreatRange,())
criticalStrikeSpell.AddHook(ET_OnConfirmCriticalBonus, EK_NONE, criticalStrikeSpellBonusToConfirmCrit,())
criticalStrikeSpell.AddHook(ET_OnDealingDamage, EK_NONE, criticalStrikeSpellBonusToDamage,())
24 changes: 24 additions & 0 deletions tpdatasrc/tpgamefiles/scr/tpModifiers/sp_fell_the_greatest_foe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from toee import *
import tpdp
from utilities import *
from spell_utils import SpellPythonModifier

print "Registering sp-Fell the Greatest Foe"

def fellTheGreatestFoeSpellBonusToDamage(attachee, args, evt_obj):
target = evt_obj.attack_packet.target
attackerSize = attachee.get_size
targetSize = target.get_size
bonusDiceNumber = targetSize-attackerSize

if bonusDiceNumber > 0:
#Fell the Greatest Foe only works with melee attacks
if not evt_obj.attack_packet.get_flags() & D20CAF_RANGED:
bonusDice = dice_new('1d6')
bonusDice.number = bonusDiceNumber
evt_obj.damage_packet.add_dice(bonusDice, D20DT_UNSPECIFIED, 3003) #ID3003 added in damage.mes
return 0

fellTheGreatestFoeSpell = SpellPythonModifier("sp-Fell the Greatest Foe") # spell_id, duration, empty
fellTheGreatestFoeSpell.AddHook(ET_OnDealingDamage, EK_NONE, fellTheGreatestFoeSpellBonusToDamage,())
fellTheGreatestFoeSpell.AddSpellNoDuplicate()
Loading

0 comments on commit 135093d

Please sign in to comment.