Bug da TwilightDance[O skill não some no chão(tela)]
Página 1 de 1
Bug da TwilightDance[O skill não some no chão(tela)]
Existe varias Suorce com este problema. o skill TwilightDance do ninja não some ao ser usado e acaba dando um lag do k#$@ derrubando o FPS.. aki deixarei uma Scripts do TwilightDance fixada
-Primeiro: abra seu projeto em (Game\Attacking e Handle.cs)
-Segundo: Procure por #region TwilightDance ou case 12070:
-Terceiro: substitua tudo por
Caso der erro na Time32.Now Ultilize Time64.Now
-Primeiro: abra seu projeto em (Game\Attacking e Handle.cs)
-Segundo: Procure por #region TwilightDance ou case 12070:
-Terceiro: substitua tudo por
- 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 = 40;
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 / 100;
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 * 100 / 100;
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(150);
}
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
Caso der erro na Time32.Now Ultilize Time64.Now
Tópicos semelhantes
» tela preta
» Skill ThunderCloud
» Novas tela de login
» tela de login trava
» tela de login trava,não carrega
» Skill ThunderCloud
» Novas tela de login
» tela de login trava
» tela de login trava,não carrega
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|