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

Spells.xml

Bassam421

Lockout RPG/PVP Owner
Joined
Nov 8, 2008
Messages
359
Reaction score
7
Location
Sweden , Göteborg
Hello i really dont know how to do this.... i have made some spells for the server... but the spells dosent takes mana!

instant name="Apocalypse" words="exevo mas lux" lvl="300" manapercent="10" exhaustion="2000" needlearn="0" script="custom/apocalypse.lua">
<vocation name="Master Sorcerer"/>
</instant>


(manapercent?)
 
Apocalypse.lua:

Code:
local combat = createCombatObject()

arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}

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

function spellCallback(param)
	if param.count > 0 or math.random(0, 1) == 1 then
		doSendMagicEffect(param.pos, CONST_ME_HITBYFIRE)
		doAreaCombatHealth(param.cid, COMBAT_FIREDAMAGE, param.pos, 0, -100, -100, CONST_ME_EXPLOSIONHIT)
	end

	if(param.count < 5) then
		param.count = param.count + 1
		addEvent(spellCallback, math.random(1000, 4000), param)
	end
end

function onTargetTile(cid, pos)
	local param = {}
	param.cid = cid
	param.pos = pos
	param.count = 0
	spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

XML:

Code:
	<instant name="Apocalypse" words="exevo mas lux" lvl="400" manapercent="60" exhaustion="2000" needlearn="0" script="custom/apocalypse.lua">
		<vocation name="Sorcerer"/>
		<vocation name="Master Sorcerer"/>
		<vocation name="Super Sorcerer" />
	</instant>
 
Back
Top