Moj mistrz
Monster Creator
Hello, yes it's again me. I need little help in shortening this script. Thanks for any help.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
function onCastSpell(creature, var)
local msg = "<the welter devours his spawn and heals himself>"
local spectators, spectator = Game.getSpectators(creature:getPosition(), false, false, 10, 10, 10, 10)
for i = 1, #spectators do
spectator = spectators[i]
if spectator:isMonster() and spectator:getName() == "Egg" then
spectator:getPosition():sendMagicEffect(CONST_ME_HITBYPOISON)
spectator:remove()
creature:say(msg, TALKTYPE_ORANGE_1)
creature:addHealth(25000)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
elseif spectator:isMonster() and spectator:getName() == "Spawn Of The Welter" then
spectator:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD)
spectator:remove()
creature:say(msg, TALKTYPE_ORANGE_1)
creature:addHealth(25000)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
end
end
return combat:execute(creature, var)
end