I'm adding a new feature to Lunar Scriptor
Its going to be precreated Lua Templates
I'm going to eventually make a template file type called '.ltmp'
Requirements On All Templates
1. There must be a '$' seperating the properties and the script
2. Creature Name must always be the very first property
3. Always make a comment listing the properties and in brackets their corresponding number(Its good for testing)
(maybe more to come)
Its very simple Heres the format
Code:
Creature Name
Spell Id
Spell Time
Creature Id
FunctionLabel
Code:
--[[
Creature Name: {1}
Spell Id: {2}
Spell Time: {3}
Creature Id: {4}
FunctionLabel: {5}
]]
-- {1}
function {5}_OnEnterCombat(pUnit,Event)
pUnit:RegisterEvent("{5}_SpellCast", {3}, 0)
end
function {5}_SpellCast(pUnit,Event)
pUnit:FullCastSpellOnTarget({2},pUnit:GetClosestPlayer())
end
function {5}_OnLeaveCombat(pUnit,Event)
pUnit:RemoveEvents()
end
function {5}_OnDied(pUnit,Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent({4}, 1, "{5}_OnEnterCombat")
RegisterUnitEvent({4}, 2, "{5}_OnLeaveCombat")
RegisterUnitEvent({4}, 4, "{5}_OnDied")
--[[
Created through Lunar Scriptor SingleSpell Mob Template
]]
Each line in the first corresponds to the bracketed number in the second
Together in the file type they should be like this
Code:
Creature Name
Spell Id
Spell Time
Creature Id
FunctionLabel(NoSpaces)
$
--[[
Creature Name: {1}
Spell Id: {2}
Spell Time: {3}
Creature Id: {4}
FunctionLabel: {5}
]]
-- {1}
function {5}_OnEnterCombat(pUnit,Event)
pUnit:RegisterEvent("{5}_SpellCast", {3}, 0)
end
function {5}_SpellCast(pUnit,Event)
pUnit:FullCastSpellOnTarget({2},pUnit:GetClosestPlayer())
end
function {5}_OnLeaveCombat(pUnit,Event)
pUnit:RemoveEvents()
end
function {5}_OnDied(pUnit,Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent({4}, 1, "{5}_OnEnterCombat")
RegisterUnitEvent({4}, 2, "{5}_OnLeaveCombat")
RegisterUnitEvent({4}, 4, "{5}_OnDied")
--[[
Created through Lunar Scriptor SingleSpell Mob Template
]]
The dollar sign is going to be used to seperate the two sections
I will +Rep anyone who writes one of these for me