Lopaskurwa
Well-Known Member
- Joined
- Oct 6, 2017
- Messages
- 936
- Solutions
- 2
- Reaction score
- 57
Hello,
i have spell which i want to make it work only when you have storage 66655, basically why i need it because i have tile which gives you effect so i dont want to let cast this spell until he didnt stepped on that tile so basically if he dont have that storage it wont let you cast spell
i have spell which i want to make it work only when you have storage 66655, basically why i need it because i have tile which gives you effect so i dont want to let cast this spell until he didnt stepped on that tile so basically if he dont have that storage it wont let you cast spell
XML:
<instant name="light" words="light" lvl="1" maglv="0" mana="20" prem="0" exhaustion="1000" script="light.lua"></instant>
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
local condition = Condition(CONDITION_LIGHT)
condition:setParameter(CONDITION_PARAM_LIGHT_LEVEL, 10)
condition:setParameter(CONDITION_PARAM_LIGHT_COLOR, 215)
condition:setParameter(CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000)
combat:setCondition(condition)
local storageLoadEffect = 66655
function onCastSpell(creature, variant)
if combat:execute(creature, variant) then
local loadEffect = math.max(1, creature:getStorageValue(storageLoadEffect))
Position(creature:getPosition() + Position(1, 0, 0)):sendMagicEffect(loadEffect)
return true
end
return false
end