Difference between revisions of "LUA:Spells"

Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://ojaperiwiva.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://ojaperiwiva.co.cc CLICK HERE]=
 
----
 
</div>
 
 
== The LUA Scripting System: Spells ==
 
== The LUA Scripting System: Spells ==
 
Describe purpose, examples, our chosen folder structure for script storage.
 
Describe purpose, examples, our chosen folder structure for script storage.
 +
  
 
Spells are controlled by (mainly) 3 tables: spell_tiers, spells and spell_classes and can be used to create all manner of spells.
 
Spells are controlled by (mainly) 3 tables: spell_tiers, spells and spell_classes and can be used to create all manner of spells.
  
It would be wise to have a read over [[Developer:Spells]]
+
 
 +
It would be wise to have a read over [[Spells]]
 +
 
  
 
There are 3 main functions in a spell: cast, remove and tick. You should get familiar with these and how they are used.
 
There are 3 main functions in a spell: cast, remove and tick. You should get familiar with these and how they are used.
  
&lt;pre>
+
<pre>
 
function cast(Caster, Target, DamageType, Damage)
 
function cast(Caster, Target, DamageType, Damage)
  
Line 28: Line 23:
 
     SpellDamage(Target, 6, 30)
 
     SpellDamage(Target, 6, 30)
 
end
 
end
&lt;/pre>
+
</pre>
  
 
== Examples ==  
 
== Examples ==  
  
 
HP Buff
 
HP Buff
&lt;pre>
+
<pre>
 
--main process function
 
--main process function
 
function cast(Caster, Target, DamageType, Damage)
 
function cast(Caster, Target, DamageType, Damage)
Line 46: Line 41:
 
SetMaxHP(Target, (GetMaxHP(Target) - 50))
 
SetMaxHP(Target, (GetMaxHP(Target) - 50))
 
end
 
end
&lt;/pre>
+
</pre>
  
 
Heal
 
Heal
&lt;pre>
+
<pre>
 
--main process function
 
--main process function
 
function cast(Caster, Target, DamageType, Damage)
 
function cast(Caster, Target, DamageType, Damage)
Line 59: Line 54:
 
function remove(Caster, Target)
 
function remove(Caster, Target)
 
end
 
end
&lt;/pre>
+
</pre>
  
 
Runspeed
 
Runspeed
&lt;pre>
+
<pre>
 
function cast(Caster, Target, DamageType, Damage)
 
function cast(Caster, Target, DamageType, Damage)
 
SetSpeed(Player, 100)
 
SetSpeed(Player, 100)
Line 70: Line 65:
 
         SetSpeed(Player, 1)
 
         SetSpeed(Player, 1)
 
end
 
end
&lt;/pre>
+
</pre>
 
 
  
  
[[Developer:LUA_Functions | Back to LUA]]
+
[[LUA|Back to LUA]]

Revision as of 15:54, 12 February 2012

The LUA Scripting System: Spells

Describe purpose, examples, our chosen folder structure for script storage.


Spells are controlled by (mainly) 3 tables: spell_tiers, spells and spell_classes and can be used to create all manner of spells.


It would be wise to have a read over Spells


There are 3 main functions in a spell: cast, remove and tick. You should get familiar with these and how they are used.

function cast(Caster, Target, DamageType, Damage)

end

function remove(Caster, Target)

end

function tick(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)
    SpellDamage(Target, 6, 30)
end

Examples

HP Buff

--main process function
function cast(Caster, Target, DamageType, Damage)
	SetMaxHP(Target, (GetMaxHP(Target) + 50))
end

function tick(Caster, Target, DDType, MinDDVal, MaxDDVal, EffectType, MinEffectVal, MaxEffectVal)

end

function remove(Caster, Target)
	SetMaxHP(Target, (GetMaxHP(Target) - 50))
end

Heal

--main process function
function cast(Caster, Target, DamageType, Damage)
	-- syntax for SpellDamage is Target, DamageType, and Damage
	--SpellDamage(Target, DamageType, Damage)
	ModifyHP(Caster, 20) 
end

function remove(Caster, Target)
end

Runspeed

function cast(Caster, Target, DamageType, Damage)
	SetSpeed(Player, 100)
end

function remove(Caster, Target)
        SetSpeed(Player, 1)
end


Back to LUA