Action |
Result |
---|---|
|
===== spell: Entangle|Ranger ===== SA: spell_Entangle --script: CharDisplayStatus --script: InvokeSpellOnTarget --script: SpellLingerBlockage --script: GeneralDispell
|
***** TEMPLAR40 casts Entangle|Ranger on Giant Rats ***** We run: ..spell: Entangle|Ranger --SA: spell_Entangle = druid ----script: InvokeSpellOnTarget
----script: CharDisplayStatus
----script: SpellLingerBlockage
--SE: Entangle|Ranger
|
monster: Giant Rat ..SA: IsEntangled0 ----script: ComputeDamage ----script: Dispell ----script: IsCombatReady ..SE: Entangled|Ranger
|
***** TEMPLAR40 casts Entangle|Ranger on Warrior40 (Paragon40) ***** We run: ..spell: Entangle|Ranger --SA: spell_Entangle = druid ----script: InvokeSpellOnTarget
----script: CharDisplayStatus
----script: SpellLingerBlockage
--SE Entangle|Ranger
|
combatant: Warrior40 (Paragon40) ..SA: IsEntangled1 ----script: CharDisplayStatus ----script: Dispell ----script: GetAdjMaxMovement ..SE: Entangled|Ranger
|
***** When the Giant Rat is about to attack ***** We run: ..monster: GiantRat --SA:IsEntangled0 ----script:IsCombatReady
----script: CharDisplayStatus
|
monster: Giant Rat ..SA: IsEntangled0 ----script: ComputeDamage ----script: Dispell ----script: IsCombatReady ----script: CharDisplayStatus ..SE: Entangled|Ranger
|
***** When it's Warrior40s turn ***** We run: ..combatant: Warrior40 --SA:IsEntangled1 ----script: GetAdjMaxMovement
----script: CharDisplayStatus
|
combatant: Warrior40 (Paragon40) ..SA: IsEntangled1 ----script: CharDisplayStatus ----script: Dispell ----script: GetAdjMaxMovement ..SE: Entangled|Ranger -----script: Dispell SE
===== spell: Dispell ===== ..SA: dispell = ----script: InvokeSpellOnTarget
|
***** AVATAR40 casts Dispell on Giant Rats ***** We run: ..spell: Dispell --SA: dispell ----script: InvokeSpellOnTarget
----script: SpellLingeringScripts
|
monster: Giant Rat ..SA: none ..SE: none
|
And here are the scripts themselves:
name = dispell [InvokeSpellOnTarget] = $VAR targ; targ = $IndexOf($TargetContext()); $DEBUG("Dispelling" + $GET_CHAR_NAME( $IndexOf($TargetContext()) )); $RUN_CHAR_SCRIPTS( targ, "Dispell" ); $RUN_CHAR_SE_SCRIPTS ($TargetContext(), “Dispell SE”); [SpellLingeringScripts] = $RETURN “DispellLinger”; |
name = Global_Dispell [Dispell] = $DEBUG("Global Dispell"); $SA_REMOVE(); $REMOVE_SPELL_EFFECT($CharacterContext(), $GET_HOOK_PARAMETER(5)); |
name = IsEntangled0 [CharDisplayStatus] = $SET_HOOK_PARAM( 7, "IsEntangled0" ); $RETURN 1; [ComputeDamage] = $RETURN $GET_CHAR_HITPOINTS($IndexOf($TargetContext())) +# 1; [Dispell] = $CALL_GLOBAL_SCRIPT( "Global_Dispell", "Dispell" ); [GetAdjMaxMovement] = $RETURN "0"; [IsCombatReady] = $VAR duration; duration = $SA_PARAM_GET(); $IF ($GET_PARTY_TIME() >=# duration) { $SA_REMOVE(); $RETURN "Y"; } $ELSE {$RETURN "N";}; |
name = IsEntangled1 [CharDisplayStatus] = $SET_HOOK_PARAM( 7, "IsEntangled1" ); $RETURN 1; [Dispell] = $CALL_GLOBAL_SCRIPT( "Global_Dispell", "Dispell" ); [GetAdjMaxMovement] = $RETURN $SA_PARAM_GET(); |
name = spell_Entangle [CharDisplayStatus] = $SET_HOOK_PARAM( 7,""); $SET_HOOK_PARAM( 6,""); $RETURN 1; [Dispell] = $CALL_GLOBAL_SCRIPT( "Global_Dispell", "Dispell" ); [InvokeSpellOnTarget] = $VAR tgt; tgt = $IndexOf($TargetContext()); $IF ($GET_CHAR_SAVEVSSP(tgt) ># $RANDOM(20)) {$SET_COMBATANT_SA($TargetContext(),"IsEntangled0",$GET_PARTY_TIME() +# 10); $DEBUG("spell invokes Entangled0");} $ELSE {$SET_COMBATANT_SA($TargetContext(),"IsEntangled1",$GET_CHAR_MAXMOVE(tgt) /# 2); $DEBUG("spell invokes Entangled1");}; [SpellLingerBlockage] = $IF ($GET_COMBATANT_SA($CombatantContext(),"IsEntangled1") != "-?-?-"){$RETURN "N";}; [DispellLinger] = $RETURN “AREA”; |
The 'Dispell' works well for removing the 'Entangled' Special Abilities from the affected combatants but it leaves the engine's hard-wired Spell Effects attached to the affected combatants. Also, the display still shows the lingering effect in the form of 'wavering vines'. These are the problems:
We need a way of removing the engine's Spell Effects for those combatants within the range of the Dispell' spell. This is done when 'Dispell' script 'InvokeSpellOnTarget' is executed. That script ises $RUN_CHAR_SE_SCRIPTS to cause the spell causing each of the combatant's Spell Effects to run a script named “Dispell”. 'Entangle|Ranger' has such a script and it causes the global script Dispell (attached to global SA 'Global_Dispell) to run. That global script, in turn, uses $REMOVE_SPELL_EFFECT to delete the associated Spell Effect.
We need a way to remove the lingering spell-effect graphics. The 'Dispell' spell has a area circle effect. It has a script named “SpellLingeringScripts” which returns the value “DispellLinger”. The spell “Entangle|Ranger has a script named DispellLinger which returns the value “AREA” which causes the lingering spell effects and graphics to be removed in the area affected by the spell “Dispell”.