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

Charge with 2x3 aura.

Drazzio

New Member
Joined
May 10, 2011
Messages
5
Reaction score
0
Hello. I have one problem with my spell.

Effect of spell must start a one sqm right from player. Something like this.
position = {x=pos.x -1,y=pos.y,z=pos.z}
doSendMagicEffect(position, 181)
But this don't work and i have error.
[11/11/2011 21:25:04] [Error - Spell Interface]
[11/11/2011 21:25:04] In a timer event called from:
[11/11/2011 21:25:04] data/spells/scripts/support/charge.lua:eek:nCastSpell
[11/11/2011 21:25:04] Description:
[11/11/2011 21:25:04] data/spells/scripts/support/charge.lua:10: attempt to index global 'pos' (a nil value)
[11/11/2011 21:25:04] stack traceback:
[11/11/2011 21:25:04] data/spells/scripts/support/charge.lua:10: in function <data/spells/scripts/support/charge.lua:6>
When i use spell effect has gone.

Sorry, but i don't really gut speak english :p
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 24*60*1000)
function statup(cid)
if getPlayerStorageValue(cid,50000) == 1 and getPlayerLevel(cid) > 200 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
position = {x=pos.x -1,y=pos.y,z=pos.z}
doSendMagicEffect(position, 181)
elseif getPlayerStorageValue(cid,50000) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 182)
elseif getPlayerStorageValue(cid,50001) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 16)
elseif getPlayerStorageValue(cid,50002) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 17)
elseif getPlayerStorageValue(cid,50003) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 18)
elseif getPlayerStorageValue(cid,50004) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 19)
elseif getPlayerStorageValue(cid,50005) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 20)
end
end

function check1(cid)
if (hasCondition(cid, CONDITION_DRUNK) == TRUE) then
if (hasCondition(cid, CONDITION_INFIGHT) == FALSE) then
if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then
if getCreatureMana(cid) == getCreatureMaxMana(cid) then
mayNotMove(cid, 0)
doRemoveCondition(cid, CONDITION_DRUNK)
doCreatureSetStorage(cid, 6, 0)
else
addEvent(statup,500,cid)
addEvent(check1,500,cid)
end
else
addEvent(statup,500,cid)
addEvent(check1,500,cid)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, CONDITION_DRUNK)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, CONDITION_DRUNK)
end
end

function onCastSpell(cid, var)
if(hasCondition(cid, CONDITION_INFIGHT) == FALSE) then
if(hasCondition(cid, CONDITION_DRUNK) == FALSE) then
doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)
mayNotMove(cid, 1)
doCreatureSetStorage(cid, 6, 1)
addEvent(check1,1000,cid)
return doCombat(cid, combat, var)
end
else
doPlayerSendCancel(cid, "You cannot start charging power if you are in fight.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end

Can some one help me ?

@edit

local p = getCreaturePosition(cid)
local Position = {x = p.x+1, y = p.y, z = p.z}
doSendMagicEffect(Position, 181)

Some one can close topic.
 
Last edited:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 24*60*1000)
function statup(cid)
if getPlayerStorageValue(cid,50000) == 1 and getPlayerLevel(cid) > 200 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
position = [COLOR="#FF0000"]{x=pos.x[/COLOR],y=pos.y,z=pos.z}
doSendMagicEffect(position, 181) 
elseif getPlayerStorageValue(cid,50000) == 1 then
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 182)
elseif getPlayerStorageValue(cid,50001) == 1 then 
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 16)
elseif getPlayerStorageValue(cid,50002) == 1 then 
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 17)
elseif getPlayerStorageValue(cid,50003) == 1 then 
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 18)
elseif getPlayerStorageValue(cid,50004) == 1 then 
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 19)
elseif getPlayerStorageValue(cid,50005) == 1 then 
doCreatureAddHealth(cid,(getCreatureMaxHealth(cid) * 0.05))
doCreatureAddMana(cid,(getCreatureMaxMana(cid) * 0.05))
doSendMagicEffect(getPlayerPosition(cid), 20)
end
end

function check1(cid)
if (hasCondition(cid, CONDITION_DRUNK) == TRUE) then
if (hasCondition(cid, CONDITION_INFIGHT) == FALSE) then
if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then
if getCreatureMana(cid) == getCreatureMaxMana(cid) then
mayNotMove(cid, 0)
doRemoveCondition(cid, CONDITION_DRUNK)
doCreatureSetStorage(cid, 6, 0)
else
addEvent(statup,500,cid)
addEvent(check1,500,cid)
end
else
addEvent(statup,500,cid) 
addEvent(check1,500,cid)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, CONDITION_DRUNK)
end
else
mayNotMove(cid, 0)
stopEvent(statup)
stopEvent(check1)
doRemoveCondition(cid, CONDITION_DRUNK)
end
end

function onCastSpell(cid, var)
if(hasCondition(cid, CONDITION_INFIGHT) == FALSE) then 
if(hasCondition(cid, CONDITION_DRUNK) == FALSE) then 
doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)
mayNotMove(cid, 1)
doCreatureSetStorage(cid, 6, 1)
addEvent(check1,1000,cid) 
return doCombat(cid, combat, var)
end
else
doPlayerSendCancel(cid, "You cannot start charging power if you are in fight.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
 
Back
Top