case (ushort)enums.spellid.fatalspin: { try { user.sendscreen(stream.interactioncreate(&attack), true); msgspellanimation msgspell = new msgspellanimation(user.entity.uid, 0, attack.x, attack.y, clientspell.id, clientspell.level, clientspell.usespellsoul); algoritms.inlinealgorithm line = new algoritms.inlinealgorithm(user.entity.x, attack.x, user.entity.y, attack.y, user.map, dbspell.range, 0, clientspell.id); byte linerange = 2; uint experience = 0; foreach (interfaces.imapobject target in user.screen.objects) { game.entity attacked = target as game.entity; if (target.mapobjtype == mapobjecttype.monster) { if (kernel.getdistance(user.entity.x, user.entity.y, attacked.x, attacked.y) < dbspell.range) { if (line.inline(attacked.x, attacked.y, linerange)) { if (checkattack.canattackmonster.verified(user, attacked, dbspell)) { msgspellanimation.spellobj animationobj; calculate.physical.onmonster(user.entity, attacked, dbspell, out animationobj); animationobj.damage = calculate.base.calculatesoul(animationobj.damage, clientspell.usespellsoul); experience += receiveattack.monster.execute(stream, animationobj, user, attacked); msgspell.targets.enqueue(animationobj); } } } } } foreach (interfaces.imapobject targer in user.screen.objects) { var attacked = targer as game.entity; if (targer.mapobjtype == mapobjecttype.entity && user.entity.uid != targer.uid) { if (kernel.getdistance(user.entity.x, user.entity.y, targer.x, targer.y) < dbspell.range) { if (line.inline(attacked.x, attacked.y, linerange)) { if (checkattack.canattackplayer.verified(user, attacked, dbspell)) { msgspellanimation.spellobj animationobj; calculate.physical.onplayer(user.entity, attacked, dbspell, out animationobj); animationobj.damage = calculate.base.calculatesoul(animationobj.damage, clientspell.usespellsoul); receiveattack.player.execute(stream,animationobj, user, attacked); msgspell.targets.enqueue(animationobj); } } } } } foreach (interfaces.imapobject targer in user.screen.objects) { var attacked = targer as network.gamepackets.sobnpcspawn; if (targer.mapobjtype == mapobjecttype.sobnpc) { if (kernel.getdistance(user.entity.x, user.entity.y, targer.x, targer.y) < dbspell.range) { if (line.inline(attacked.x, attacked.y, linerange)) { if (checkattack.canattacknpc.verified(user, attacked, dbspell)) { msgspellanimation.spellobj animationobj; calculate.physical.onnpcs(user.entity, attacked, dbspell, out animationobj); animationobj.damage = calculate.base.calculatesoul(animationobj.damage, clientspell.usespellsoul); experience += receiveattack.npc.execute(stream, animationobj, user, attacked); msgspell.targets.enqueue(animationobj); } } } } } updates.increaseexperience.up(stream, user, experience); updates.updatespell.checkupdate(stream, user, attack, experience, dbspells); msgspell.setstream(stream); msgspell.send(user); } catch (exception e) { console.writeline(e.tostring()); } break; }