BulawOw
Soul of Shinobi
- Joined
- Sep 15, 2014
- Messages
- 204
- Solutions
- 8
- Reaction score
- 62
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
local condition = Condition(CONDITION_HASTE, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
combat:addCondition(condition)
local regenCondition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
regenCondition:setTicks(-1)
regenCondition:setParameter(CONDITION_PARAM_MANATICKS, 1000)
function onCastSpell(creature, var)
local pos = creature:getPosition()
if not creature:getCondition(CONDITION_HASTE, CONDITIONID_DEFAULT) then
pos:sendMagicEffect(13)
regenCondition:setParameter(CONDITION_PARAM_MANAGAIN, -5)
creature:addCondition(regenCondition)
creature:say("[ON]", TALKTYPE_MONSTER_SAY)
return combat:execute(creature, var)
end
pos:sendMagicEffect(14)
creature:say("[OFF]", TALKTYPE_MONSTER_SAY)
creature:removeCondition(regenCondition)
return creature:removeCondition(CONDITION_HASTE, CONDITIONID_DEFAULT)
end
if player:getMana() < 5 then
pos:sendMagicEffect(14)
creature:say("[OFF]", TALKTYPE_MONSTER_SAY)
creature:removeCondition(regenCondition)
return creature:removeCondition(CONDITION_HASTE, CONDITIONID_DEFAULT)
end
return true
Line 26 gives this error
I also try to do creature:getMana() but still the same