Difference between revisions of "LUA:SummonPet"

(Created page with "= LUA Functions: SummonPet() = Summons a combat pet for the given spawn ==== Syntax ==== SummonPet(param1, param2) ==== Parameters ==== ; Required - ''param1'' (Spawn), ''para...")
 
 
Line 3: Line 3:
  
 
==== Syntax ====
 
==== Syntax ====
SummonPet(param1, param2)
+
SummonPet(param1, param2, [param3])
  
  
Line 10: Line 10:
 
: ''param1'' is the spawn getting the pet
 
: ''param1'' is the spawn getting the pet
 
: ''param2'' is the DB id of the pet to spawn
 
: ''param2'' is the DB id of the pet to spawn
 +
; Optional - ''param3'' (int8)
 +
: ''param3'' is the max level the pet can obtain
  
  
Line 28: Line 30:
  
 
A normal pet spell.
 
A normal pet spell.
 +
 +
== Notes ==
 +
If ''param3'' is left blank or set to 0 the pet will not have a level cap

Latest revision as of 18:22, 12 December 2013

LUA Functions: SummonPet()

Summons a combat pet for the given spawn

Syntax

SummonPet(param1, param2, [param3])


Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn getting the pet
param2 is the DB id of the pet to spawn
Optional - param3 (int8)
param3 is the max level the pet can obtain


Usage

function cast(Caster, Target)
	SummonPet(Caster, 340083)

end

function remove(Caster, Target)
	pet = GetPet(Caster)
	if pet ~= nil then
		DismissPet(pet)
	end
end

A normal pet spell.

Notes

If param3 is left blank or set to 0 the pet will not have a level cap