ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Scrripty on July 09, 2009, 11:20:17 AM
-
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.
; 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
}
-
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.
-
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...
-
Have you tried checking #charstatus .. it gets set to A when casting magery spells probably does as well for other spell types.
-
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?
-
#CHARSTATUS definitely doesn't work for necro spells; I just tried it the other day. It's great for magery however.