• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Summon spell

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hello,
i need a spell, when you say "karakoto" then you player summons 3monsters "dragon".
And if you have a summons, you cant do it.
For tfs 0.3.1 pl2 [8.4]
SQL:
 cryingdamson.

Thanks,
Erexo.

PS:
Im not good at english, so sorry :P
 
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
 
Back
Top