faça uma nova classe na pasta Extra e entao copie e cole (coisa dificil q ngm faz em : D):
- Código:
using System;
using System.Collections.Generic;
using System.Text;
namespace NewestCOServer.Extra
{
public class Durability
{
public static void DefenceDurability(Main.GameClient GC)
{
if (GC.MyChar.Loc.Map != 1039 || GC.MyChar.Loc.Map != 1038 || GC.MyChar.Loc.Map != 6000 || GC.MyChar.Loc.Map != 6001)
{
for (byte i = 1; i < 12; i++)
{
if (i == 1 || i == 2 || i == 3 || i == 8 || i == 11)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.CurDur > 0)
{
if (MyMath.ChanceSuccess(((100 - GC.MyChar.EqStats.Dodge) / 100)))
{
I.CurDur -= 100;
if (I.CurDur <= 299)
GC.LocalMessage(2011, "Be carefull, your item named " + I.DBInfo.Name + " current dura is too low. Go repair it now!");
else if (I.CurDur <= 0)
I.CurDur = 0;
GC.AddSend(Packets.UpdateItem(I, i));
http://Console.WriteLine("Durability removed from item position " + i);
http://Console.WriteLine("Durability removed from item named " + I.DBInfo.Name);
}
}
else if (I.ID != 0 && I.CurDur == 0)
{
GC.LocalMessage(2011, "Be carefull, your item named " + I.DBInfo.Name + " current dura is broken, repair it now or the item will desappear!");
}
}
}
}
}
public static void AttackDurability(Main.GameClient GC)
{
for (byte i = 1; i < 12; i++)
{
if (i != 1 || i != 2 || i != 3 || i != 7 || i != 8 || i != 11)
{
Game.Item I = GC.MyChar.Equips.Get(i);
if (I.ID != 0 && I.CurDur > 0)
{
if (MyMath.ChanceSuccess(((100 - GC.MyChar.EqStats.Dodge) / 100)))
{
I.CurDur -= 100;
if (I.CurDur <= 299)
GC.LocalMessage(2011, "Be carefull, your item named " + I.DBInfo.Name + " current dura is too low. Go repair it now!");
else if (I.CurDur <= 0)
I.CurDur = 0;
GC.AddSend(Packets.UpdateItem(I, i));
http://Console.WriteLine("Durability removed from item position " + i);
http://Console.WriteLine("Durability removed from item named " + I.DBInfo.Name);
}
}
else if (I.ID != 0 && I.CurDur == 0)
{
GC.LocalMessage(2011, "Be carefull, your item named " + I.DBInfo.Name + " current dura is broken, repair it now or the item will desappear!");
}
}
}
}
}
}
depois disto vai no Character.cs e procure:
- Código:
public void TakeAttack(Mob Attacker, uint Damage, AttackType AT)
{
if (Damage != 0)
{
abaixo da { adicione:
- Código:
Extra.Durability.DefenceDurability(MyClient);
procure denovo por:
- Código:
public void TakeAttack(Companion Attacker, uint Damage, AttackType AT)
{
if (Damage != 0)
{
abaixo da { adicione:
- Código:
Extra.Durability.DefenceDurability(MyClient);
procure denovo por:
- Código:
public void TakeAttack(Character Attacker, uint Damage, AttackType AT, bool IsSkill)
{
if (Alive)
{
abaixo da { adicione:
- Código:
Extra.Durability.DefenceDurability(MyClient);
agora vai pro attack.cs e vc vai ver algo como isto:
- Código:
public static void Handle(Main.GameClient GC, byte[] Data)
{
try
{
abaixo da { adicione:
- Código:
Extra.Durability.AttackDurability(GC);
Obs.: eu nao adicionei os checks para /jail/gw/tg maps... se vc quiser adicionar coloque isto nos codes da durability!:
- Código:
if (GC.MyChar.Loc.Map != 1039 || GC.MyChar.Loc.Map != 1038 || GC.MyChar.Loc.Map != 6000 || GC.MyChar.Loc.Map != 6001)
{
qualquer problema posta ae!