• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Summon Spell that Summons only one creature.

Oneda

Aspiring Spriter
Joined
Dec 3, 2013
Messages
159
Solutions
2
Reaction score
104
Location
Brazil
Well, hello there.

I need a summon spell, that would create only one creature (defined on the script).
Would work just like utevo res, but without being able to define which creature you're going to summon.
Also, with a mana requirement.

Server Version: TFS036

(Btw, I did searched for it on the forums, but couldn't find anything)
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

local maxsumons = 2

function onCastSpell(cid, var)
local summoncount = getCreatureSummons(cid)
if #summoncount < 2 then
for i = 1, maxsumons - #summoncount do
doSummonMonster(cid, "Undead Gladiator")
end
end
return doCombat(cid, combat, var)
end
 
<instant name="Summon Creature" words="utevo res" lvl="25" params="1" exhaustion="2000" needlearn="0" event="function" value="summonMonster">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="5"/>
<vocation id="6"/>
</instante>


Now you edit this to accomodate your script you created with the code in the up post
 
Worked, but...
Is it possible that you make it to summon only one but still with the 3 summons limit? Cuz I want to make 6 different spells, it's for a illusionist vocation, then the player would be able to summon like 3 different monsters.

Thank you anyways! :D
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

local maxsumons = 2
local limittoone = 1

function onCastSpell(cid, var)
local summoncount = getCreatureSummons(cid)
if #summoncount < 2 then
if #limittoone < 1
for i = 1, maxsumons - #summoncount do
doSummonMonster(cid, "Undead Gladiator")
limittoone = 2
end
end
end
return doCombat(cid, combat, var)
end



I HAVE NO IDEA IF THIS WORKS, IM A NEW SCRIPTER, IM LEARNING.
If it gives an error there are 2 things you can try to change
one is to take off the "#" of limittoone < 1. I don't know what that is, im just trying to help.
 
Yea, my bad. Only learned about the Then yesterday hahaha
Haha looks like there is a new scripter Coming :)
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

local maxsumons = 2
local limittoone = 1

function onCastSpell(cid, var)
local summoncount = getCreatureSummons(cid)
if #summoncount ~= nil and #summoncount < 2 then
if #limittoone < 1 then
for i = 1, maxsumons - #summoncount do
doSummonMonster(cid, "Undead Gladiator")
limittoone = 2
end
end
end
return doCombat(cid, combat, var)
end
Please use Code Tags
For Ex:
[.CODE]
Your Code
[/CODE]
 
Back
Top