Savage 2: A Tortured Soul Forum

Savage 2: A Tortured Soul Forum (
-   Documentation (
-   -   AOE Spells via script (

Durwyn 05-04-2013 09:33 PM

AOE Spells via script
AOE Spells via script

AOE Spells like Spell_Eruption, so no "SnapCast" [You can't put a 'green' mark on your target]
don't trigger the "spellimpact" worldtrigger. At least, if used by players.

If you use the following script command:

CastSpell #index# Spell_Eruption, the "spellimpact" worldtrigger reacts.

Even more interesting, the spellimpact reacts for every target hit by the spell !
So if you use the spell on one enemy, every target within the defined TargetRadius value will trigger the worldtrigger.

Example with Spell_Eruption

In the "spellimpact" worldtrigger, you have to define how much HP the target loses.

Spawn a fictive hitpoint (of YOUR team) at your target position. and cast the spell eruption on it. (chaplain.npc)


Originally Posted by chaplain.npc
<?xml version="1.0" encoding="UTF-8"?>


Originally Posted by script
createvar int caster_team 2
SpawnEntityAtEntity #index_target# NPC_Critter definition human/units/chaplain/chaplain.npc team 2
set fake_hit #GetScriptParam(spawnedindex)#
set index_target #GetScriptParam(spawnedindex)#
CastSpell #index_target# Spell_Eruption

Add damage to the spell, and remove the fictive hitpoint.


Originally Posted by spellimpact
if #EntityExists(|#fake_hit|#)# "RemoveEntity #fake_hit#"
if [caster_team == spell_team] "goto end"
DamageEntity #target_spell# 200
goto end

It will damage any target of team 1 in its radius. However, you can't stun the targets inside "spellimpact" worldtrigger because the game will crash (too many calls of Spellimpact probably).

So you have to modify the "TargetState" of Spell_Eruption and add "State_Stunned" with TargetStateDuration of "1750"

This works because:

Set Spell_Eruption_TargetTeamAlly "false"
Set Spell_Eruption_TargetTeamEnemy "true"
So, Be sure these two settings are applied before trying your AOE.

rohezal 05-05-2013 10:53 AM

Thank you for sharing, this will make a lot of mini game coding more easy :)

All times are GMT. The time now is 09:59 PM.