narko
vertrauenswürdig ~
PHP:
local combat = createCombatObject()
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 spellCallbackLifeDrainArea(param)
if (isPlayer(param.cid)) == 1 then
if (param.hitmin == nil or param.hitmax == nil or param.healmin == nil or param.healmax == nil) then
param.hitmin = math.floor(-getPlayerLevel(param.cid) * 0.3 + -getPlayerMagLevel(param.cid) * 4.8)
param.hitmax = math.floor(-getPlayerLevel(param.cid) * 0.35 + -getPlayerMagLevel(param.cid) * 5.8)
param.healmin = -param.hitmin
param.healmax = -param.hitmax
end
local onPos = param.pos
if param.count > 0 or math.random(0, 1) == 1 then
local creatureToHit = getThingfromPos({x=onPos.x,y=onPos.y,z=onPos.z,stackpos=STACKPOS_TOP_CREATURE})
if isCreature(creatureToHit.uid) == 1 and creatureToHit.uid ~= param.cid then
doPlayerAddMana(param.cid, math.random(param.healmin, param.healmax+1))
doAreaCombatHealth(param.cid, COMBAT_LIFEDRAIN, param.pos, 0, param.hitmin, param.hitmax, CONST_ME_BUBBLES)
end
end
if(param.count < 30) then
param.count = param.count + 1
addEvent(spellCallbackLifeDrainArea, 500, param)
end
end
end
function onTargetTileLifeDrainArea(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallbackLifeDrainArea(param)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTileLifeDrainArea")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
I need to fix this spell for tfs 0.3.6.
This spell works with 0.2.7
please fix to tfs 0.3.6
i gives REP points