Odp: Spell i informacja
Mo?esz to zrobi? w ten spos?b, lecz to nie zadzia?a do ko?ca tak jak chcesz(przetestuj):
[lua]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
return doCombat(cid, combat, var), doCreatureSay(variantToNumber(var), "Spowolniony", TALKTYPE_ORANGE_1)
end[/lua]
Dlatego radz? zrobi? paralyze w actions:
[lua]local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)
local config = {manacost = 0, removeOnUse = true, exh_time = 2, vocations = {2,6}}
config.removeOnUse = getBooleanFromString(config.removeOnUse)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.vocations,getPlayerVocation(cid)) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation cannot use this rune.")
return false
end
if (getPlayerMana(cid) < config.manacost) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough mana points.")
return false
end
if(getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(getCreaturePosition(itemEx.uid)) == TRUE) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't paralyze in protection zone.")
return false
end
if(exhaustion.check(cid, 5431) == false) then
doAddCondition(itemEx.uid, condition)
doPlayerAddMana(cid, -config.manacost)
doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_HITAREA)
doCreatureSay(itemEx.uid, "Spowolniony", TALKTYPE_ORANGE_1)
exhaustion.set(cid, 5431, config.exh_time)
if(item.type > 1 and config.removeOnUse == true) then
doTransformItem(item.uid, item.itemid, item.type-1)
elseif (item.type == 1 and config.removeOnUse == true) then
doRemoveItem(item.uid)
end
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
return true
end[/lua]