Author Topic: Best way to determine if a spell was cast?  (Read 3749 times)

0 Members and 1 Guest are viewing this topic.

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Best way to determine if a spell was cast?
« on: April 06, 2011, 06:57:19 PM »
0
The first thing that comes to mind, is mana.  But on a wammy/sampire that could be fightning dozens of casters a mana vamp, feeblemind, mana leech from weapon could screw that up.

Right now I'm dealing with curse weapon.

I have a timer for curse weapon, when systime > timer, it casts (If mana > required).  From there my journal subs will find the curse weapon and set the casting active as true & sets a casting timer by systime.  If systime gets greater than the timer, and the following journal entries were not found, it deems the curse weapon as successful and resets the curse weapon timer.  Journal entries that deem curse weapon as a fail would be, Insufficent mana (Mana vamped, or somehow lost it before script casted...), Spell Fizzles (you were mana vamped while casting, paralyzed, or just failed/fizzled).

I thought that I could check for karma loss to tell it that curse weapon was also successful, but if you're killing something like pixies, it could mess with the script...

Anyone else have any other ideas to make it reliable?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Best way to determine if a spell was cast?
« Reply #1 on: April 06, 2011, 08:17:22 PM »
0
In my spell cast routines, it's a combination of mana and journal scanning.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: Best way to determine if a spell was cast?
« Reply #2 on: April 06, 2011, 08:43:58 PM »
0
Anyone else have any other ideas to make it reliable?

Protection? :)

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Best way to determine if a spell was cast?
« Reply #3 on: April 07, 2011, 05:00:11 AM »
0
Depending on the spell type  Use a combination of

1) Journal - fizzles etc
2) mana
3)  A in charstatus (casting/paralysis)
4) my Buffbar scanner for results
5) OCR the spell gump to see if highlighted or not -- this is probably what you need.

Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Best way to determine if a spell was cast?
« Reply #4 on: April 07, 2011, 07:26:39 AM »
0
Protection? :)

This one is the most important for me.  For a few of my newer scripts now, I don't even let you run unless you verify that protection is running. 
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Best way to determine if a spell was cast?
« Reply #5 on: April 07, 2011, 11:05:04 AM »
0
If your using reagents (Pig Iron) You can check B4 & after cast too see if you've used one...

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Best way to determine if a spell was cast?
« Reply #6 on: April 07, 2011, 02:13:59 PM »
0
I use protection on some sampires, on others I don't depending on what I'm doing.  So I can't really make it rely 100% on protection, and even so, you can still get mana vamped or froze I believe. Which needs checked.  Buff bar don't work for curse weapon either which sucks ;/.  Though I do use it for str/agil, bloodoath.  I already scan the spell icons for all toggleable spells.

I like having 2/6 or 2/0 casting, and there's a template I run that also has resist, so protection is bleh for that.  The reason he's setup that way is because I often get stuck pvping on him, and the fc & resist helps.

The script now is written so it does not override what the player is doing, if he's actually there.  So if I get stuck having to fight some OJ, I can swap to my bokuto & bone harvy and fight, and the script won't keep lightning striking, whirlwinding, momentum striking etc. monsters.

On slashers also there was times I needed to cast my curse weapon FAST, and dropping protection for casting & resist helped a ton.  It really reduced my chances to die.

Tags: