Jump to content

Spells being overwritten...


Chewett

Recommended Posts

  • Root Admin

It looks like for some reason the default spell casting code (which sets a level 1 duration spell at 8 minutes) is overriding movelock, attacklock, petrify, and probably others.

Luckily the HC has uncovered this. I'm going to go over the code to work out what ones need changing, Please be aware spells may be lasting for shorter periods than you expect.

Link to comment
Share on other sites

  • Root Admin

Thanks all.

So story time!

 

Yesterday quite late after I had been busy I was informed that Petrify was not working properly and it had been earlier that day. So I spent some time immediately checking into the code as it was deemed important in the HC. As I was rushing I was checking the petrify item and not the petrify spell. The petrify Item runs for 30 minutes although the code, structure, etc, is very similar. This is important later.

Digging into the casting code I found an odd feature where any spells that run set up a trigger, but then if they are cast on others they are then deleted and re-created using a different set of parameters. Because of name shadowing and a few different variable names this actually caused a bug whereby:

Petrify runs, trigger created with X minutes
Petrify deleted from triggers
Petrify trigger re-created, with different params and using a new variable

This is pretty deep into the code and it looks like it has been around for a while but I have now fixed it. However after fixing it I still didn't see petrify being cast for 30 minutes. This is where I left it as I didn't have time to debug and it was already much past midnight for me.

 

Today I investigated again and noticed that I had the wrong spell file, finding the correct spell file did indeed show me that the petrify spell follows the same pattern for spell casting. So the petrify spell has never lasted for 30 minutes.

 

Long story short, Petrify spell level 1 has the standard 8 minute cast duration, it has always been the case. There was a bug that was affecting some items which have a special "longer" duration, but these are now fixed again.

If you have any questions, feel free to post or message me!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    17.5k
    Total Topics
    182.5k
    Total Posts
  • Recently Browsing

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...