function onAttack(cid, target)
local t = {
profession = 1337, -- storage of profression
statchange = 1338, -- storage to store attacks
displayCharges = true -- display message of their charge?
}
local conditions = {
local knight = createConditionObject(CONDITION_ATTRIBUTES),
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 130),
setConditionParam(condition, CONDITION_PARAM_BUFF, true),
local paladin = createConditionObject(CONDITION_ATTRIBUTES),
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 130),
setConditionParam(condition, CONDITION_PARAM_BUFF, true),
local mage = createConditionObject(CONDITION_ATTRIBUTES),
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
setConditionParam(condition, CONDITION_PARAM_SKILL_MAGICPERCENT, 130),
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
}
if getPlayerStorageValue(cid, t.profression) == 1 and getPlayerStorageValue(cid, t.statchange) < 7 then
setPlayerStorageValue(cid, t.statchange, (getPlayerStorageValue(cid, t.statchange)) + 1)
if t.displayCharges = true then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You currently have "..t.statchange.." charged!")
else
return true
end
if getPlayerStorageValue(cid, t.statchange) > 7 then
if isKnight(cid) then
setCombatCondition(combat, conditions.knight)
setPlayerStorageValue(cid, t.statchange, 1)
else
if isDruid(cid) or isSorcerer(cid)
setCombatCondition(combat, conditions.mage)
setPlayerStorageValue(cid, t.statchange, 1)
else
if isPaladin(cid) then
setCombatCondition(combat, conditions.paladin)
setPlayerStorageValue(cid, t.statchange, 1)
end
end
end
end
end
end