• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Controlled Attack

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
278
Solutions
1
Reaction score
50
Location
Paraná,Brazil
Warning:
NO PERMISSION FOR POSTING THIS SCRIPT IN ANOTHER FORUMS
FOR PERMISSION/HELP: MSN:
[email protected]


Pretext:
Hello, this is my first topic in OtLand (this account was inative), and I decided to bring you a script from my own.
I'll not explain the script too much, there's a video which explain better what's the script que explica melhor o que o script faz.

Explaining:
The script is basically an attack that has a route controlled by yourself, using ctrl + arrows, to direct the attack.
• Limited control time
• No protection-zone effect
• Damages are: player's level (min) / player's level x 3 (max)
• Spend mana: player's level x 6

Script:
[data/actions/scripts/cattack.lua]
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	minMana = getPlayerLevel(cid) * 6
	onoff = 4956
	quantx = 0
	quanty = 0

function setAxis()
	o = getPlayerPosition(cid)
	xe = o.x
	ye = o.y
	ze = o.z
	tempo = 3
	velocidade = 150
end

function doEffect()
pos = {x=xe+quantx,y=ye+quanty,z=ze}

if getPlayerMana(cid) < minMana then
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
elseif getTilePzInfo(pos) == FALSE then
	local ef = 6
	of = 2
	doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos, 0, -getPlayerLevel(cid), -getPlayerLevel(cid) * 3, ef)
	-- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."")
else
	doSendMagicEffect(pos,of)
	-- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."")
end
addEvent(checkDir,velocidade)
end


function checkPer()
if getPlayerStorageValue(cid,work) == 1 then
checkTime()
end
end

function checkTime()
if tempo > 0 then
doEffect()
else
stop()
end
end

function stop()
	posi = {x=xe+quantx,y=ye+quanty,z=ze}
	doSendMagicEffect(posi,49)
	doSendAnimatedText(posi,"...",TEXTCOLOR_YELLOW)
	setPlayerStorageValue(cid,onoff,0)
	doPlayerSetNoMove(cid,0)
	addEvent(doPlayerSendCancel,800,cid,"Tempo restante: 0.")
end

function minusTime()
if getPlayerStorageValue(cid,onoff) == 0 then
elseif tempo > 0 then
	doPlayerSendCancel(cid,"Tempo restante: "..tempo..".")
	tempo = tempo - 1
	addEvent(minusTime,1000)
elseif tempo == 0 then
	stop()
	end
end

function checkDir()
po = getCreatureLookDirection(cid)


if po == NORTH then
	quanty = quanty - 1
elseif po == SOUTH then
	quanty = quanty + 1
elseif po == WEST then
	quantx = quantx - 1
elseif po == EAST then
	quantx = quantx + 1
end
checkPer()
end 

if getTilePzInfo(getPlayerPosition(cid)) == TRUE then
	doSendAnimatedText(getPlayerPosition(cid),"PZ!",TEXTCOLOR_YELLOW)
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
elseif getPlayerMana(cid) < minMana then
	doSendAnimatedText(getPlayerPosition(cid),"MANA",TEXTCOLOR_LIGHTBLUE)
	doPlayerSendCancel(cid,"Você precisa de "..minMana.." de mana para isso.")
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
elseif getPlayerStorageValue(cid,onoff) == 0 then
	setPlayerStorageValue(cid,work,1)
	setPlayerStorageValue(cid,onoff,1)
	doPlayerAddMana(cid,-minMana)
	doPlayerSetNoMove(cid,1)
	setAxis()
	minusTime()
	checkDir()
else
	doPlayerSendCancel(cid,"Contagem cancelada.")
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
	doPlayerSetNoMove(cid,0)
end

return TRUE
end

"velocidade = 150": speed in milliseconds
"tempo = 3": time in seconds

Tag:
[data/actions/actions.xml]
Code:
<action itemid="xxx" script="cattack.lua"/>
Ps. xxx is equal to the utilized item id

Vídeo:
[video=youtube;919fCAxFYfY]http://www.youtube.com/watch?v=919fCAxFYfY&feature=channel_video_title[/video]

And yes, I'm brazilian :P
 
Last edited:
Awesome!
But i cannot convert that intro a spell :(
Someone can do that?

@edit
my next idea;
when that effect reach first target, then locked at him.
 
Last edited:
minMana = getPlayerLevel(cid) * 0

Not sure if it would works...
 
minMana = getPlayerLevel(cid) * 0

Not sure if it would works...

It should work,
but you can test this too (I don't know if it works, don't tested it)
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	onoff = 4956
	quantx = 0
	quanty = 0

function setAxis()
	o = getPlayerPosition(cid)
	xe = o.x
	ye = o.y
	ze = o.z
	tempo = 3
	velocidade = 150
end

function doEffect()
pos = {x=xe+quantx,y=ye+quanty,z=ze}

if getTilePzInfo(pos) == FALSE then
	local ef = 6
	of = 2
	doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos, 0, -getPlayerLevel(cid), -getPlayerLevel(cid) * 3, ef)
	-- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."")
else
	doSendMagicEffect(pos,of)
	-- doPlayerSendCancel(cid,"x = "..xe+quantx..", y = "..ye+quanty..", z = "..ze.."")
end
addEvent(checkDir,velocidade)
end


function checkPer()
if getPlayerStorageValue(cid,work) == 1 then
checkTime()
end
end

function checkTime()
if tempo > 0 then
doEffect()
else
stop()
end
end

function stop()
	posi = {x=xe+quantx,y=ye+quanty,z=ze}
	doSendMagicEffect(posi,49)
	doSendAnimatedText(posi,"...",TEXTCOLOR_YELLOW)
	setPlayerStorageValue(cid,onoff,0)
	doPlayerSetNoMove(cid,0)
	addEvent(doPlayerSendCancel,800,cid,"Tempo restante: 0.")
end

function minusTime()
if getPlayerStorageValue(cid,onoff) == 0 then
elseif tempo > 0 then
	doPlayerSendCancel(cid,"Tempo restante: "..tempo..".")
	tempo = tempo - 1
	addEvent(minusTime,1000)
elseif tempo == 0 then
	stop()
	end
end

function checkDir()
po = getCreatureLookDirection(cid)


if po == NORTH then
	quanty = quanty - 1
elseif po == SOUTH then
	quanty = quanty + 1
elseif po == WEST then
	quantx = quantx - 1
elseif po == EAST then
	quantx = quantx + 1
end
checkPer()
end 

if getTilePzInfo(getPlayerPosition(cid)) == TRUE then
	doSendAnimatedText(getPlayerPosition(cid),"PZ!",TEXTCOLOR_YELLOW)
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
elseif getPlayerStorageValue(cid,onoff) == 0 then
	setPlayerStorageValue(cid,work,1)
	setPlayerStorageValue(cid,onoff,1)
	doPlayerSetNoMove(cid,1)
	setAxis()
	minusTime()
	checkDir()
else
	doPlayerSendCancel(cid,"Contagem cancelada.")
	setPlayerStorageValue(cid,work,0)
	setPlayerStorageValue(cid,onoff,0)
	doPlayerSetNoMove(cid,0)
end

return TRUE
end
 
Can U make it To a spell ? :) and do One who look Like exori san and one who Look like exori hur ? :)
 
Can U make it To a spell ? :) and do One who look Like exori san and one who Look like exori hur ? :)

Do it by your self, take a look in the spell u want to look like and this script, not hard.
 
Cara, ajuda ai, como fazer isso para tibia 9.1 ? ~~ Hey man, help me please, how to made this for tibia 9.1 ?
 
Cara, ajuda ai, como fazer isso para tibia 9.1 ? ~~ Hey man, help me please, how to made this for tibia 9.1 ?

nem sabia que tinha ot 9.1 hsaeisuh , mas tipo , nem funfou ?
se não funcionou me add no msn ae , tá na segunda linha do tópico , fica mais fácil de te ajudar.
abraço.

wow , i didn't even know there was 9.1v otservers, but , it didn't work ?
if not, add me on msn , its on topic's 2nd line , a lot easier to help you.
kisses in your mouth
 
Back
Top