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

Arrow Shower - Talk Actions

Cosmotonio

New Member
Joined
Nov 26, 2007
Messages
142
Reaction score
0
someone help with my code?

Code:
function doShower(cid, type, y, x, effect, dano)

area = {fromx=(getPlayerPosition(cid)-x), fromy=(getPlayerPosition(cid)-y), 

tox=(getPlayerPosition(cid)+x), toy=(getPlayerPosition(cid)+y), z=(getPlayerPosition(cid))}


if dano == 1 then
	damage = -1
else
	damage = 1
end
	

danomin = (getPlayerLevel(cid)*0.75 + 30)*(damage)
danomax = (getPlayerLevel(cid)*1.10 + 30)*(damage)

	if getTilePzInfo(getCreaturePosition(cid)) == 0 then
		for i = area.fromx, area.tox do 
			for j = area.fromy, area.toy do 
           			local pos = {x=i, y=j, z=area.z, stackpos=253} 			
           			local getThing = getThingfromPos(pos).uid 
          				if isCreature(getThing) == 1 then 
						doTargetCombatHealth(cid, getThing, type, danomin, 

danomax, effect)
					end
			end
		end
	else
		doPlayerSendCancel(cid, 'You cannot use shower in PZ.')
	end


end





function onSay(cid, words, param)


cid = cid
if isSorcerer(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isDruid(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isPaladin(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isKnight(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

else
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW
end


doShower(cid, type, y, x, effect, dano)
end


Code:
[26/03/2008  21:14:03] Lua Script Error: [TalkAction Interface] 
[26/03/2008  21:14:03] data/talkactions/scripts/shower.lua:onSay

[26/03/2008  21:14:03] data/talkactions/scripts/shower.lua:3: attempt to perform arithmetic on a table value
 
Last edited:
will work now?

Code:
function doShower(cid, type, [B]y2[/B], [B]x2[/B], effect, dano)

area = {fromx=(getPlayerPosition(cid)-[B]x2[/B]), fromy=(getPlayerPosition(cid)-[B]y2[/B]), 

tox=(getPlayerPosition(cid)+[B]x2[/B]), toy=(getPlayerPosition(cid)+[B]y2[/B]), z=(getPlayerPosition(cid))}


if dano == 1 then
	damage = -1
else
	damage = 1
end
	

danomin = (getPlayerLevel(cid)*0.75 + 30)*(damage)
danomax = (getPlayerLevel(cid)*1.10 + 30)*(damage)

	if getTilePzInfo(getCreaturePosition(cid)) == 0 then
		for i = area.fromx, area.tox do 
			for j = area.fromy, area.toy do 
           			local pos = {x=i, y=j, z=area.z, stackpos=253} 			
           			local getThing = getThingfromPos(pos).uid 
          				if isCreature(getThing) == 1 then 
						doTargetCombatHealth(cid, getThing, type, danomin, 

danomax, effect)
					end
			end
		end
	else
		doPlayerSendCancel(cid, 'You cannot use shower in PZ.')
	end


end





function onSay(cid, words, param)


cid = cid
if isSorcerer(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isDruid(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isPaladin(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

elseif isKnight(cid) then
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW

else
	type = COMBAT_PHYSICALDAMAGE
	x = 7
	y = 6
	dano = 1
	effect = CONST_ANI_BURSTARROW
end


doShower(cid, type, y, x, effect, dano)
end
 
PHP:
function doShower(cid, type, y, x, effect, dano)
	local damage = dano == 1 and -1 or 1
	local danomin = (getPlayerLevel(cid)*0.75 + 30)*damage
	local danomax = (getPlayerLevel(cid)*1.10 + 30)*damage

	if getTilePzInfo(getCreaturePosition(cid)) == 0 then
		for x=getCreaturePosition(cid).x-x, getCreaturePosition(cid).x+x do 
			for y=getCreaturePosition(cid).y-y, getCreaturePosition(cid).y+y do 
				local position = {x=x, y=y, z=getCreaturePosition(cid).z, stackpos=253}
				if isCreature(getThingfromPos(position)) == 1 then 
					doTargetCombatHealth(cid, type, position, danomin, danomax, effect)
				end
			end
		end
	else
		doPlayerSendCancel(cid, 'You cannot use shower in PZ.')
	end
end

function onSay(cid, words, param)
	if isSorcerer(cid) then
		doShower(cid, COMBAT_PHYSICALDAMAGE, 7, 6, CONST_ANI_BURSTARROW, 1)
	elseif isDruid(cid) then
		doShower(cid, COMBAT_PHYSICALDAMAGE, 7, 6, CONST_ANI_BURSTARROW, 1)
	elseif isPaladin(cid) then
		doShower(cid, COMBAT_PHYSICALDAMAGE, 7, 6, CONST_ANI_BURSTARROW, 1)
	elseif isKnight(cid) then
		doShower(cid, COMBAT_PHYSICALDAMAGE, 7, 6, CONST_ANI_BURSTARROW, 1)
	else
		doShower(cid, COMBAT_PHYSICALDAMAGE, 7, 6, CONST_ANI_BURSTARROW, 1)
	end
end
 
Last edited:
Back
Top