Quantcast
Channel: World of Warcraft Info » Tutorials
Viewing all articles
Browse latest Browse all 10

How To Create A LUA Script For Attacks

$
0
0

Tutorial: Creating an Attack LUA Script to automate the process and allow you to have sharper response times and better results.

Follow along with the tutorial to see how to create it.

Copy and paste the code below the video to save some time.

Please note, this is the text from the tutorial. I typed it out when I grabbed the video. If it doesn’t work, it’s the code, visit d2-gaming for more help

The Code Sample


function CreatureX_Attack(Unit, event)
Unit:RegisterEvent("CreatureX_Shadowbolt", 6000, 0)
end

function CreatureX_Shadowbolt(Unit, event)
local rand = Unit:GetRandomPlayer(0)
if(rand ~= nil) then
Unit:FullCastSpellOnTarget(53333,rand)
Unit:RegisterEvent("CreatureX_Phase1", 1000, 0)
else
end
end

function CreatureX_Phase1(Unit, event)
if Unit:GetHealthPct() <= 60 then
Unit:RegisterEvent("CreatureX_ShadowVolley", 100000, 0)
end
end

function CreatureX_ShadowVolley(Unit, event)
Unit:FullCastSpellOnTarget(32963, Unit)
end

function CreatureX_OnDied(Unit, event)
Unit:RemoveEvents()
end

RegisterUnitEvent(69478,1, "CreatureX_Attack")
RegisterUnitEvent(69478,2, "CreatureX_OnDied")
RegisterUnitEvent(69478,4, "CreatureX_OnDied")

The post How To Create A LUA Script For Attacks appeared first on World of Warcraft Info.


Viewing all articles
Browse latest Browse all 10

Trending Articles