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

problem with 2 scripts

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
i have 2 spells, that cooldown or exhaust arnt working at all.

also would be greatful if they where done so they heal/damage more depending on either level/m lvl.

Code:
function onCastSpell(cid, var)
	local list = getSpectators(getCreaturePosition(cid), 5, 7, false)
	local creatures, t = {}, {}
 
	if(#list > 0) then
		for i = 1, #list do
			if(isCreature(list[i]) or isPlayer(list[i])) then
				table.insert(creatures, list[i])
			end
		end
	end
 
	table.insert(t, cid)
	for _, p in ipairs(creatures) do
		if p ~= cid then
			table.insert(t, p)
		end
	end
 
	if(#t > 0) then
		for i = 1, #t do
			doSendDistanceShoot(getCreaturePosition(t[i == 1 and i or i - 1]), getCreaturePosition(t[i]), CONST_ANI_ENERGYBALL)
			doTargetCombatHealth(cid, t[i], COMBAT_ENERGYDAMAGE, -100, -5000, CONST_ME_NONE)
		end
	end
end

second spell

Code:
function onCastSpell(cid, var)
	local list = getSpectators(getCreaturePosition(cid), 5, 7, false)
	local players, t = {}, {}
 
	if(#list > 0) then
		for i = 1, #list do
			if(isPlayer(list[i])) then
				table.insert(players, list[i])
			end
		end
	end
 
	table.insert(t, cid)
	for _, p in ipairs(players) do
		if p ~= cid then
			table.insert(t, p)
		end
	end
 
	if(#t > 0) then
		for i = 1, #t do
			doSendDistanceShoot(getCreaturePosition(t[i == 1 and i or i - 1]), getCreaturePosition(t[i]), CONST_ANI_SMALLICE)
			doTargetCombatHealth(0, t[i], COMBAT_HEALING, 1000 + (i * -50), 2000 + (i * -100), CONST_ME_MAGIC_BLUE)
		end
	end
end
 
in spells.xml :

<rune name="Sudden Death" id="2268" allowfaruse="1" charges="3" lvl="45" maglv="15" exhaustion="1000" needtarget="1" blocktype="solid" event="script" value="attack/sudden death.lua"/>
 
Qbee, thanks but i already know that, still not working.

Code:
<instant name="chain heal" words="ex san" lvl="9" mana="20" aggressive="0" selftarget="1" exhaustion="2000" groups="2" groupexhaustions="60000" needlearn="0" event="script" value="spells/chain heal.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
	</instant>
	
	<instant name="chain light" words="exmort" lvl="9" mana="20" aggressive="1" selftarget="1" exhaustion="2000" groups="1" groupexhaustions="60000" needlearn="0" event="script" value="spells/chain light.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
	</instant>
 
Back
Top