Author Topic: chiv/necro/paladin casting  (Read 3377 times)

0 Members and 1 Guest are viewing this topic.

Scrripty

  • Guest
chiv/necro/paladin casting
« on: July 09, 2009, 11:20:17 AM »
0
Can anyone see a better way to do this?  I'm having an occasional double casting issue, and once in a while a spam out issue where it will cast the spell 5 times because it misses the mana check I believe...?  CurseWeapon seems to be the worst, I'm guessing because it only costs 4 mana to cast and I leech back so much on a dexer, the script misses the mana check I'm guessing?  I don't know...  Looking for ways to optimize the casting and checking part here. Oh yea, the %manarequired variable is based on this formula: %mana_required_0  7 - ( (  7 * %user_lmc ) / 100 ) Which changes based on the spell cast.. 7, 10, 15, 20.  I also intruduced somehow an overcasting issue where say Enemy of One tries to cast too fast.  I'm assuming I need to up the %2 variable to something higher, but that doesn't seem to work.  I have it set at 5 for divine fury.  Thanks for the help.

Code: [Select]
 ; returns #true when complete
  ;======================================================================
  sub CurseWeapon ; 7 mana : 4 at my lmc..
    menu get 25 ; Curse Weapon
    if #menures = #true
    {
      chooseSkill Necr
      if #sysTime < !CRWTimer || #mana < %mana_required_0 || #skill < 150 || !CastRecovery > #sysTime
      {
        if #mana < %mana_required_0 && !WarningDelay < #sCnt
        {
          set !WarningDelay #sCnt + 5
          event exMsg #charId 3 55 Warning, Low Mana
        }
        RETURN #false
      }
      menu delete status
      menu font color red
      menu font bgcolor gray
      menu text status 225 177 Casting Curse Weapon!
      gosub PaladinSpell 104 6
      if #result
        set !CRWTimer #sysTime + !CurseWepCastTime ;12010
      RETURN #result
    }
  RETURN

  sub PaladinSpell
    
    {
      if %0 < 2 || %0 > 3
        RETURN ERR_InvalidParams
      
      set !PaladinSpellTimeout #sCnt + 10
      set !Timeout #false
      set !CastingDisturbed #false
      set !StartMana #mana
      set !CastDelay #sysTime + ( ( %2 * 1000 ) / 4 ) ; Circle ( x10 due to integer math) / CastDelayPerSecond equals 4
      set !CastingJournalLine #charName , :
      set !JStart #jIndex
      set !Success #false
      if %0 = 3
        set !TargetSelf %3
      
      repeat
        set !SpellCast #false
        event macro 15 %1
        while !spellCast = #false && !castDelay > #sysTime
        {
          for !jScan #jIndex !jStart
          {
            scanJournal !jScan
            if !castingJournalLine in #journal
              set !spellCast #true
          }
        }
        if !targetSelf
        {
          target 3s
          event macro 23 0
        }
        ;wait 2
        for !jScan #jIndex !jStart
        {
          scanJournal !jScan
          if your_concentration in #journal
          {
            set !castingDisturbed #true
            event exMsg #charId 3 35 Disturbed
          }
        }
        if !paladinSpellTimeout < #sCnt
        {
          set !timeout #true
          event exMsg #charId 3 35 Spell Casting Timed out
        }
        if #mana < !startMana
        {
          set !success #true
        }
        gosub UpdateTitleBar
      until !success || !timeout || !castingDisturbed
      
      if !success
      {
        set !castRecovery #sysTime + 1750 ;Without any FCR, 1.75 second cast recovery.
        menu Delete user_tithing
        menu font color maroon
        menu Text user_tithing 85 335
        menu set user_tithing #TP
        RETURN #true
      }
      if !timeout || !castingDisturbed
      RETURN #false
  }
« Last Edit: July 09, 2009, 11:27:42 AM by Scrripty »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • 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: chiv/necro/paladin casting
« Reply #1 on: July 12, 2009, 02:30:40 PM »
0
I wrote a casting sub that I use in the runebook stuff.  I ended up using them for my general casting needs.

For chiv/necro/paladin casting, you are limited because there isn't as much journal traffic to use to key success failure from.  So I basically monitor #MANA before and after casting to determine success or failure. 
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: chiv/necro/paladin casting
« Reply #2 on: July 12, 2009, 04:51:20 PM »
0
I wrote a casting sub that I use in the runebook stuff.  I ended up using them for my general casting needs.

For chiv/necro/paladin casting, you are limited because there isn't as much journal traffic to use to key success failure from.  So I basically monitor #MANA before and after casting to determine success or failure. 

This does too. :)  It just doesn't catch the 4 mana spell that well... with 30lmc... and how much spam is happening... I think it's just missing the cast...

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: chiv/necro/paladin casting
« Reply #3 on: July 15, 2009, 05:03:48 AM »
0
Have you tried checking #charstatus  .. it gets set to A when casting magery spells probably does as well for other spell types.
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."

Scrripty

  • Guest
Re: chiv/necro/paladin casting
« Reply #4 on: July 15, 2009, 07:45:33 AM »
0
I haven't but I'll try it out.  You would still need to check for mana tho on success wouldn't you?  How would you decide success from the charastatus being set to a during a spell cast?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • 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: chiv/necro/paladin casting
« Reply #5 on: July 15, 2009, 07:53:35 AM »
0
#CHARSTATUS definitely doesn't work for necro spells; I just tried it the other day.  It's great for magery however.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: