local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, FIGHTINGDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 112)
arr1s = {
{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, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 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},
{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},
}
local dynpun1 = createCombatArea{
{1, 0, 0},
{0, 2, 0},
{0, 0, 0},
}
local dynpun2 = createCombatArea{
{0, 0, 0},
{0, 2, 0},
{0, 0, 1},
}
local dynpun3 = createCombatArea{
{0, 0, 0},
{1, 2, 0},
{0, 0, 0},
}
local dynpun4 = createCombatArea{
{0, 0, 1},
{0, 2, 0},
{0, 0, 0},
}
local dynpun5 = createCombatArea{
{0, 0, 0},
{0, 2, 0},
{0, 1, 0},
}
local area1 = createCombatArea(arr1s)
setCombatArea(combat1, area1)
local function onCastSpell1(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end
function onCastSpell(cid, var)
doCreatureSay(cid, "DYNAMIC PUNCH!", TALKTYPE_MONSTER)
if getPlayerStorageValue(cid, 3) >= 1 then
doSendAnimatedText(getThingPos(cid), "MISS", 215)
setPlayerStorageValue(cid, 3, -1)
return true
end
if getPlayerStorageValue(cid, 5) >= 1 then
if math.random(1,100) <= 33 then
doSendAnimatedText(getThingPos(cid), "SELF HIT", 180)
if isPlayer(getCreatureTarget(cid)) then
huah = getPlayerLevel(getCreatureTarget(cid))
else
huah = getPlayerLevel(getCreatureMaster(getCreatureTarget(cid)))
end
local levels = huah
doTargetCombatHealth(getCreatureTarget(cid), cid, COMBAT_PHYSICALDAMAGE, -(math.random((levels*3),(levels*5))), -((math.random((levels*3),(levels*5))+10)), 3)
return true
end
end
local function punch(params)
if isCreature(getCreatureTarget(params.cid)) then
if isMonster(params.cid) then
doAreaCombatHealth(getCreatureSummons(cid)[1], null, getThingPos(getCreatureTarget(params.cid)), params.ar, 0, 0, 17)
else
end
else
end
end
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(punch, 50, {cid = cid, ar = dynpun1})
addEvent(punch, 150, {cid = cid, ar = dynpun2})
addEvent(punch, 450, {cid = cid, ar = dynpun3})
addEvent(punch, 550, {cid = cid, ar = dynpun4})
addEvent(punch, 750, {cid = cid, ar = dynpun5})
return TRUE
end