CREDITS GO TO Exedion!!!!
I have this wondefull spell for knights that buffs players in the area of effect, the buff recived is depending the vocation and you also get your shield skill reduced dramatically, everything works smooth, exept that i want the caster to get a condition too, a diferente one than the other knights in the area will recive.
The spell:
condition is the condition i want the caster to obtain.
condition2 is the condition to add to other players
Rep++, and thanks for reading
I have this wondefull spell for knights that buffs players in the area of effect, the buff recived is depending the vocation and you also get your shield skill reduced dramatically, everything works smooth, exept that i want the caster to get a condition too, a diferente one than the other knights in the area will recive.
The spell:
condition is the condition i want the caster to obtain.
condition2 is the condition to add to other players
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 9000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 170)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, -100)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)
AREA_SQUARE = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
}
local area = createCombatArea(AREA_SQUARE)
setCombatArea(combat, area)
local condition2 = {}
for i = 1, 5 do
condition2[i] = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2[i], CONDITION_PARAM_TICKS, 8000)
setConditionParam(condition2[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, -80)
setConditionParam(condition2[i], CONDITION_PARAM_BUFF, true)
end
setConditionParam(condition2[1], CONDITION_PARAM_STAT_MAGICLEVEL, 5)
setConditionParam(condition2[2], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150)
setConditionParam(condition2[3], CONDITION_PARAM_SKILL_MELEEPERCENT, 150)
function onTargetCreature(cid, target)
if(isSorcerer(target) or isDruid(target)) then
return doTargetCombatCondition(cid, target, condition2[1], CONST_ME_MAGIC_RED), true
elseif(isPaladin(target)) then
return doTargetCombatCondition(cid, target, condition2[2], CONST_ME_MAGIC_RED), true
elseif(isKnight(target)) then
return doTargetCombatCondition(cid, target, condition2[3], CONST_ME_MAGIC_RED), true
elseif(not isPlayer(target)) then
return doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF), false
end
return true
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(cid, var)
local tribute = 10
if getCreatureHealth(cid) <= tribute then
doPlayerSendCancel(cid, "You dont have blood to offer.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
else
doCreatureAddHealth(cid, -tribute)
doCombat(cid, combat, var)
return true
end
end
Rep++, and thanks for reading
Last edited by a moderator: