Intermediate Example: Bug Report for Dispel Magic
Action |
Result |
===== spell: Entangle|Ranger ===== SA: spell_Entangle --script: CharDisplayStatus --script: InvokeSpellOnTarget --script: SpellLingerBlockage |
|
***** 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
|
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”); |
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";}; |
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|Ranger' spell.
- We need a way to remove the lingering spell-effect graphics. The 'Dispell|Ranger' spell has a area circle effect. It would be nice to remove only that portion of the lingering graphics. If we cannot do that, then the next best thing is to remove them all.