Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
trying to convert this script to 1.2. As of right now the aura turns on, but the actual aura does not work. I am sure the script is far from correct. Any help is appreciated.
Code:
local aurastr = 25950 -- storage of aura
local estr = 25951 -- storage for exhaust
local porcentagem = 40 -- chance to heal in every turn of the aura, in percentage
local quantheal = 2 -- percentage of the maximum hp each healing will heal . (In the case, will cure 10% of maximum hp each cure)
local tempo = 1800 -- time to go around the player (this time was what I found most visually pleasing, it is recommended not to change)
local tipoaura = 38 -- effect of number aura (distance effect, can be identified by !x in the game) 37
local efeitocura = 49 -- effect curing when the number reaches the player (fixed position effect, can be identified with !z in the game)
-- calling function the aura
local function Aura(i,tm,cid)
local player = Player(cid)
if not player then
return true
end
local playerPos = player:getPosition()
local posaura = {
{x=(playerPos.x)-1, y=(playerPos.y)-1, z=playerPos.z},
{x=playerPos.x, y=(playerPos.y)-1, z=playerPos.z},
{x=(playerPos.x)+1, y=(playerPos.y)-1, z=playerPos.z},
{x=(playerPos.x)+1, y=playerPos.y, z=playerPos.z},
{x=(playerPos.x)+1, y=(playerPos.y)+1, z=playerPos.z},
{x=playerPos.x, y=(playerPos.y)+1, z=playerPos.z},
{x=(playerPos.x)-1, y=(playerPos.y)+1, z=playerPos.z},
{x=(playerPos.x)-1, y=playerPos.y, z=playerPos.z},
}
local chances = math.random(100)
if(chances<=porcentagem/8 and playergetHealth(cid)<player:getMaxHealth()) then
player:AddHealth(player:getMaxHealth()/quantheal)
if(i<=8 and i>1) then
doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, playerPos, tipoaura)
else
doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, playerPos, tipoaura)
end
doSendMagicEffect(playerPos, efeitocura)
end
if(i==8) then
doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, tipoaura)
elseif(i<8) then
doSendDistanceShoot({x=posaura[i].x, y=posaura[i].y, z=posaura[i].z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, tipoaura)
end
if i <= 8 and player:getStorageValue(aurastr) ==2 then
i = i + 1
tm = tempo/8
return addEvent(Aura,tm,i,tm)
elseif i > 8 and player:getStorageValue(aurastr) ==2 then
return Aura(1,0,cid)
else
return true
end
end
-- main Function
function onSay(player, words, param)
if param == "on" then
if player:getStorageValue(estr) > os.time() then
player:sendCancelMessage("You must wait "..(player:getStorageValue(estr) - os.time()).." seconds to enable aura again.")
else
if player:getStorageValue(aurastr) == 2 then
player:sendCancelMessage("Your aura is already enabled.")
elseif player:getStorageValue(aurastr) ==-1 then
player:sendCancelMessage("Aura On!")
player:setStorageValue(aurastr, 2)
Aura(1,tempo/8)
end
end
elseif param == "off" then
if player:getStorageValue(aurastr) ==2 then
player:setStorageValue(estr, os.time()+2)
player:setStorageValue(aurastr, -1)
player:sendCancelMessage("Aura off!")
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Enter '!Aura on' to turn aura on and '!Aura off' to turn it off.")
end
return true
end