• 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!

How do i make a costum summon spell for some voc?

Kisskotte

New Member
Joined
May 26, 2008
Messages
60
Reaction score
1
Hello

I'm haveing a little bit of a problem I have 3 voc that will have diffrent kind of summon's but i want them to be seperate so they can't summon the other once summon. But in my server The Forgotten Server 0.2.11pl2 the summon is a function? :o and I have no ide how to work around that and make this happened.

the three voc that i want to have a summon is

*Shaman - crystalwolfs.

*Priest - Holy guardian.

*Mage - Fire and water elemental.

/R.
 
ex. make a new spell called "Summoning Fire Elemental.lua" and add this:

LUA:
function onCastSpell(cid, var)
	return doConvinceCreature(cid, doSummonCreature("Fire Elemental", pos))
end

And do this to all another profesions.
Do not forgot to set correct vocations in your spells.xml!
 
LUA:
function onCastSpell(cid, var)

local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)

if(dir==1)then
	pos.x = pos.x + 1
elseif(dir==2)then
	pos.y = pos.y + 1
elseif(dir==3)then
	pos.x = pos.x - 1
elseif(dir==0)then
	pos.y = pos.y - 1
end
	doConvinceCreature(cid, doCreateMonster("Fire Elemental", pos))
	return True
end
 
Code:
function onSay(cid, words, param, channel)
 
local level = 30
local mana = 200
local vocsCanUse = {1, 2, 3, 4, 5, 6, 7,8}
local condition = CONDITION_DRUNK
local canBeSummoned = {"Dog", "Troll", "Bug", "Fire Devil", "Fire Elemental"}
 
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "Your level is too low.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then
		doPlayerSendCancel(cid, "Your vocation cannot use this spell.")
		return TRUE
	end
 
	if getCreatureCondition(cid, condition) == FALSE then
		doPlayerSendCancel(cid, "You need to be drunked to use this spell.")
		return TRUE
	end
 
	if(not isInArray(canBeSummoned, param)) then
		doPlayerSendCancel(cid, "You cannot summon this creature.")
		return TRUE
	end
 
	doSummonCreature(param, getCreaturePosition(cid), FALSE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
Change the names of the monsters to the monsters you want, and change the vocation that could use it.
that requires each one a script.
Like : Priest should be like:
Code:
function onSay(cid, words, param, channel)
 
local level = 30
local mana = 200
local vocsCanUse = {[You should change this as the numbers of vocs in your XML folder VOCATIONS number or just type [Priest]..}
local condition = CONDITION_DRUNK
local canBeSummoned = {"Crystal Wolf"}
 
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "Your level is too low.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then
		doPlayerSendCancel(cid, "Your vocation cannot use this spell.")
		return TRUE
	end
 
	if getCreatureCondition(cid, condition) == FALSE then
		doPlayerSendCancel(cid, "You need to be drunked to use this spell.")
		return TRUE
	end
 
	if(not isInArray(canBeSummoned, param)) then
		doPlayerSendCancel(cid, "You cannot summon this creature.")
		return TRUE
	end
 
	doSummonCreature(param, getCreaturePosition(cid), FALSE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
Credits to: Darkhaos
Rep if I helped.
 
Last edited:
@up always try to give credits.. I saw u in other threads calling others "stealers" cause they didn't, and now u are doing the same thingy :o
 
Code:
function onSay(cid, words, param, channel)
 
local level = 30
local mana = 200
local vocsCanUse = {1, 2, 3, 4, 5, 6, 7,8}
local condition = CONDITION_DRUNK
local canBeSummoned = {"Dog", "Troll", "Bug", "Fire Devil", "Fire Elemental"}
 
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "Your level is too low.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then
		doPlayerSendCancel(cid, "Your vocation cannot use this spell.")
		return TRUE
	end
 
	if getCreatureCondition(cid, condition) == FALSE then
		doPlayerSendCancel(cid, "You need to be drunked to use this spell.")
		return TRUE
	end
 
	if(not isInArray(canBeSummoned, param)) then
		doPlayerSendCancel(cid, "You cannot summon this creature.")
		return TRUE
	end
 
	doSummonCreature(param, getCreaturePosition(cid), FALSE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
Change the names of the monsters to the monsters you want, and change the vocation that could use it.
that requires each one a script.
Like : Priest should be like:
Code:
function onSay(cid, words, param, channel)
 
local level = 30
local mana = 200
local vocsCanUse = {[You should change this as the numbers of vocs in your XML folder VOCATIONS number or just type [Priest]..}
local condition = CONDITION_DRUNK
local canBeSummoned = {"Crystal Wolf"}
 
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "Your level is too low.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if getCreatureMana(cid) < mana then
		doPlayerSendCancel(cid, "You do not have enough mana.")
		return TRUE
	end
 
	if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then
		doPlayerSendCancel(cid, "Your vocation cannot use this spell.")
		return TRUE
	end
 
	if getCreatureCondition(cid, condition) == FALSE then
		doPlayerSendCancel(cid, "You need to be drunked to use this spell.")
		return TRUE
	end
 
	if(not isInArray(canBeSummoned, param)) then
		doPlayerSendCancel(cid, "You cannot summon this creature.")
		return TRUE
	end
 
	doSummonCreature(param, getCreaturePosition(cid), FALSE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	return TRUE
end
Credits to: Darkhaos
Rep if I helped.

Can I have a Spell Line please? Cause don't really understand how I should put this in the Spells.xml?
 
Heres the line put it in spells.xml [].

Code:
<rune name="Summoner" id="2307" allowfaruse="1" charges="1" lvl="50" maglv="1" exhaustion="3000" needtarget="1" blocktype="solid" script="customspell.lua"/>
<vocation name="Druid"/><vocation name="Sorcerer"/><vocation name="Paladin"/><vocation name="Elder Druid"/><vocation name="Master Sorcerer"/><vocation name="Royal Paladin"/>
If it didn't work
Then put this line in talkactions.xml, and put the script in talkactions > scripts
Code:
<talkaction words="/summon" hide="yes" event="script" value="customspell.lua"/>
This one should work perfect.
Make sure, to put the script in talkactions > SCRIPTS, if the spells one didn't work
So it will be a talkaction script.
 
Back
Top