Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monsterstorage = {} -- use functions below to set/get it
- -- warning: /reload will clear this table and reset monster
- -- Script is not efficient, just written for fun. You use it at own risk!
- 'Raining cats "utevo mas cat res"', 30, function(self, order) return demoneko.rainingCats(self:getId(), 0, "Cat", 15, 9, 3000, 4, 7, order) end},
- [2] = {'Cat paws rage "exori gran mas hur"', 30, function(self, order) return demoneko.catPawsRage(self:getId(), order) end},
- },
- [1] = {
- [1] = {'Cat\'s rage "exori mas tempo hur"', 30, function(self, order) return demoneko.catsRage(self:getId(), order) end},
- [2] = {'Space light "exevo gran mas lux"', 30, function(self, order) return demoneko.spaceLight(self:getId(), order) end},
- },
- [0] = {
- [1] = {'Dark servants "utevo mas mort res"', 30, function(self, order) return demoneko.darkServants(self:getId(), order) end},
- [2] = {'Catmusik "exevo mas tempo hur"', 30, function(self, order) return demoneko.catMusik(self:getId(), order) end},
- }
- }
- demoneko = {
- onHealthChange = function(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
- local getlives = creature:getTempStorage(livesstor)
- if creature:getTempStorage(specialstor) > os.time() then
- primaryDamage = math.ceil(primaryDamage * 0.2)
- secondaryDamage = math.ceil(secondaryDamage * 0.2)
- end
- local hp = creature:getHealth()
- local maxhp = creature:getMaxHealth()
- if (hp * 100)/maxhp < 60 then
- if (hp * 100)/maxhp > 20 then
- if creature:getTempStorage(spellstor) == -1 then
- creature:setTempStorage(specialstor, os.time() + spells[getlives][1][2])
- creature:setTempStorage(spellstor, 1)
- spells[getlives][1][3](creature, 1)
- creature:say(spells[getlives][1][1], TALKTYPE_MONSTER_SAY)
- local pos = creature:getPosition()
- creature:setTempStorage(nomovex, pos.x)
- creature:setTempStorage(nomovey, pos.y)
- creature:setTempStorage(nomovez, pos.z)
- return true
- end
- end
- end
- if (hp * 100)/maxhp < 20 then
- if creature:getTempStorage(spellstor) == 1 then
- creature:setTempStorage(specialstor, os.time() + spells[getlives][2][2])
- creature:setTempStorage(spellstor, 2)
- spells[getlives][2][3](creature, 2)
- creature:say(spells[getlives][2][1], TALKTYPE_MONSTER_SAY)
- local pos = creature:getPosition()
- creature:setTempStorage(nomovex, pos.x)
- creature:setTempStorage(nomovey, pos.y)
- creature:setTempStorage(nomovez, pos.z)
- return true
- end
- end
- return primaryDamage, primaryType, secondaryDamage, secondaryType
- end,
- onPrepareDeath = function(creature, lastHitKiller, mostDamageKiller)
- creature:setTempStorage(spellstor, -1)
- creature:setTempStorage(specialstor, -1)
- local getlives = creature:getTempStorage(livesstor)
- if getlives == 0 then
- return true
- end
- if getlives == -1 then
- creature:setTempStorage(livesstor, lives - 1)
- end
- if getlives > 0 then
- creature:setTempStorage(livesstor, getlives - 1)
- end
- local maxhp = creature:getMaxHealth()
- creature:addHealth(maxhp)
- addEvent(doCreatureAddHealth, 100, creature:getId(), maxhp)
- return true
- end,
- onCreatureAppear = function(self, creature) return false end,
- onCreatureDisappear = function(self, creature) return false end,
- onCreatureMove = function(self, creature, oldPosition, newPosition) return false end,
- onCreatureSay = function(self, creature, type, message) return false end,
- onThink = function(self, interval)
- local cid = self:getId()
- if self:getTempStorage(specialstor) > os.time() then
- self:teleportTo({x = self:getTempStorage(nomovex), y = self:getTempStorage(nomovey), z = self:getTempStorage(nomovez)})
- return true
- end
- if math.random(1, 100) <= 80 then
- local target = self:getTarget()
- if target then
- local pos = self:getPosition()
- local catpos = {x = pos.x + math.random(-1, 1), y = pos.y + math.random(-1, 1), z = pos.z}
- local getcat = Game.createMonster("Cat", catpos)
- if getcat then
- local catid = getcat:getId()
- local tpos = target:getPosition()
- local path = getcat:getPathTo(tpos)
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- local newx = 0
- local newy = 0
- local mindist = 4
- local maxdist = 7
- if math.random(1, 2) == 1 then
- newx = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newy = math.random(-mindist, -maxdist)
- else
- newy = math.random(mindist, maxdist)
- end
- else
- newy = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newx = math.random(-mindist, -maxdist)
- else
- newx = math.random(mindist, maxdist)
- end
- end
- local path = getcat:getPathTo({x = pos.x + newx, y = pos.y + newy, z = pos.z})
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- getcat:remove()
- end
- end
- end
- end
- end
- if math.random(1, 100) <= 80 then
- local pos = self:getPosition()
- local dir = self:getDirection()
- local left = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local mid = Position(getNewPosByDir(pos, dir))
- local right = Position(getNewPosByDir(pos, neardirs[dir][2]))
- local combat = COMBAT_PHYSICALDAMAGE
- local shooteffect = CONST_ANI_THROWINGKNIFE
- local areaeffect = CONST_ME_GROUNDSHAKER
- local order = self:getTempStorage(spellstor)
- pos:sendDistanceEffect(left, shooteffect)
- pos:sendDistanceEffect(mid, shooteffect)
- pos:sendDistanceEffect(right, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 300, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, right, shooteffect)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 500, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, right, shooteffect)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- if math.random(1, 100) <= 90 then
- addEvent(demoneko.moveSelf, 700, cid, math.random(3, 7), math.random(3, 7), order)
- end
- return false
- end
- if math.random(1, 100) <= 30 then
- demoneko.orbWave(cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 100, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 150, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- return false
- end
- if math.random(1, 100) <= 40 then
- demoneko.orbBeam(cid, 900, 75, COMBAT_HOLYDAMAGE, CONST_ANI_HOLY, CONST_ME_HOLYDAMAGE)
- addEvent(demoneko.orbBeam, 300, cid, 300, 30, COMBAT_HOLYDAMAGE, CONST_ANI_HOLY, CONST_ME_HOLYDAMAGE)
- addEvent(demoneko.orbBeam, 600, cid, 100, 15, COMBAT_HOLYDAMAGE, CONST_ANI_HOLY, CONST_ME_HOLYDAMAGE)
- return false
- end
- if math.random(1, 100) <= 70 then
- demoneko.simpleWave(cid, COMBAT_FIREDAMAGE, CONST_ANI_FIRE, CONST_ME_FIREATTACK)
- return false
- end
- return false
- end,
- orbWave = function(cid, combat, shooteffect, areaeffect)
- local self = Monster(cid)
- local dir = self:getDirection()
- local pos = self:getPosition()
- if self then
- local left = getNewPosByDir(pos, neardirs[dir][1])
- local mid = getNewPosByDir(pos, dir)
- local right = getNewPosByDir(pos, neardirs[dir][2])
- local mindmg = -100
- local maxdmg = -250
- simpleCombat(cid, combat, mindmg, maxdmg, areaeffect, left)
- simpleCombat(cid, combat, mindmg, maxdmg, areaeffect, mid)
- simpleCombat(cid, combat, mindmg, maxdmg, areaeffect, right)
- addEvent(demoneko.orbWave_move, 500, cid, left, dir, neardirs[dir][1], 1, 500, combat, shooteffect, areaeffect, mindmg, maxdmg)
- addEvent(demoneko.orbWave_move, 500, cid, mid, dir, dir, 1, 500, combat, shooteffect, areaeffect, mindmg, maxdmg)
- addEvent(demoneko.orbWave_move, 500, cid, right, dir, neardirs[dir][2], 1, 500, combat, shooteffect, areaeffect, mindmg, maxdmg)
- addEvent(demoneko.orbWave_move, 500, cid, right, dir, neardirs[dir][1], 1, 500, combat, shooteffect, areaeffect, mindmg, maxdmg)
- addEvent(demoneko.orbWave_move, 500, cid, left, dir, neardirs[dir][2], 1, 500, combat, shooteffect, areaeffect, mindmg, maxdmg)
- end
- return true
- end,
- orbWave_move = function(cid, pos, basedir, diagdir, movementid, basedelay, combat, shooteffect, areaeffect, mindmg, maxdmg)
- basedelay = math.max(0, basedelay - 50)
- if basedelay <= 0 then
- return true
- end
- if not isMonster(cid) then
- return true
- end
- if Monster(cid):getTempStorage(specialstor) > os.time() then
- Position(pos):sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local npos = nil
- if movementid < 1 then
- movementid = movementid + 1
- npos = getNewPosByDir(pos, basedir)
- else
- movementid = 0
- npos = getNewPosByDir(pos, diagdir)
- end
- local nposm = Position(npos)
- if nposm then
- if nposm:isPathable(true) then
- Position(pos):sendDistanceEffect(npos, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, mindmg, maxdmg, areaeffect, npos)
- addEvent(demoneko.orbWave_move, basedelay, cid, npos, basedir, diagdir, movementid, basedelay, combat, shooteffect, areaeffect, mindmg, maxdmg)
- end
- end
- return true
- end,
- orbBeam = function(cid, delay, slower, combat, shooteffect, areaeffect)
- local self = Monster(cid)
- if not self then return true end
- local dir = self:getDirection()
- local pos = self:getPosition()
- if self then
- local left = getNewPosByDir(pos, neardirs[dir][1])
- local right = getNewPosByDir(pos, neardirs[dir][2])
- local mindmg = -50
- local maxdmg = -250
- simpleCombat(cid, combat, mindmg, maxdmg, areaeffect, left)
- simpleCombat(cid, combat, mindmg, maxdmg, areaeffect, right)
- addEvent(demoneko.orbBeam_move, delay, cid, left, dir, neardirs[dir][1], 1, delay, slower, shooteffect, areaeffect, mindmg, maxdmg)
- addEvent(demoneko.orbBeam_move, delay, cid, right, dir, neardirs[dir][2], 1, delay, slower, shooteffect, areaeffect, mindmg, maxdmg)
- end
- return true
- end,
- orbBeam_move = function(cid, pos, basedir, diagdir, movementid, basedelay, slower, shooteffect, areaeffect, mindmg, maxdmg, step)
- if not step then step = 1 end
- basedelay = math.max(0, basedelay - slower)
- if basedelay <= 0 then
- return true
- end
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(specialstor) > os.time() then
- Position(pos):sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local npos = nil
- if movementid < 3 then
- movementid = movementid + 1
- npos = getNewPosByDir(pos, basedir)
- local nposm = Position(npos)
- if nposm then
- if nposm:isPathable(true) then
- Position(pos):sendDistanceEffect(npos, shooteffect)
- addEvent(simpleCombat, 100, cid, COMBAT_PHYSICALDAMAGE, mindmg, maxdmg, areaeffect, npos)
- addEvent(demoneko.orbBeam_move, basedelay, cid, npos, basedir, diagdir, movementid, basedelay, slower, shooteffect, areaeffect, mindmg, maxdmg, step)
- end
- end
- else
- movementid = 0
- -- if step == 2 then
- -- double orb
- step = 0
- npos1 = getNewPosByDir(pos, neardirs[basedir][1])
- npos2 = getNewPosByDir(pos, neardirs[basedir][2])
- local nposm1 = Position(npos1)
- if nposm1 then
- if nposm1:isPathable(true) then
- Position(pos):sendDistanceEffect(npos1, shooteffect)
- addEvent(simpleCombat, 100, cid, COMBAT_PHYSICALDAMAGE, mindmg, maxdmg, areaeffect, npos1)
- addEvent(demoneko.orbBeam_move, basedelay, cid, npos1, basedir, neardirs[basedir][1], movementid, basedelay, slower, shooteffect, areaeffect, mindmg, maxdmg, step)
- end
- end
- local nposm2 = Position(npos2)
- if nposm2 then
- if nposm2:isPathable(true) then
- Position(pos):sendDistanceEffect(npos2, shooteffect)
- addEvent(simpleCombat, 100, cid, COMBAT_PHYSICALDAMAGE, mindmg, maxdmg, areaeffect, npos2)
- addEvent(demoneko.orbBeam_move, basedelay, cid, npos2, basedir, neardirs[basedir][2], movementid, basedelay, slower, shooteffect, areaeffect, mindmg, maxdmg, step)
- end
- end
- --[[else
- -- less hardcore
- step = step + 1
- npos = getNewPosByDir(pos, diagdir)
- local nposm = Position(npos)
- if nposm then
- if nposm:isPathable(true) then
- Position(pos):sendDistanceEffect(npos, shooteffect)
- addEvent(simpleCombat, 100, cid, COMBAT_PHYSICALDAMAGE, mindmg, maxdmg, areaeffect, npos)
- addEvent(demoneko.orbBeam_move, basedelay, cid, npos, basedir, diagdir, movementid, basedelay, slower, shooteffect, areaeffect, mindmg, maxdmg, step)
- end
- end
- end]]
- end
- return true
- end,
- rainingCats = function(cid, wave, cat, amount, waves, interval, mindist, maxdist, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if wave == waves then
- return true
- end
- if wave == 0 then
- local pos = getThingPos(cid)
- for i = 1, #ar1 do
- addEvent(orderAreaCombat, math.ceil(((i / #ar1) * 15000) / 2), cid, COMBAT_HOLYDAMAGE, pos, ar_1[i], 200, 400, CONST_ME_HOLYDAMAGE, order)
- addEvent(orderAreaCombat, math.ceil(15000 + (((i / #ar1) * 15000) / 2)), cid, COMBAT_HOLYDAMAGE, pos, ar_1[i], 200, 400, CONST_ME_HOLYDAMAGE, order)
- end
- for i = 1, #ar2 do
- addEvent(orderAreaCombat, math.ceil(7500 + (((i / #ar2) * 15000) / 2)), cid, COMBAT_FIREDAMAGE, pos, ar_2[i], 250, 500, CONST_ME_FIREATTACK, order)
- addEvent(orderAreaCombat, math.ceil(22500 + (((i / #ar2) * 15000) / 2)), cid, COMBAT_FIREDAMAGE, pos, ar_2[i], 250, 500, CONST_ME_FIREATTACK, order)
- end
- end
- wave = wave + 1
- for i = 1, amount do
- local delay = math.floor((i/amount) * (interval/2))
- if delay <= 0 then
- demoneko.throwCat(cid, mindist, maxdist, cat, order)
- else
- addEvent(demoneko.throwCat, delay, cid, mindist, maxdist, cat, order)
- end
- end
- addEvent(demoneko.rainingCats, interval, cid, wave, cat, amount, waves, interval, mindist, maxdist, order)
- return true
- end,
- throwCat = function(cid, mindist, maxdist, cat, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(specialstor) < os.time() then
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- return true
- end
- local pos = monster:getPosition()
- local newx = 0
- local newy = 0
- if math.random(1, 2) == 1 then
- newx = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newy = math.random(-mindist, -maxdist)
- else
- newy = math.random(mindist, maxdist)
- end
- else
- newy = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newx = math.random(-mindist, -maxdist)
- else
- newx = math.random(mindist, maxdist)
- end
- end
- local catpos = {x = pos.x + math.random(-1, 1), y = pos.y + math.random(-1, 1), z = pos.z}
- local getcat = Game.createMonster(cat, catpos)
- if getcat then
- local catid = getcat:getId()
- local path = getcat:getPathTo({x = pos.x + newx, y = pos.y + newy, z = pos.z}, 0, 20, true, false, 30)
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, cid, catid, path[i], order)
- end
- addEvent(doRemoveCreature, (50 * #path) + 50, catid)
- end
- return true
- end,
- moveCat = function(cid, catid, dir, order, force)
- local cat = Monster(catid)
- if not cat then
- return true
- end
- local monster = Monster(cid)
- local pos = cat:getPosition()
- if not monster then
- pos:sendMagicEffect(CONST_ME_POFF)
- cat:remove()
- return true
- end
- if not force then
- if monster:getTempStorage(specialstor) < os.time() then
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- return true
- end
- end
- local catdir = cat:getDirection()
- local hitpos1 = getNewPosByDir(pos, catdir)
- local tile1 = Tile(hitpos1)
- if tile1 then
- if tile1:getCreatureCount() > 0 then
- if isPlayer(tile1:getTopCreature():getId()) then
- pos:sendMagicEffect(CONST_ME_BLOCKHIT)
- simpleCombat(catid, COMBAT_PHYSICALDAMAGE, -100, -400, CONST_ME_BLOCKHIT, hitpos1)
- doMoveCreature(catid, catdir)
- cat:remove()
- end
- return true
- end
- end
- local hitpos2 = getNewPosByDir(pos, neardirs[catdir][1])
- local tile2 = Tile(hitpos2)
- if tile2 then
- if tile2:getCreatureCount() > 0 then
- if isPlayer(tile2:getTopCreature():getId()) then
- pos:sendMagicEffect(CONST_ME_BLOCKHIT)
- simpleCombat(catid, COMBAT_PHYSICALDAMAGE, -100, -400, CONST_ME_BLOCKHIT, hitpos2)
- doMoveCreature(catid, neardirs[catdir][1])
- cat:remove()
- end
- return true
- end
- end
- local hitpos3 = getNewPosByDir(pos, neardirs[catdir][2])
- local tile3 = Tile(hitpos3)
- if tile3 then
- if tile3:getCreatureCount() > 0 then
- if isPlayer(tile3:getTopCreature():getId()) then
- pos:sendMagicEffect(CONST_ME_BLOCKHIT)
- simpleCombat(catid, COMBAT_PHYSICALDAMAGE, -100, -400, CONST_ME_BLOCKHIT, hitpos3)
- doMoveCreature(catid, neardirs[catdir][2])
- cat:remove()
- end
- return true
- end
- end
- local npos = {x = pos.x + dirs[dir].x, y = pos.y + dirs[dir].y, z = pos.z}
- if Position(npos):isPathable(true) then
- pos:sendMagicEffect(CONST_ME_BLOCKHIT)
- doMoveCreature(catid, dir)
- return true
- end
- pos:sendMagicEffect(CONST_ME_POFF)
- cat:remove()
- return true
- end,
- simpleWave = function(cid, combat, shooteffect, areaeffect)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(specialstor) > os.time() then
- return true
- end
- local pos = monster:getPosition()
- local dir = monster:getDirection()
- local npos = getNewPosByDir(pos, dir)
- simpleCombat(cid, combat, -100, -400, areaeffect, npos)
- addEvent(demoneko.simpleWaveStep, 400, cid, npos, dir, combat, shooteffect, areaeffect, 1, 400, 100, 400)
- return true
- end,
- simpleWaveStep = function(cid, pos, dir, combat, shooteffect, areaeffect, step, basedelay, mindmg, maxdmg)
- basedelay = math.max(0, basedelay - 50)
- if basedelay <= 0 then
- return true
- end
- local monster = Monster(cid)
- if not monster then
- return true
- end
- local oldpos = Position(pos)
- if monster:getTempStorage(specialstor) > os.time() then
- oldpos:sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local midpos = Position(getNewPosByDir(pos, dir))
- if midpos:isPathable(true) then
- oldpos:sendDistanceEffect(midpos, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, mindmg, maxdmg, areaeffect, midpos)
- end
- if step == 1 then
- local leftpos = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local rightpos = Position(getNewPosByDir(pos, neardirs[dir][2]))
- if leftpos:isPathable(true) then
- oldpos:sendDistanceEffect(leftpos, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, mindmg, maxdmg, areaeffect, leftpos)
- addEvent(demoneko.simpleWaveStep, basedelay, cid, leftpos, dir, combat, shooteffect, areaeffect, -1, basedelay, mindmg, maxdmg)
- end
- if rightpos:isPathable(true) then
- oldpos:sendDistanceEffect(rightpos, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, mindmg, maxdmg, areaeffect, rightpos)
- addEvent(demoneko.simpleWaveStep, basedelay, cid, rightpos, dir, combat, shooteffect, areaeffect, -1, basedelay, mindmg, maxdmg)
- end
- if midpos:isPathable(true) then
- addEvent(demoneko.simpleWaveStep, basedelay, cid, midpos, dir, combat, shooteffect, areaeffect, -1, basedelay, mindmg, maxdmg)
- end
- else
- if midpos:isPathable(true) then
- addEvent(demoneko.simpleWaveStep, basedelay, cid, midpos, dir, combat, shooteffect, areaeffect, step + 1, basedelay, mindmg, maxdmg)
- end
- end
- return true
- end,
- catPawsRage = function(cid, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- local pos = monster:getPosition()
- local basedelay = 1000
- for i = 1, 15 do
- addEvent(demoneko.simpleShot, basedelay * 2 * i, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGKNIFE, CONST_ME_HITAREA, order)
- end
- demoneko.clockInit(cid, COMBAT_HOLYDAMAGE, CONST_ANI_HOLY, CONST_ME_HOLYDAMAGE, order)
- return true
- end,
- simpleShot = function(cid, combat, shooteffect, areaeffect, order, pos)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(specialstor) < os.time() then
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- return true
- end
- if pos then
- pos = Position(pos)
- else
- pos = monster:getPosition()
- end
- for i = 0, 7 do
- local npos = getNewPosByDir(pos, i)
- pos:sendDistanceEffect(npos, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, -50, -200, areaeffect, npos, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, npos, i, -50, -200, shooteffect, areaeffect, 1, order)
- end
- return true
- end,
- moveSimpleShot = function(cid, combat, pos, ndir, mind, maxd, shooteffect, areaeffect, step, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- Position(pos):sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local npos = getNewPosByDir(pos, ndir)
- if Position(npos):isPathable(true, true) then
- Position(pos):sendDistanceEffect(npos, shooteffect)
- simpleCombat(cid, combat, mind, maxd, areaeffect, npos, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, npos, ndir, mind, maxd, shooteffect, areaeffect, step + 1, order)
- else
- simpleCombat(cid, combat, mind, maxd, areaeffect, npos, true)
- end
- return true
- end,
- clockInit = function(cid, combat, shooteffect, areaeffect, order, noturn)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- local pos = monster:getPosition()
- for i = 0, 3 do
- demoneko.clockShot(cid, pos, combat, shooteffect, areaeffect, -10, -200, i, neardirs[i][2], order, nil, nil, noturn)
- end
- return true
- end,
- clockShot = function(cid, pos, combat, shooteffect, areaeffect, mind, maxd, dir, diagdir, order, step, total, noturn)
- if not step then step = 1 end
- if not total then total = 1 end
- if total == 9 then return true end
- local monster = Monster(cid)
- if not monster then
- return true
- end
- pos = Position(pos)
- if monster:getTempStorage(specialstor) < os.time() then
- pos:sendMagicEffect(CONST_ME_POFF)
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- pos:sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local npos = getNewPosByDir(pos, dir)
- if step == 2 then
- npos = getNewPosByDir(pos, diagdir)
- addEvent(simpleCombat, 100, cid, combat, mind, maxd, areaeffect, npos)
- for i = 1, (9 - total) do
- addEvent(simpleCombat, 100 + (450 * i), cid, combat, mind, maxd, areaeffect, npos)
- end
- step = 0
- end
- if total < 9 then
- pos:sendDistanceEffect(npos, shooteffect)
- end
- if total == 1 and (not noturn) then
- for k = 1, 5 do
- for i = 1, #arclock do
- addEvent(orderAreaCombat, 4050 + (450 * i) + (5400 * (k-1)), cid, combat, pos, ar_clock[i], mind, maxd, areaeffect, order)
- end
- end
- end
- addEvent(simpleCombat, 100, cid, combat, mind, maxd, areaeffect, npos, true)
- addEvent(demoneko.clockShot, 450, cid, npos, combat, shooteffect, areaeffect, mind, maxd, dir, diagdir, order, step + 1, total + 1, noturn)
- return true
- end,
- catsRage = function(cid, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- local pos = monster:getPosition()
- for i = 1, 60 do
- local x = math.random(1, 4)
- local y = math.random(1, 4)
- if math.random(1, 2) == 1 then
- x = -x
- end
- if math.random(1, 2) == 1 then
- y = -y
- end
- local npos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- addEvent(simpleCombat, math.max(100, (500 * (i - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -100, CONST_ME_GROUNDSHAKER, npos)
- addEvent(demoneko.simpleShot, 100 + (500 * (i - 1)), cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGKNIFE, CONST_ME_HITAREA, order, npos)
- end
- return true
- end,
- moveSelf = function(cid, x, y, order)
- local monster = Monster(cid)
- if not monster then return true end
- if monster:getTempStorage(spellstor) ~= order then return true end
- if math.random(1, 2) == 1 then
- x = -x
- end
- if math.random(1, 2) == 1 then
- y = -y
- end
- local pos = monster:getPosition()
- local npos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- local path = monster:getPathTo(npos)
- if not path then return true end
- if #path > 12 then return true end
- for i = 1, #path do
- addEvent(demoneko.push, 100 + (50 * (i - 1)), cid, path[i], order)
- end
- return true
- end,
- push = function(cid, dir, order)
- local monster = Monster(cid)
- if not monster then return true end
- if monster:getTempStorage(spellstor) ~= order then return true end
- doMoveCreature(cid, dir)
- return true
- end,
- spaceLight = function(cid, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- local pos = monster:getPosition()
- for i = 1, 30 do
- local x = math.random(1, 4)
- local y = math.random(1, 4)
- if math.random(1, 2) == 1 then
- x = -x
- end
- if math.random(1, 2) == 1 then
- y = -y
- end
- local npos = {x = pos.x + x, y = pos.y + y, z = pos.z}
- addEvent(simpleCombat, math.max(100, (900 * (i - 1))), cid, COMBAT_ICEDAMAGE, -50, -100, CONST_ME_POFF, npos)
- addEvent(demoneko.simpleShot, 100 + (900 * (i - 1)), cid, COMBAT_ICEDAMAGE, CONST_ANI_SNOWBALL, CONST_ME_POFF, order, npos)
- end
- local dir = monster:getDirection()
- for k = 1, 8 do
- local left = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local mid = Position(getNewPosByDir(pos, dir))
- local right = Position(getNewPosByDir(pos, neardirs[dir][2]))
- for i = 1, 3 do
- addEvent(simpleCombat, 100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left)
- addEvent(simpleCombat, 100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right)
- end
- local left2 = Position(getNewPosByDir(left, neardirs[dir][1]))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- local right2 = Position(getNewPosByDir(right, neardirs[dir][2]))
- right = Position(getNewPosByDir(right, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, dir))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- right = Position(getNewPosByDir(right, dir))
- right2 = Position(getNewPosByDir(right2, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 1100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 1100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 1100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 1100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 1100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, neardirs[dir][1]))
- left = Position(getNewPosByDir(left, neardirs[dir][1]))
- mid = Position(getNewPosByDir(mid, neardirs[dir][1]))
- right = Position(getNewPosByDir(right, neardirs[dir][1]))
- right2 = Position(getNewPosByDir(right2, neardirs[dir][1]))
- for i = 1, 3 do
- addEvent(simpleCombat, 1600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 1600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 1600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 1600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 1600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, dir))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- right = Position(getNewPosByDir(right, dir))
- right2 = Position(getNewPosByDir(right2, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 2100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 2100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 2100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 2100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 2100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, neardirs[dir][2]))
- left = Position(getNewPosByDir(left, neardirs[dir][2]))
- mid = Position(getNewPosByDir(mid, neardirs[dir][2]))
- right = Position(getNewPosByDir(right, neardirs[dir][2]))
- right2 = Position(getNewPosByDir(right2, neardirs[dir][2]))
- for i = 1, 3 do
- addEvent(simpleCombat, 2600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 2600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 2600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 2600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 2600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, dir))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- right = Position(getNewPosByDir(right, dir))
- right2 = Position(getNewPosByDir(right2, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 3100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 3100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 3100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 3100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 3100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, neardirs[dir][1]))
- left = Position(getNewPosByDir(left, neardirs[dir][1]))
- mid = Position(getNewPosByDir(mid, neardirs[dir][1]))
- right = Position(getNewPosByDir(right, neardirs[dir][1]))
- right2 = Position(getNewPosByDir(right2, neardirs[dir][1]))
- for i = 1, 3 do
- addEvent(simpleCombat, 3600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 3600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 3600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 3600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 3600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, dir))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- right = Position(getNewPosByDir(right, dir))
- right2 = Position(getNewPosByDir(right2, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 4100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 4100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 4100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 4100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 4100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, neardirs[dir][2]))
- left = Position(getNewPosByDir(left, neardirs[dir][2]))
- mid = Position(getNewPosByDir(mid, neardirs[dir][2]))
- right = Position(getNewPosByDir(right, neardirs[dir][2]))
- right2 = Position(getNewPosByDir(right2, neardirs[dir][2]))
- for i = 1, 3 do
- addEvent(simpleCombat, 4600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 4600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 4600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 4600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 4600 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- left2 = Position(getNewPosByDir(left2, dir))
- left = Position(getNewPosByDir(left, dir))
- mid = Position(getNewPosByDir(mid, dir))
- right = Position(getNewPosByDir(right, dir))
- right2 = Position(getNewPosByDir(right2, dir))
- for i = 1, 3 do
- addEvent(simpleCombat, 5100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_BLUE, left2)
- addEvent(simpleCombat, 5100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_CARNIPHILA, left)
- addEvent(simpleCombat, 5100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_YELLOW, mid)
- addEvent(simpleCombat, 5100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_EXPLOSIONHIT, right)
- addEvent(simpleCombat, 5100 + (500 * (i - 1) + (4000 * ( k - 1))), cid, COMBAT_PHYSICALDAMAGE, -50, -300, CONST_ME_FIREWORK_RED, right2)
- end
- end
- return true
- end,
- darkServants = function(cid, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- for i = 1, 30 do
- addEvent(demoneko.hellspawnOrb, math.max(100, 1000 * (i - 1)), cid, order)
- end
- for i = 1, 15 do
- addEvent(demoneko.simpleShot, math.max(100, 2000 * (i - 1)), cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGKNIFE, CONST_ME_HITAREA, order)
- addEvent(demoneko.clockInit, math.max(100, 2000 * (i - 1)), cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGKNIFE, CONST_ME_HITAREA, order, true)
- end
- return true
- end,
- hellspawnOrb = function(cid, order)
- local monster = Monster(cid)
- if not monster then
- return true
- end
- if monster:getTempStorage(spellstor) ~= order then
- return true
- end
- local pos = monster:getPosition()
- local dir = math.random(0, 3)
- demoneko.putHellspawnOrb(cid, getNewPosByDir(pos, dir), dir, dir, 0, order)
- return true
- end,
- putHellspawnOrb = function(cid, pos, dir, ndir, step, order)
- local monster = Monster(cid)
- if not monster then return true end
- pos = Position(pos)
- if monster:getTempStorage(spellstor) ~= order then
- pos:sendMagicEffect(CONST_ME_POFF)
- return true
- end
- local npos = Position(getNewPosByDir(pos, dir))
- if step == 2 then
- ndir = neardirs[dir][math.random(1, 2)]
- dir = turndirs[dir][ndir] or dir
- npos = Position(getNewPosByDir(pos, ndir))
- step = 0
- end
- if math.random(1, 100) <= 5 then
- if #monster:getSummons() < maxsummons then
- Game.createMonster("Hellspawn", pos):setMaster(monster)
- return true
- end
- end
- if npos:isPathable(true, true) then
- pos:sendDistanceEffect(npos, CONST_ANI_DEATH)
- addEvent(simpleCombat, 100, cid, COMBAT_DEATHDAMAGE, -50, -250, CONST_ME_MORTAREA, npos)
- addEvent(doSendDistanceShoot, 900, pos, npos, CONST_ANI_DEATH)
- addEvent(simpleCombat, 1000, cid, COMBAT_DEATHDAMAGE, -50, -250, CONST_ME_MORTAREA, npos)
- addEvent(doSendDistanceShoot, 1900, pos, npos, CONST_ANI_DEATH)
- addEvent(simpleCombat, 2000, cid, COMBAT_DEATHDAMAGE, -50, -250, CONST_ME_MORTAREA, npos)
- addEvent(demoneko.putHellspawnOrb, 1000, cid, npos, dir, ndir, step + 1, order)
- else
- simpleCombat(cid, COMBAT_DEATHDAMAGE, -50, -250, CONST_ME_MORTAREA, npos, true)
- end
- return true
- end,
- catMusik = function(cid, order)
- local monster = Monster(cid)
- if not monster then return true end
- local summons = monster:getSummons()
- if #summons > 0 then
- for i = 1, #summons do
- summons[i]:remove()
- end
- end
- for i = 1, 20 do
- addEvent(demoneko.soundWave, math.min(29500, math.max(100, 1000 * (i - 1))), cid, math.random(0, 3), sounds[math.random(1, #sounds)], order)
- addEvent(demoneko.soundWave, math.min(29500, math.max(100, 1000 + (1000 * (i - 1)))), cid, math.random(4, 7), sounds[math.random(1, #sounds)], order)
- end
- addEvent(demoneko.escape, 50000, cid)
- return true
- end,
- soundWave = function(cid, dir, effect, order)
- local monster = Monster(cid)
- if not monster then return true end
- if monster:getTempStorage(specialstor) < os.time() then return false end
- if monster:getTempStorage(spellstor) ~= order then return false end
- local pos = monster:getPosition()
- demoneko.soundWaveThrow(cid, COMBAT_PHYSICALDAMAGE, -50, -250, dir, effect, pos, order)
- local left = getNewPosByDir(pos, neardirs[neardirs[dir][1]][1])
- local right = getNewPosByDir(pos, neardirs[neardirs[dir][2]][2])
- addEvent(demoneko.soundWaveThrow, 1000, cid, COMBAT_PHYSICALDAMAGE, -50, -250, dir, effect, left, order)
- addEvent(demoneko.soundWaveThrow, 1000, cid, COMBAT_PHYSICALDAMAGE, -50, -250, dir, effect, right, order)
- left = getNewPosByDir(left, neardirs[neardirs[dir][1]][1])
- right = getNewPosByDir(right, neardirs[neardirs[dir][2]][2])
- addEvent(demoneko.soundWaveThrow, 2000, cid, COMBAT_PHYSICALDAMAGE, -50, -250, dir, effect, left, order)
- addEvent(demoneko.soundWaveThrow, 2000, cid, COMBAT_PHYSICALDAMAGE, -50, -250, dir, effect, right, order)
- return true
- end,
- soundWaveThrow = function(cid, combat, mind, maxd, dir, effect, pos, order)
- local monster = Monster(cid)
- if not monster then return true end
- local npos = Position(getNewPosByDir(pos, dir))
- if monster:getTempStorage(specialstor) < os.time() then
- npos:sendMagicEffect(CONST_ME_POFF)
- return false
- end
- if monster:getTempStorage(spellstor) ~= order then
- npos:sendMagicEffect(CONST_ME_POFF)
- return false
- end
- if npos:isPathable(true, true) then
- simpleCombat(cid, combat, mind, maxd, effect, npos)
- addEvent(demoneko.soundWaveThrow, 1000, cid, combat, mind, maxd, dir, effect, npos, order)
- else
- simpleCombat(cid, combat, mind, maxd, effect, npos)
- end
- return true
- end,
- escape = function(cid)
- local monster = Monster(cid)
- if not monster then return true end
- local mpos = monster:getPosition()
- mpos:sendMagicEffect(CONST_ME_POFF)
- Position(getNewPosByDir(mpos, DIRECTION_EAST)):sendMagicEffect(CONST_ME_SMOKE)
- monster:say("The cat mage escaped.", TALKTYPE_MONSTER_SAY)
- monster:remove()
- end,
- }
- neko = {
- exhaust = {},
- onThink = function(self, interval)
- local cid = self:getId()
- if not neko.exhaust[cid] then
- neko.exhaust[cid] = {}
- end
- if math.random(1, 100) <= 95 then
- if not neko.exhaust[cid].cat then
- neko.exhaust[cid].cat = 0
- end
- if neko.exhaust[cid].cat > os.time() then
- return false
- end
- neko.exhaust[cid].cat = os.time() + 2
- local target = self:getTarget()
- if target then
- local pos = self:getPosition()
- local catpos = {x = pos.x + math.random(-1, 1), y = pos.y + math.random(-1, 1), z = pos.z}
- local getcat = Game.createMonster("Cat", catpos)
- if getcat then
- local catid = getcat:getId()
- local tpos = target:getPosition()
- local path = getcat:getPathTo(tpos)
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- local newx = 0
- local newy = 0
- local mindist = 4
- local maxdist = 7
- if math.random(1, 2) == 1 then
- newx = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newy = math.random(-mindist, -maxdist)
- else
- newy = math.random(mindist, maxdist)
- end
- else
- newy = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newx = math.random(-mindist, -maxdist)
- else
- newx = math.random(mindist, maxdist)
- end
- end
- local path = getcat:getPathTo({x = pos.x + newx, y = pos.y + newy, z = pos.z})
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- getcat:remove()
- end
- end
- end
- end
- end
- if math.random(1, 100) <= 10 then
- if not neko.exhaust[cid].knife then
- neko.exhaust[cid].knife = 0
- end
- if neko.exhaust[cid].knife > os.time() then
- return false
- end
- neko.exhaust[cid].knife = os.time() + 10
- local pos = self:getPosition()
- local dir = self:getDirection()
- local left = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local mid = Position(getNewPosByDir(pos, dir))
- local right = Position(getNewPosByDir(pos, neardirs[dir][2]))
- local combat = COMBAT_PHYSICALDAMAGE
- local shooteffect = CONST_ANI_THROWINGKNIFE
- local areaeffect = CONST_ME_GROUNDSHAKER
- local order = self:getTempStorage(spellstor)
- pos:sendDistanceEffect(left, shooteffect)
- pos:sendDistanceEffect(mid, shooteffect)
- pos:sendDistanceEffect(right, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 300, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, right, shooteffect)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 500, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, right, shooteffect)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, left, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, mid, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -250, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, left, neardirs[dir][1], -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, mid, dir, -50, -250, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, right, neardirs[dir][2], -50, -250, shooteffect, areaeffect, 1, order)
- if math.random(1, 100) <= 90 then
- addEvent(demoneko.moveSelf, 700, cid, math.random(3, 7), math.random(3, 7), order)
- end
- return false
- end
- if math.random(1, 100) <= 2 then
- if not neko.exhaust[cid].orbv then
- neko.exhaust[cid].orbv = 0
- end
- if neko.exhaust[cid].orbv > os.time() then
- return false
- end
- neko.exhaust[cid].orbv = os.time() + 10
- demoneko.orbWave(cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 100, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 150, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- return false
- end
- if math.random(1, 100) <= 2 then
- if not neko.exhaust[cid].fv then
- neko.exhaust[cid].fv = 0
- end
- if neko.exhaust[cid].fv > os.time() then
- return false
- end
- neko.exhaust[cid].fv = os.time() + 10
- demoneko.simpleWave(cid, COMBAT_FIREDAMAGE, CONST_ANI_FIRE, CONST_ME_FIREATTACK)
- return false
- end
- return false
- end,
- }
- noviceneko = {
- onThink = function(self, interval)
- local cid = self:getId()
- if not neko.exhaust[cid] then
- neko.exhaust[cid] = {}
- end
- if math.random(1, 100) <= 95 then
- if not neko.exhaust[cid].cat then
- neko.exhaust[cid].cat = 0
- end
- if neko.exhaust[cid].cat > os.time() then
- return false
- end
- neko.exhaust[cid].cat = os.time() + 4
- local target = self:getTarget()
- if target then
- local pos = self:getPosition()
- local catpos = {x = pos.x + math.random(-1, 1), y = pos.y + math.random(-1, 1), z = pos.z}
- local getcat = Game.createMonster("Cat", catpos)
- if getcat then
- local catid = getcat:getId()
- local tpos = target:getPosition()
- local path = getcat:getPathTo(tpos)
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- local newx = 0
- local newy = 0
- local mindist = 4
- local maxdist = 7
- if math.random(1, 2) == 1 then
- newx = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newy = math.random(-mindist, -maxdist)
- else
- newy = math.random(mindist, maxdist)
- end
- else
- newy = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newx = math.random(-mindist, -maxdist)
- else
- newx = math.random(mindist, maxdist)
- end
- end
- local path = getcat:getPathTo({x = pos.x + newx, y = pos.y + newy, z = pos.z})
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- getcat:remove()
- end
- end
- end
- end
- end
- if math.random(1, 100) <= 10 then
- if not neko.exhaust[cid].knife then
- neko.exhaust[cid].knife = 0
- end
- if neko.exhaust[cid].knife > os.time() then
- return false
- end
- neko.exhaust[cid].knife = os.time() + 10
- local pos = self:getPosition()
- local dir = self:getDirection()
- local left = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local mid = Position(getNewPosByDir(pos, dir))
- local right = Position(getNewPosByDir(pos, neardirs[dir][2]))
- local combat = COMBAT_PHYSICALDAMAGE
- local shooteffect = CONST_ANI_THROWINGKNIFE
- local areaeffect = CONST_ME_GROUNDSHAKER
- local order = self:getTempStorage(spellstor)
- pos:sendDistanceEffect(left, shooteffect)
- pos:sendDistanceEffect(mid, shooteffect)
- pos:sendDistanceEffect(right, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, -50, -150, areaeffect, left, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -150, areaeffect, mid, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -150, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, left, neardirs[dir][1], -50, -150, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, mid, dir, -50, -150, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, right, neardirs[dir][2], -50, -150, shooteffect, areaeffect, 1, order)
- return false
- end
- if math.random(1, 1000) <= 3 then
- if not neko.exhaust[cid].orbv then
- neko.exhaust[cid].orbv = 0
- end
- if neko.exhaust[cid].orbv > os.time() then
- return false
- end
- neko.exhaust[cid].orbv = os.time() + 10
- demoneko.orbWave(cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 100, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 150, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- return false
- end
- if math.random(1, 1000) <= 3 then
- if not neko.exhaust[cid].fv then
- neko.exhaust[cid].fv = 0
- end
- if neko.exhaust[cid].fv > os.time() then
- return false
- end
- neko.exhaust[cid].fv = os.time() + 10
- demoneko.simpleWave(cid, COMBAT_FIREDAMAGE, CONST_ANI_FIRE, CONST_ME_FIREATTACK)
- return false
- end
- return false
- end,
- }
- nekoelite = {
- exhaust = {},
- onThink = function(self, interval)
- local cid = self:getId()
- if not neko.exhaust[cid] then
- neko.exhaust[cid] = {}
- end
- if math.random(1, 100) <= 95 then
- local target = self:getTarget()
- if target then
- local pos = self:getPosition()
- local catpos = {x = pos.x + math.random(-1, 1), y = pos.y + math.random(-1, 1), z = pos.z}
- local getcat = Game.createMonster("Cat", catpos)
- if getcat then
- local catid = getcat:getId()
- local tpos = target:getPosition()
- local path = getcat:getPathTo(tpos)
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- local newx = 0
- local newy = 0
- local mindist = 4
- local maxdist = 7
- if math.random(1, 2) == 1 then
- newx = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newy = math.random(-mindist, -maxdist)
- else
- newy = math.random(mindist, maxdist)
- end
- else
- newy = math.random(-maxdist, maxdist)
- if math.random(1, 2) == 1 then
- newx = math.random(-mindist, -maxdist)
- else
- newx = math.random(mindist, maxdist)
- end
- end
- local path = getcat:getPathTo({x = pos.x + newx, y = pos.y + newy, z = pos.z})
- if path then
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- table.insert(path, path[#path])
- for i = 1, #path do
- addEvent(demoneko.moveCat, (50 * i) + 50, self:getId(), catid, path[i], nil, true)
- end
- addEvent(doRemoveCreature, (50 * #path) + 200, catid)
- else
- getcat:remove()
- end
- end
- end
- end
- end
- if math.random(1, 100) <= 10 then
- if not neko.exhaust[cid].knife then
- neko.exhaust[cid].knife = 0
- end
- if neko.exhaust[cid].knife > os.time() then
- return false
- end
- neko.exhaust[cid].knife = os.time() + 10
- local pos = self:getPosition()
- local dir = self:getDirection()
- local left = Position(getNewPosByDir(pos, neardirs[dir][1]))
- local mid = Position(getNewPosByDir(pos, dir))
- local right = Position(getNewPosByDir(pos, neardirs[dir][2]))
- local combat = COMBAT_PHYSICALDAMAGE
- local shooteffect = CONST_ANI_THROWINGKNIFE
- local areaeffect = CONST_ME_GROUNDSHAKER
- local order = self:getTempStorage(spellstor)
- pos:sendDistanceEffect(left, shooteffect)
- pos:sendDistanceEffect(mid, shooteffect)
- pos:sendDistanceEffect(right, shooteffect)
- addEvent(simpleCombat, 100, cid, combat, -50, -100, areaeffect, left, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -100, areaeffect, mid, true)
- addEvent(simpleCombat, 100, cid, combat, -50, -100, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, left, neardirs[dir][1], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, mid, dir, -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 100, cid, combat, right, neardirs[dir][2], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 300, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 300, pos, right, shooteffect)
- addEvent(simpleCombat, 400, cid, combat, -50, -100, areaeffect, left, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -100, areaeffect, mid, true)
- addEvent(simpleCombat, 400, cid, combat, -50, -100, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, left, neardirs[dir][1], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, mid, dir, -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 400, cid, combat, right, neardirs[dir][2], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 500, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 500, pos, right, shooteffect)
- addEvent(simpleCombat, 600, cid, combat, -50, -100, areaeffect, left, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -100, areaeffect, mid, true)
- addEvent(simpleCombat, 600, cid, combat, -50, -100, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, left, neardirs[dir][1], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, mid, dir, -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 600, cid, combat, right, neardirs[dir][2], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 700, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 700, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 700, pos, right, shooteffect)
- addEvent(simpleCombat, 800, cid, combat, -50, -100, areaeffect, left, true)
- addEvent(simpleCombat, 800, cid, combat, -50, -100, areaeffect, mid, true)
- addEvent(simpleCombat, 800, cid, combat, -50, -100, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 800, cid, combat, left, neardirs[dir][1], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 800, cid, combat, mid, dir, -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 800, cid, combat, right, neardirs[dir][2], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(Position.sendDistanceEffect, 900, pos, left, shooteffect)
- addEvent(Position.sendDistanceEffect, 900, pos, mid, shooteffect)
- addEvent(Position.sendDistanceEffect, 900, pos, right, shooteffect)
- addEvent(simpleCombat, 1000, cid, combat, -50, -100, areaeffect, left, true)
- addEvent(simpleCombat, 1000, cid, combat, -50, -100, areaeffect, mid, true)
- addEvent(simpleCombat, 1000, cid, combat, -50, -100, areaeffect, right, true)
- addEvent(demoneko.moveSimpleShot, 1000, cid, combat, left, neardirs[dir][1], -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 1000, cid, combat, mid, dir, -50, -100, shooteffect, areaeffect, 1, order)
- addEvent(demoneko.moveSimpleShot, 1000, cid, combat, right, neardirs[dir][2], -50, -100, shooteffect, areaeffect, 1, order)
- if math.random(1, 100) <= 90 then
- addEvent(demoneko.moveSelf, 1100, cid, math.random(3, 7), math.random(3, 7), order)
- end
- return false
- end
- if math.random(1, 100) <= 7 then
- if not neko.exhaust[cid].orbv then
- neko.exhaust[cid].orbv = 0
- end
- if neko.exhaust[cid].orbv > os.time() then
- return false
- end
- neko.exhaust[cid].orbv = os.time() + 10
- demoneko.orbWave(cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 100, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- addEvent(demoneko.orbWave, 150, cid, COMBAT_PHYSICALDAMAGE, CONST_ANI_THROWINGSTAR, CONST_ME_GROUNDSHAKER)
- return false
- end
- if math.random(1, 100) <= 7 then
- if not neko.exhaust[cid].fv then
- neko.exhaust[cid].fv = 0
- end
- if neko.exhaust[cid].fv > os.time() then
- return false
- end
- neko.exhaust[cid].fv = os.time() + 20
- demoneko.simpleWave(cid, COMBAT_FIREDAMAGE, CONST_ANI_FIRE, CONST_ME_FIREATTACK)
- return false
- end
- if math.random(1, 100) <= 7 then
- if not neko.exhaust[cid].hs then
- neko.exhaust[cid].hs = 0
- end
- if neko.exhaust[cid].hs > os.time() then
- return false
- end
- neko.exhaust[cid].hs = os.time() + 30
- demoneko.hellspawnOrb(cid, order)
- return false
- end
- if math.random(1, 100) <= 7 then
- if not neko.exhaust[cid].sn then
- neko.exhaust[cid].sn = 0
- end
- if neko.exhaust[cid].sn > os.time() then
- return false
- end
- neko.exhaust[cid].sn = os.time() + 10
- demoneko.soundWave(cid, math.random(0, 7), sounds[math.random(1, #sounds)], order)
- return false
- end
- return false
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement