Kuax Blog

티스토리 뷰

397 - Use UNIT_SPELL_CAST_SUCCEEDED for seeds (the true cast)mysticalos

Do to a bug in transcriptor, which i filed here, we've been blinded to this being there all along. But it's there, tested myself. Most accurate timers i ever did see.

In fact, even if timer wasn't there at all, if you just add a flash and shake to the true cast, you can just move off that alone, right at 0, every time. it's wonderful

Here is my code example although you'll probably do it better. But it is still a million times cleaner then a damage hack with timing variations based on distance from the missles and what not.

local function warnSeeds()
warnMoltenSeed:Show()
specWarnMoltenSeed:Show()
SeedsCountdown:Start(60)
timerMoltenSeedCD:Start(60)
end
local function clearSeedsActive()
seedsActive = false
end
function mod:UNIT_SPELLCAST_SUCCEEDED(uId, spellName)
if spellName == GetSpellInfo(100386) and not seedsActive then -- The true molten seeds cast.
self:SendSync("Seeds")--Send a sync out just in case somoene does not get this event.
seedsActive = true
timerMoltenInferno:Schedule(2.25)--Always delay Molten Inferno timer, cause it starts when seeds land.
if self.Options.warnSeedsLand then--Warn after they are on ground, typical strat for normal mode. Time not 100% consistent.
self:Schedule(2.25, warnSeeds)
else
self:warnSeeds()
end
self:Schedule(17.5, clearSeedsActive)--Clear active/warned seeds after they have all blown up.
end
end
function mod:OnSync(event, arg)
if event == "Seeds" and not seedsActive then--Fire event if you recieve a sync and have NOT already fired event off UNIT_SPELLCAST_SUCCEEDED
seedsActive = true
timerMoltenInferno:Schedule(2.25)--Always delay Molten Inferno timer, cause it starts when seeds land.
if self.Options.warnSeedsLand then--Warn after they are on ground, typical strat for normal mode. Time not 100% consistent.
self:Schedule(2.25, warnSeeds)
else
self:warnSeeds()
end
self:Schedule(17.5, clearSeedsActive)--Clear active/warned seeds after they have all blown up.
end
end