Author Topic: Spell Begin/End Scripts  (Read 982 times)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Spell Begin/End Scripts
« Reply #30 on: December 02, 2016, 01:17:47 PM »
If you need other spells that are similar in that they have lingering effects that stick around, there is Cloudkill and Stinking Cloud.

Let me know if you need things.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Spell Begin/End Scripts
« Reply #31 on: December 03, 2016, 06:59:38 PM »
Spell Begin/End scripts; the topic of this thread.

When should these be run?  Right now they are sometimes
not being run at all.  For a simple spell (eg: Enlarge), they are being
run once for each target and run with $AttackerContext and
$TargetContext.  For an area spell with lingering effects on the
battlefield (eg: Entangle) they are not being run at all.

Now it makes no sense to me to run the Entangle "Begin"
script at the time a combatant is affected by the spell.  There
may be many targets over a period of time and each target
may be affected more than once.  A Spell's "Begin" script,
it seems to me, should be run once when the spell is cast
(or perhaps when its effect is first produced in the case of
delayed spells).  A spell's "Begin" script should be run exactly
once for each casting of the spell.  And its end script
should be run exactly once when any effects of the spell disappear.

Therefore, I am going to start over.

What have I done to existing designs?  Nothing.  I have promised
backward compatibility for post 1.0 releases.  So, I will leave
the Spell Begin/End scripts exactly as they are: present but broken.
I will add two additional scripts for each spell: a "Spell Initiation"
script and a "Spell Termination" script.  To be designed and documented
in the near future.

Meanwhile, I have examined the spell database and see that the
following spells use the current Begin and/or End scripts.
The person who maintains these can choose to leave them
as they are or, if they would work better with the newer scripts,
can choose to update them.  I will shortly provide documentation
for the current Begin/End scripts and then for the Initiation/Termination
scripts.  "monsterPurpleWormSwallow"  ::)

Spiritual Hammer
Heal   (check for undead target)
Shillelagh  (Gives the attacker a weapon)
Shillelagh|Ranger  (Gives the attacker a weapon)
Spiritual Hammer|Paladin
itemScrollImmuneDragonBreath (remove scroll)
Charm|MonsterBeholder (manipulate charmed item)
Fear|MonsterBeholder (manipulate item)
Flesh to Stone|MonsterBeholder (manipulate item)
Sleep|MonsterBeholder (manipulate item)
Flesh to Stone|MonsterBeholder (manipulate item)
Slow|MonsterBeholder (manipulate item)
monsterBlackPuddingAttack
monsterCarrionStench
monsterGreenSlimeAttack
monsterMindFlayerTentacle
monsterPurpleWormSwallow
monsterPyroliskImmolationGaze
monsterYetiSqueeze



Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Spell Begin/End Scripts
« Reply #32 on: December 05, 2016, 02:23:39 PM »
As I can't seem to find any, cna you provide documentation for the Saving Throw Scripts as well?
I think that many of the spells scripts could use something other than Begin/End, but I need to know exactly when the saving Throw Scripts work to transfer to them any scripts.

I will wait until I see documentation before messing with any scripts, but I think the only ones that need to be Begin/End are the Spiritual Hammer, Shillelach and maybe the various Beholder spells.

Thanks for all of this, Paul.

Offline SilentThief

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 891
Re: Spell Begin/End Scripts
« Reply #33 on: December 05, 2016, 03:33:52 PM »
Unsure if this is helpful or not, but regarding these two examples there may be considerations that range out of combat. For the first, enlarge:

Spell Begin/End scripts; the topic of this thread.

When should these be run?  Right now they are sometimes
not being run at all.  For a simple spell (eg: Enlarge), they are being
run once for each target and run with $AttackerContext and
$TargetContext.

http://pandaria.rpgworlds.info/cant/rules/adnd_spells.htm#Enlarge
(I *think* that this is proper spell decsription)

the enlarge spell seems rather difficult to get a proper definition of. FRUA/Goldbox game fanpages (such as this --
http://crpgaddict.blogspot.com/2013/01/gold-box-spells-and-their-uses.html) state this makes the characters into better fighters, and I *believe* that this then ups the characters strength to match the bonuses for exceptional strength-- ranging up to the level of a stormgiants strength. (Perhaps asking if the ppl here on the forums who've decoded parts of FRUA/Goldbox can confirm???). Anyhow, if this is the case then associated strength bonuses would, in fact; raise "to hit" and "damage" bonuses, due to the greater strength. This would come into play in door opening and who tries events, as well -- so it should be usable outside of combat.

In theory, it should also cause the enlarged character to have "large creature" damage from weapons, so this can also be a penalty (large creatures usually take more damage some weapons). But I am pretty sure this is not done by anyone except DMs/modmakers such as me.

Regarding entangle:

For an area spell with lingering effects on the
battlefield (eg: Entangle) they are not being run at all.

Now it makes no sense to me to run the Entangle "Begin"
script at the time a combatant is affected by the spell.  There
may be many targets over a period of time and each target
may be affected more than once.  A Spell's "Begin" script,
it seems to me, should be run once when the spell is cast
(or perhaps when its effect is first produced in the case of
delayed spells).  A spell's "Begin" script should be run exactly
once for each casting of the spell.  And its end script
should be run exactly once when any effects of the spell disappear.

agree 100% on this "its end script should be run exactly once when any effects of the spell disappear" due to the possibility of this lasting past the combat that this is cast in, meaning it *could* run long enough to still be active in another combat, if such a thing were to occur. It would seem to be otherwise, this would have no real effect outside of combat.

---

Dunno if you moved past this or already came to a conclusion; if so I apologize for late posting.

ST
« Last Edit: December 05, 2016, 03:43:06 PM by SilentThief »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Spell Begin/End Scripts
« Reply #34 on: December 05, 2016, 04:50:09 PM »
A decision was made by nologgie and muself a few years ago that regardless of the length of an entangle spell due to a high level or whatever, that it's effect ended when combat ended.

There are actually a few reasons that we did this. First was ease of scripting. Second, but equally important was that there is no way in DC as it stood then or as it stands now to start a combat with area effects in place. We would need to be able to record the cell number, spell infor, including lingering and how long it had left to go, etc.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Spell Begin/End Scripts
« Reply #35 on: December 06, 2016, 08:34:40 PM »
Manikus:

Spell "Enlarge' has a special ability 'spell_Attack'
which has hook 'InvokeSpellOnTarget'
which references Combatant.  But when the spell
is cast in camp, there is no combatant.  Bad.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Spell Begin/End Scripts
« Reply #36 on: December 07, 2016, 02:21:20 PM »
Manikus:

Spell "Enlarge' has a special ability 'spell_Attack'
which has hook 'InvokeSpellOnTarget'
which references Combatant.  But when the spell
is cast in camp, there is no combatant.  Bad.

Thanks, Paul. Fixed it.

 

anything