Skip to content

Commit

Permalink
Added spell scrips for Paladin's Cove.
Browse files Browse the repository at this point in the history
  • Loading branch information
doug1234 committed Dec 7, 2024
1 parent b76575e commit 91d692f
Show file tree
Hide file tree
Showing 71 changed files with 1,094 additions and 1,186 deletions.
2 changes: 1 addition & 1 deletion tpdatasrc/palcov/scr/Spell026 - Banishment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def OnSpellEffect( spell ):
if (target_item.obj.type == obj_t_npc):

# check target is EXTRAPLANAR
if target_item.obj.d20_query_has_spell_condition( sp_Summoned ) or target_item.obj.is_category_type( mc_type_outsider ):
if target_item.obj.d20_query_has_spell_condition( sp_Summoned ) or target_item.obj.is_category_type( mc_type_outsider ) or target_item.obj.is_category_subtype(mc_subtype_extraplanar):

# subtract the target's hit dice from the amount allowed
hitDiceAmount = hitDiceAmount - targetHitDice
Expand Down
1 change: 1 addition & 0 deletions tpdatasrc/palcov/scr/Spell040 - Blindness Deafness.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def OnBeginSpellCast( spell ):
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-necromancy-conjure", spell.caster )
return 1

def OnSpellEffect( spell ):
print "Blindness/Deafness OnSpellEffect"
Expand Down
23 changes: 15 additions & 8 deletions tpdatasrc/palcov/scr/Spell056 - Charm Person.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ def OnSpellEffect( spell ):
spell.duration = 600 * spell.caster_level
target_item = spell.target_list[0]
target_item_obj = target_item.obj

if game.combat_is_active():
spell.dc = spell.dc - 5 # to reflect a bonus to the saving throw for casting charm in combat

if not target_item_obj.is_friendly( spell.caster ) and target_item_obj.name not in charm_exclusions:
if (target_item_obj.is_category_type( mc_type_humanoid )) and (target_item_obj.get_size < STAT_SIZE_LARGE):

if not target_item_obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id, spell.id ):

if game.global_vars[451] & 2**2 != 0:
if game.combat_is_active():
spell.dc = spell.dc - 5 # to reflect a bonus to the saving throw for casting charm in combat

if (not spell.caster in game.party) and (target_item.obj.type != obj_t_pc) and (target_item.obj in game.party):
# NPC enemy is trying to charm an NPC from your party - this is bad because it effectively kills the NPC (is dismissed from party and becomes hostile, thus becoming unrecruitable unless you use dominate person/monster)
target_item_obj = party_closest( spell.caster, conscious_only= 1, mode_select= 0, exclude_warded= 0, exclude_charmed = 1) # select nearest conscious PC instead, who isn't already charmed
if target_item_obj == OBJ_HANDLE_NULL:
target_item_obj = target_item.obj

if not target_item_obj.is_friendly( spell.caster ):
if target_item_obj.is_category_type( mc_type_humanoid ):

if not target_item_obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id ):
# saving throw unsuccessful
target_item_obj.float_mesfile_line( 'mes\\spell.mes', 30002 )

Expand Down
2 changes: 1 addition & 1 deletion tpdatasrc/palcov/scr/Spell065 - Cloudkill.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def OnSpellEffect( spell ):
target_item.obj.damage( game.leader , D20DT_UNSPECIFIED, dice_new( "1d1" ) )

# spawn one Cloudkill scenery object
cloudkill_obj = game.obj_create( OBJECT_SPELL_GENERIC, spell.target_loc )
cloudkill_obj = game.obj_create( OBJECT_SPELL_GENERIC, spell.target_loc, spell.target_loc_off_x, spell.target_loc_off_y )

# add to d20initiative
caster_init_value = spell.caster.get_initiative()
Expand Down
2 changes: 1 addition & 1 deletion tpdatasrc/palcov/scr/Spell067 - Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def OnSpellEffect( spell ):
#if ( target_item.obj.get_size < STAT_SIZE_LARGE or target_item.obj.is_category_type(mc_type_humanoid) ):
if 1: # let creatures of STAT_SIZE_LARGE be affected too, marc

if not target_item.obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id, spell.id ):
if not target_item.obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id):
# saving throw unsuccessful
target_item.obj.float_mesfile_line( 'mes\\spell.mes', 30002 )
if npc.type != obj_t_pc and npc.leader_get() == OBJ_HANDLE_NULL:
Expand Down
6 changes: 3 additions & 3 deletions tpdatasrc/palcov/scr/Spell093 - Cure Serious Wounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def OnSpellEffect( spell ):
target.spell_damage( spell.caster, D20DT_POSITIVE_ENERGY, dice, D20DAP_UNSPECIFIED, D20A_CAST_SPELL, spell.id )
else:
# heal target
target.heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.spell_heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.healsubdual( spell.caster, dice, D20A_CAST_SPELL, spell.id )

else:
Expand All @@ -60,13 +60,13 @@ def OnSpellEffect( spell ):
#target.float_mesfile_line( 'mes\\spell.mes', 30001 )

# saving throw succesful, heal target, 1/2 heal
target.heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.spell_heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.healsubdual( spell.caster, dice, D20A_CAST_SPELL, spell.id )
else:
#target.float_mesfile_line( 'mes\\spell.mes', 30002 )

# saving throw unsuccesful, heal target, full heal
target.heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.spell_heal( spell.caster, dice, D20A_CAST_SPELL, spell.id )
target.healsubdual( spell.caster, dice, D20A_CAST_SPELL, spell.id )

game.particles( 'sp-Cure Serious Wounds', target )
Expand Down
16 changes: 4 additions & 12 deletions tpdatasrc/palcov/scr/Spell122 - Dimensional Anchor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,18 @@ def OnEndProjectile( spell, projectile, index_of_target ):
game.particles_end( projectile.obj_get_int( obj_f_projectile_part_sys_id ) )
target_item = spell.target_list[0]

# Weapon Focus Ray, fix added by Shiningted
if spell.caster.has_feat(feat_weapon_focus_ray):
dex = spell.caster.stat_base_get(stat_dexterity)
dex_temp = dex + 2 + spell.caster.has_feat(feat_greater_weapon_focus_ray)*2
spell.caster.stat_base_set (stat_dexterity, dex_temp)

# hit
if spell.caster.perform_touch_attack( target_item.obj ) >= 1:
if spell.caster.perform_touch_attack( target_item.obj ) & D20CAF_HIT:

target_item.obj.condition_add_with_args( 'sp-Dimensional Anchor', spell.id, spell.duration, 0 )
target_item.partsys_id = game.particles( 'sp-Dimensional Anchor', target_item.obj )

# missed
else:
# missed
target_item.obj.float_mesfile_line( 'mes\\spell.mes', 30007 )

game.particles( 'Fizzle', target_item.obj )
spell.target_list.remove_target( target_item.obj )

# Restore dexterity
if spell.caster.has_feat(feat_weapon_focus_ray):
spell.caster.stat_base_set(stat_dexterity, dex)

spell.spell_end( spell.id )

Expand Down
18 changes: 5 additions & 13 deletions tpdatasrc/palcov/scr/Spell127 - Disintegrate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from toee import *
from casters import staff_has, staff_stats
from Co8 import *
from utilities import *

def OnBeginSpellCast( spell ):
print "Disintegrate OnBeginSpellCast"
Expand Down Expand Up @@ -37,16 +39,10 @@ def OnEndProjectile( spell, projectile, index_of_target ):
target_item = spell.target_list[0]
game.particles_end( projectile.obj_get_int( obj_f_projectile_part_sys_id ) )

# Weapon Focus Ray, fix added by Shiningted
if spell.caster.has_feat(feat_weapon_focus_ray):
dex = spell.caster.stat_base_get(stat_dexterity)
dex_temp = dex + 2 + spell.caster.has_feat(feat_greater_weapon_focus_ray)*2
spell.caster.stat_base_set (stat_dexterity, dex_temp)

return_val = spell.caster.perform_touch_attack( target_item.obj )

# hit
if return_val == 1 or return_val == 2:
if return_val & D20CAF_HIT:

game.particles( 'sp-Disintegrate-Hit', target_item.obj )

Expand All @@ -73,8 +69,8 @@ def OnEndProjectile( spell, projectile, index_of_target ):

if target_item.obj.saving_throw_spell( spell.dc, D20_Save_Fortitude, D20STD_F_NONE, spell.caster, spell.id ):
damage_dice.num = 5
if return_val == 2 and is_immune_to_crit == 0:
damage_dice.num = 10
#elif return_val == 2:
# damage_dice.num = damage_dice.num * 2 # handled internally now
target_item.obj.float_mesfile_line( 'mes\\spell.mes', 30001 )

target_item.obj.spell_damage( spell.caster, D20DT_FORCE, damage_dice, D20DAP_UNSPECIFIED, D20A_CAST_SPELL, spell.id )
Expand All @@ -98,10 +94,6 @@ def OnEndProjectile( spell, projectile, index_of_target ):
if changed_con == 1:
target_item.obj.stat_base_set(stat_constitution, -1)

# Restore dexterity
if spell.caster.has_feat(feat_weapon_focus_ray):
spell.caster.stat_base_set(stat_dexterity, dex)

spell.target_list.remove_target( target_item.obj )
spell.spell_end( spell.id )

Expand Down
29 changes: 8 additions & 21 deletions tpdatasrc/palcov/scr/Spell135 - Disrupt Undead.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,30 @@ def OnEndProjectile( spell, projectile, index_of_target ):
game.particles_end( projectile.obj_get_int( obj_f_projectile_part_sys_id ) )
target = spell.target_list[0]

# Weapon Focus Ray, fix added by Shiningted
if spell.caster.has_feat(feat_weapon_focus_ray):
dex = spell.caster.stat_base_get(stat_dexterity)
dex_temp = dex + 2 + spell.caster.has_feat(feat_greater_weapon_focus_ray)*2
spell.caster.stat_base_set (stat_dexterity, dex_temp)

if target.obj.is_category_type( mc_type_undead ):

# perform ranged touch attack
attack_successful = spell.caster.perform_touch_attack( target.obj )
if attack_successful & D20CAF_HIT:

# hit
if attack_successful == 1:
damage_dice = dice_new( '1d6' )
target.obj.spell_damage( spell.caster, D20DT_POSITIVE_ENERGY, damage_dice, D20DAP_UNSPECIFIED, D20A_CAST_SPELL, spell.id )
target.partsys_id = game.particles( 'sp-Disrupt Undead-hit', target.obj )

#critical hit
elif attack_successful == 2:
damage_dice = dice_new( '2d6' )
target.obj.spell_damage( spell.caster, D20DT_POSITIVE_ENERGY, damage_dice, D20DAP_UNSPECIFIED, D20A_CAST_SPELL, spell.id )
target.partsys_id = game.particles( 'sp-Disrupt Undead-hit', target.obj )

# missed
# hit
target.obj.spell_damage_weaponlike( spell.caster, D20DT_POSITIVE_ENERGY, damage_dice, D20DAP_UNSPECIFIED, 100, D20A_CAST_SPELL, spell.id, attack_successful, index_of_target )
target.partsys_id = game.particles( 'sp-Disrupt Undead-hit', target.obj )
else:

# missed
target.obj.float_mesfile_line( 'mes\\spell.mes', 30007 )

game.particles( 'Fizzle', target.obj )

else:

# not undead!
target.obj.float_mesfile_line( 'mes\\spell.mes', 31008 )
game.particles( 'Fizzle', target.obj )

# Restore dexterity
if spell.caster.has_feat(feat_weapon_focus_ray):
spell.caster.stat_base_set(stat_dexterity, dex)
game.particles( 'Fizzle', target.obj )

spell.target_list.remove_target( target.obj )
spell.spell_end( spell.id )
Expand Down
2 changes: 1 addition & 1 deletion tpdatasrc/palcov/scr/Spell141 - Dominate Person.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def OnSpellEffect( spell ):

if (target_item.obj.is_category_type( mc_type_humanoid ) == 1):

if not target_item.obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id, spell.id ):
if not target_item.obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id):
# saving throw unsuccessful
target_item.obj.float_mesfile_line( 'mes\\spell.mes', 30002 )

Expand Down
40 changes: 37 additions & 3 deletions tpdatasrc/palcov/scr/Spell142 - Doom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from toee import *
from utilities import *

def OnBeginSpellCast( spell ):
print "Doom OnBeginSpellCast"
Expand All @@ -13,20 +14,53 @@ def OnSpellEffect( spell ):

target = spell.target_list[0]

if (target.obj.type == obj_t_pc) or (target.obj.type == obj_t_npc):
npc = spell.caster ## added so NPC's will choose valid targets
if npc.type != obj_t_pc and npc.leader_get() == OBJ_HANDLE_NULL:
if (target.obj.type == obj_t_pc or target.obj.type == obj_t_npc) and critter_is_unconscious(target.obj) != 1 and not target.obj.d20_query(Q_Prone):
npc = spell.caster

else:
game.global_flags[811] = 0
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 5 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 10 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 15 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 20 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 25 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 30 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1
for obj in game.party[0].group_list():
if obj.distance_to(npc) <= 100 and critter_is_unconscious(obj) != 1 and game.global_flags[811] == 0 and not obj.d20_query(Q_Prone) and (obj.type == obj_t_pc or obj.type == obj_t_npc):
target.obj = obj
game.global_flags[811] = 1

if (target.obj.type == obj_t_pc) or (target.obj.type == obj_t_npc):
# allow Will saving throw to negate
if target.obj.saving_throw_spell( spell.dc, D20_Save_Will, D20STD_F_NONE, spell.caster, spell.id ):
# saving throw successful
target.obj.float_mesfile_line( 'mes\\spell.mes', 30001 )

game.particles( 'Fizzle', target.obj )
spell.target_list.remove_target( target.obj )

else:
# saving throw unsuccessful
target.obj.float_mesfile_line( 'mes\\spell.mes', 30002 )

# HTN - apply condition DOOM
target.obj.condition_add_with_args( 'sp-Doom', spell.id, spell.duration, 0 )
target.partsys_id = game.particles( 'sp-Doom', target.obj )
Expand Down
Loading

0 comments on commit 91d692f

Please sign in to comment.