
Originally Posted by
Motenten
Just store the value in precast if you're using the appropriate weaponskill, and then use it in your calculations in aftercast if you completed the action. Of course this is subject to ambiguity depending on whether the client is updated with your current TP by the time you actually perform the action (eg: hitting weaponskill macro slightly before you anticipate having 100+ TP), but it should be good for the vast majority of cases (eg: if you completed the weaponskill but only had 95 TP in precast, obviously you reached 100+ TP and would be in tier 1).
(note: I would assume, but haven't verified, that things like weaponskilling from too far away and losing your TP will also register with spell.interrupted)
Ok, so I got my Samba code working, but I can't seem to get my aftermath code to work.
Code:
function job_aftercast(spell, action, spellMap, eventArgs)
if not spell.interrupted then
add_to_chat(127,'Spell:'..spell.english..' used at '..tostring(precastTP)..' TP, with '..tostring(player.equipment.main))
if spell.english == "Wild Flourish" then
skillchainPending = true
send_command('wait 7;gs c clear skillchainPending')
elseif spell.type:lower() == "weaponskill" then
skillchainPending = not skillchainPending
send_command('wait 7;gs c clear skillchainPending')
elseif spell.type == "Samba" then
create_samba_timer(spell)
elseif spell.english == "Pyrrhic Kleos" and player.equipment.main == "Terpsichore" then
add_to_chat(127,'Spell:'..spell.english..' used at '..tostring(precastTP)..' TP, with '..tostring(player.equipment.main))
create_aftermath_timer()
end
end
end
function create_aftermath_timer()
add_to_chat(127,'Precast TP:'..tostring(precastTP)..' TP')
if precastTP > 0 and precastTP < 200 and not (buffactive['aftermath: lv.1'] or buffactive['aftermath: lv.2'] or buffactive['aftermath: lv.3']) then
send_command('timers create "Aftermath Level 1" 90 down')
elseif player.tp >= 200 and player.tp < 300 and not (buffactive['aftermath: lv.2'] or buffactive['aftermath: lv.3']) then
send_command('timers create "Aftermath Level 2" 120 down')
elseif player.tp == 300 and not buffactive['aftermath: lv.3'] then
send_command('timers create "Aftermath Level 3" 180 down')
end
end
The add_to_chats were my attempt to debug. When I use PK, it puts in echo: "Spell:Pyrrhic Kleos used at 116 TP, with Terpsichore"
What I was able to determine with the add_to_chat placement is even though that is the sentence that was printed out at the beginning of Aftercast, the statement spell.english == 'Pyrrhic Kleos' and player.equipment.main == 'Terpsichore' is never considered true.