Ranyo13
ManCausingMayhem
- Joined
- Aug 22, 2009
- Messages
- 981
- Reaction score
- 39
Hello OTland !
Why Is it hard to make spells ... this is making me fed up ... i tried all ways but i fail doing custom spells on this (Cave Rat) Naxed OT 8
It Always gives me an error when the player is casting spells with different timings and dies before the spell is done ... so the spell is always following him ... then he dies .. so the spell doesnt find him so it sends an error that it doesnt find the player or creature ... thats how i understand it
and the buggy spell dont try to put it on ur ot >.<
[NOTE] : THIS SPELL ISN'T EVEN WORKING WITHOUT DIFFERENT TIMINGS IT STILL GIVES ME ERRORS !!
I Hope you guys (scripters or anything) Help me .... I am ina good mood ...
Please Help ....
Regards,
Ranyo
Why Is it hard to make spells ... this is making me fed up ... i tried all ways but i fail doing custom spells on this (Cave Rat) Naxed OT 8
It Always gives me an error when the player is casting spells with different timings and dies before the spell is done ... so the spell is always following him ... then he dies .. so the spell doesnt find him so it sends an error that it doesnt find the player or creature ... thats how i understand it
Code:
[12/09/2010 22:35:05] [Error - Spell Interface]
[12/09/2010 22:35:05] In a timer event called from:
[12/09/2010 22:35:05] data/spells/scripts/attack/blazing hur.lua:onCastSpell
[12/09/2010 22:35:05] Description:
[12/09/2010 22:35:05] (luaDoCombat) Creature not found
and the buggy spell dont try to put it on ur ot >.<
Code:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 4)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 25)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, 0, -3, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 15)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, 0, -3, 0)
arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
local area1 = createCombatArea(arr1)
setCombatArea(acombat1, area1)
local area2 = createCombatArea(arr2)
setCombatArea(acombat2, area2)
function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end
function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end
setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 0, parameters)
return TRUE
end
[NOTE] : THIS SPELL ISN'T EVEN WORKING WITHOUT DIFFERENT TIMINGS IT STILL GIVES ME ERRORS !!
I Hope you guys (scripters or anything) Help me .... I am ina good mood ...
Please Help ....
Regards,
Ranyo