Nothxbye
Banned User
- Joined
- Jan 22, 2012
- Messages
- 1,124
- Reaction score
- 174
Code:
local combat = createCombatObject(COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS)
local t = {}
for a = 1, 400 do
t[a] = {}
for b = 0, 156 do
t[a][b] = createConditionObject(CONDITION_POISON)
setConditionParam(t[a][b], CONDITION_PARAM_MINVALUE, -1)
setConditionParam(t[a][b], CONDITION_PARAM_DELAYED, 1)
setConditionParam(t[a][b], CONDITION_PARAM_MAXVALUE, math.ceil(a / 3 + b / 3))
setConditionParam(t[a][b], CONDITION_PARAM_STARTVALUE, math.ceil(a / 3 + b / 3))
end
end
local arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onTargetCreature(cid, target)
if (isPlayer(target) == TRUE) then
doTargetCombatCondition(target, t[getPlayerLevel(cid)][getPlayerMagLevel(cid)], CONST_ME_NONE)
else
doTargetCombatCondition(target, t[getPlayerLevel(cid)*2][getPlayerMagLevel(cid)*2], CONST_ME_NONE)
end
return 1
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
This spell doesn't work properly, it work like this:
You lose 9 hitpoints.
You lose 8 hitpoints.
You lose 7 hitpoints.
ect ect..
But it should work like this.
You lose 9 hitpoints due to an attack by Tester.
You lose 8 hitpoints due to an attack by Tester.
You lose 7 hitpoints due to an attack by Tester.
ect ect..
And im afraid someone who attacking by this won't take a frag. How to fix it?