|
case (ushort)Enums.SpellID.CrackingShock:
case (ushort)Enums.SpellID.CrackingShock:
{
MsgSpellAnimation MsgSpell = new MsgSpellAnimation(user.Entity.UID
, 0, Attack.X, Attack.Y, ClientSpell.ID
, ClientSpell.Level, ClientSpell.UseSpellSoul);
uint Experience = 0;
foreach (Interfaces.IMapObject target in user.Screen.Objects)
{
if (target.MapObjType == MapObjectType.Monster)
{
Game.Entity attacked = target as Game.Entity;
if (Calculate.Base.GetDistance(Attack.X, Attack.Y, attacked.X, attacked.Y) < DBSpell.Range / 3)
{
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);
user.MessageBox("100");
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 (Calculate.Base.GetDistance(Attack.X, Attack.Y, attacked.X, attacked.Y) < DBSpell.Range / 3)
{
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);
AnimationObj.Damage = AnimationObj.Damage * 20 / 100;
ReceiveAttack.Player.Execute(stream, AnimationObj, user, attacked);
MsgSpell.Targets.Enqueue(AnimationObj);
}
}
}
}
foreach (Interfaces.IMapObject targer in user.Screen.Objects)
{
if (targer.MapObjType == MapObjectType.SobNpc)
{
var attacked = targer as Network.GamePackets.SobNpcSpawn;
if (Calculate.Base.GetDistance(Attack.X, Attack.Y, attacked.X, attacked.Y) < DBSpell.Range / 3)
{
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);
break;
}
case (ushort)enums.spellid.crackingshock:
case (ushort)enums.spellid.crackingshock:
{
msgspellanimation msgspell = new msgspellanimation(user.entity.uid
, 0, attack.x, attack.y, clientspell.id
, clientspell.level, clientspell.usespellsoul);
uint experience = 0;
foreach (interfaces.imapobject target in user.screen.objects)
{
if (target.mapobjtype == mapobjecttype.monster)
{
game.entity attacked = target as game.entity;
if (calculate.base.getdistance(attack.x, attack.y, attacked.x, attacked.y) < dbspell.range / 3)
{
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);
user.messagebox("100");
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 (calculate.base.getdistance(attack.x, attack.y, attacked.x, attacked.y) < dbspell.range / 3)
{
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);
animationobj.damage = animationobj.damage * 20 / 100;
receiveattack.player.execute(stream, animationobj, user, attacked);
msgspell.targets.enqueue(animationobj);
}
}
}
}
foreach (interfaces.imapobject targer in user.screen.objects)
{
if (targer.mapobjtype == mapobjecttype.sobnpc)
{
var attacked = targer as network.gamepackets.sobnpcspawn;
if (calculate.base.getdistance(attack.x, attack.y, attacked.x, attacked.y) < dbspell.range / 3)
{
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);
break;
}