Anyway to answer your question, I didn't dig very deep into the self buff code because I had already coded a buff sub into it. I do recall that if a buff was not memmed it never made a cast command. Since the cast command in spellcast.ini is where it mems spells it just didn't seem to find it. Only cast commands are in the code block to be called if $char(gem,"@SelfBuff(@a)")>0 this true meaning spell is memmed and rdy. If false it jumps down and checks if spell memmed but not rdy the first time. Then when it comes back to that statement second time since it still won't be memmed it wasn't first time since nothing mems it I can see it just gets lost if I recall correctly. Been awhile though since was working on that piece of code and I just started using macro quest so I could be misunderstanding what is happening in there. Just know when I upgraded to this version did not work. Looking at event code seems the problem was very similiar.
Code: Select all
Sub EventCheck
/declare a local
/declare RetryEventCount local
/declare PcTargetIdTemp local
/varset PcTargetIdTemp @PcTargetId
/if n @EventCount>0 {
/for a 1 to @EventCount
/varset PcTargetId $char(id)
/varset RetryEventCount 0
/if (((n $char(mana,pct)<=@EventMinMana(@a) && n $char(mana,pct)=>@EventMaxMana(@a)) && n $char(hp,pct)<=@EventMinHP(@a)) && n $char(hp,pct)=>@EventMaxHP(@a)) {
/if n @EventList(@a)<$calc($time(h)*3600+$time(m)*60+$time(s)) {
:RetryEvent
| /if ((n $char(gem,"@EventSpell(@a)")>0 || "@EventSpell(@a)"~~"item") || "@EventSpell(@a)"~~"activate") {
/if $char(state)==SIT /stand
/if "$mid(0,4,"@EventSpell(@a)")"=="item" {
/echo Casting Event Spell : @EventSpell(@a)
/call Cast "$mid(5,$calc($strlen("@EventSpell(@a)")-5),"@EventSpell(@a)")" "item"
} else /if "$mid(0,8,"@EventSpell(@a)")"=="activate" {
| /echo Casting Event Spell : @EventSpell(@a)
/varset PcTargetId NULL
/call Cast "$mid(9,$calc($strlen("@EventSpell(@a)")-9),"@EventSpell(@a)")" "activate"
} else {
/echo Casting Event Spell : @EventSpell(@a)
/if "@EventSpell(@a)"=="cannibalize IV" {
/varset PcTargetId NULL
} else
/call Cast "@EventSpell(@a)"
}
/if n @EventDuration(@a)==99999 {
/varset EventList(@a) $calc(99999+$calc($time(h)*3600+$time(m)*60+$time(s)))
} else /if n @EventDuration(@a)==0 {
/if "$spell("@EventSpell(@a)",duration)"=="INSTANT" {
/varset EventList(@a) $calc(1+$calc($time(h)*3600+$time(m)*60+$time(s)-5))
} else {
/varset EventList(@a) $calc($spell("@EventSpell(@a)",duration)+$calc($time(h)*3600+$time(m)*60+$time(s)-5))
}
} else {
/varset EventList(@a) $calc(@EventDuration(@a)+$calc($time(h)*3600+$time(m)*60+$time(s)-5))
}
| } else {
| /if n @RetryEventCount==0 /if n $char(gem,"@EventSpell(@a)")==-2 {
| /delay 3s
| /varadd RetryEventCount 1
| /goto :RetryEvent
| }
| /echo Event Spell:@EventSpell(@a) not memmed or not ready.
| /echo Waiting 5 seconds before retrying event.
| /varset EventList(@a) $calc(5+$calc($time(h)*3600+$time(m)*5+$time(s)))
| }
}
}
/next a
}
/varset PcTargetId @PcTargetIdTemp
/return
Been couple days since I patched this but has not had a issue since. Think I just commented out that code to fix. Sometimes I get a cast not ready msg when goes from canni5 to canni4 events. But working really well now that I took out the alert code part. Still working on the long recast time spells too but have several fixes in mind I will be looking at soon.
Also you can add some events in spellcast.inc to help with los issues that do not return an msg, plane of fire a good example with the uneven terrain. Might hit casting code repeatedly with no msg indicating spell missed but it never even starts to cast cause los. Can check these after checking for resists and will confirm also if spell landed at long range where msg sometimes not returned when spell is successful, current code just defaults to success if nothing indicates it didn't land.
Code: Select all
#event SpellLanded "Your Sharp Claw Ahlspiess flickers with a pale light."
#event SpellLanded "Your Rosrak's Boots of the Primal flickers with a pale light."
But thanks, I really enjoying it now, used alot today and worked very nicely.