Fixar TwilightDance
Página 1 de 1
Fixar TwilightDance
Abra o project da source e procure por #region TwilightDance
E troque o código da #region TwiligthDance por este
depois é só da debug!
E troque o código da #region TwiligthDance por este
- Código:
#region TwilightDance
case 12070:
{
if (CanUseSpell(spell, attacker.Owner))
{
PrepareSpell(spell, attacker.Owner);
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
// suse.X = X;
// suse.Y = Y;
attacker.Owner.SendScreen(suse, true);
ushort _X = attacker.X, _Y = attacker.Y;
ushort _tX = X, _tY = Y;
byte dist = 18;
var Array = attacker.Owner.Screen.Objects;
var map = attacker.Owner.Map;
// if (!map.Floor[X, Y, MapObjectType.Item, null])
// return;
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
InLineAlgorithm.Algorithm.DDA);
var count = (double)algo.lcoords.Count / 3;
for (int i = 0; i < 4; i++)
{
var selected = i * (int)count;
selected = Math.Min(algo.lcoords.Count - 1, selected);
X = (ushort)algo.lcoords[selected].X;
Y = (ushort)algo.lcoords[selected].Y;
FloorItem floorItem = new FloorItem(true);
floorItem.ItemID = FloorItem.Twilight;
floorItem.ItemColor = (Enums.Color)(i + 1);
floorItem.MapID = attacker.MapID;
floorItem.Type = FloorItem.Effect;
floorItem.X = X;
floorItem.Y = Y;
floorItem.OnFloor = Time32.Now;
floorItem.Owner = attacker.Owner;
while (map.Npcs.ContainsKey(floorItem.UID))
floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
map.AddFloorItem(floorItem);
attacker.Owner.SendScreenSpawn(floorItem, true);
if (i != 0)
{
Data data = new Network.GamePackets.Data(true);
data.UID = attacker.UID;
data.X = X;
data.Y = Y;
data.ID = 434;
data.wParam1 = attacker.X;
data.wParam2 = attacker.Y;
attacker.Owner.SendScreen(data, true);
}
foreach (Interfaces.IMapObject _obj in Array)
{
bool hit = false;
var selected2 = Math.Max(0, i - 1) * (int)count;
selected2 = Math.Min(algo.lcoords.Count - 1, selected2);
for (int j = selected2; j < selected; j++)
if (Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= spell.Range)
hit = true;
if (hit)
{
if (_obj.MapObjType == MapObjectType.Monster)
{
attacked = _obj as Entity;
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
damage = damage * 10 / 50;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
else if (_obj.MapObjType == MapObjectType.Player)
{
attacked = _obj as Entity;
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
damage = damage * 10 / 50;
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
else if (_obj.MapObjType == MapObjectType.SobNpc)
{
attackedsob = _obj as SobNpcSpawn;
if (CanAttack(attacker, attackedsob, spell))
{
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
damage = damage * 10 / 50;
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
}
}
if (suse.Targets.Count > 0)
attacker.Owner.SendScreen(suse, true);
System.Threading.Thread.Sleep(30);
}
attacker.AttackPacket = null;
}
var map1 = attacker.Owner.Map;
FloorItem floorItem1 = new FloorItem(true);
floorItem1.Type = FloorItem.RemoveEffect;
map1.RemoveFloorItem(floorItem1);
attacker.Owner.SendScreenSpawn(floorItem1, true);
break;
}
#endregion
depois é só da debug!
Tópicos semelhantes
» Fixar inner power
» Fixar a Phoenix Gem e a tortoise gem
» Fixar refinery in LordsRoad 100% byFelipeXP
» Fixar EliteGw na source Ruberto v5
» Como fixar o triple attack do monk!
» Fixar a Phoenix Gem e a tortoise gem
» Fixar refinery in LordsRoad 100% byFelipeXP
» Fixar EliteGw na source Ruberto v5
» Como fixar o triple attack do monk!
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|