Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 746
- Solutions
- 9
- Reaction score
- 125
Hello everybody! I've been away from OTS for so long that I dont recognize half of it!
I'd like some help with this code, its for 0.3.x im using 1.2 actually, so it isnt working.
[/CODE]
Also, i'd like to know how should i refer to this spell on spells.lua
Thank you in advance!
I'd like some help with this code, its for 0.3.x im using 1.2 actually, so it isnt working.
Code:
[code=lua]local max = 3
function onCastSpell(cid, var)
local count, pos = #getCreatureSummons(cid), getThingPos(cid)
if count == max then
doPlayerSendCancel(cid, 'You cannot summon more creatures.')
doSendMagicEffect(pos, CONST_ME_POFF)
return FALSE
end
for i = 1, max - count do
local v = doSummonMonster(cid, 'Dragon')
if v ~= 1 then
doPlayerSendDefaultCancel(cid, v)
doSendMagicEffect(pos, CONST_ME_POFF)
if i == 1 then
return FALSE
else
return TRUE
end
end
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[count+i]), CONST_ME_TELEPORT)
end
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
return TRUE
end
Also, i'd like to know how should i refer to this spell on spells.lua
Thank you in advance!