|
|
|
المشاركات 674 |
+التقييم 0.25 |
تاريخ التسجيل May 2019 |
الاقامة |
نظام التشغيل windows 10 |
رقم العضوية 248 |
using Rayzo.Network.GamePackets;
using System;
using System.Collections.Generic;
namespace Rayzo.Network
{
public class Relics
{
public static Dictionary<RelicsID, List<Stru>> RelicsItemsInfo = new Dictionary<RelicsID, List<Stru>>()
{
{RelicsID.WesternMirror,new List<Stru>
{
new Stru(){ minValue = 600 , maxvalue = 900, relictype = RelicType.Featured , type = RelicsAttribute.MAttack},
new Stru(){ minValue = 100, maxvalue=200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease},
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 30, maxvalue = 49, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease },
}},
{RelicsID.ImperialTripodVessel,new List<Stru>()
{
new Stru(){ minValue = 500 , maxvalue = 800, relictype = RelicType.Featured , type = RelicsAttribute.HP},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.AntiBreak },
new Stru(){ minValue = 50, maxvalue = 60, relictype = RelicType.Gold, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Immunity },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttack },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttack },
}},
{RelicsID.BeadsofCalmSea,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.SkillCriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
}},
{RelicsID.HeartlessSeal,new List<Stru>()
{
new Stru(){ minValue = 200 , maxvalue = 300, relictype = RelicType.Featured , type = RelicsAttribute.PAttack},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Breakthrough},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease},
}},
{RelicsID.BellofDoom,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.CriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease},
}},
};
public class Stru
{
public RelicsAttribute type;
public int minValue;
public int maxvalue;
public RelicType relictype;
}
public enum RelicType
{
Featured = 2,
Gold = 1,
Common = 0,
}
public enum RelicsID
{
WesternMirror = 4100001,
ImperialTripodVessel = 4100002,
BeadsofCalmSea = 4100003,
HeartlessSeal = 4100004,
BellofDoom = 4100005
}
public enum RelicsAttribute
{
None = 0,
CriticalStrike = 1,
SkillCriticalStrike = 2,
Immunity = 3,
Breakthrough = 4,
AntiBreak = 5,
HP = 6,
PAttack = 7,
MAttack = 8,
MDefence = 9,
PAttackIncrease = 10,
MAttackIncrease = 11,
PDmgIncrease = 12,
MDmgIncrease = 13
}
//public enum RelicsType : uint
//{
// //4100000
// P_Strike = 1,//Points * 4
// M_Strike = 2,//Points * 4
// Immunity = 3,//Points * 4
// Break = 4,//Points * 4
// Anti_Break = 5,//Points * 4
// MaxHP = 6,//Points * 0
// P_Attack = 7,//Points * 2
// M_Attack = 8,//Points * 0
// M_Defense = 9,//Points * 5
// Final_P_Attack = 10,//Points * 0
// Final_M_Attack = 11,//Points * 0
// Final_P_Damage = 12,//Points * 0
// Final_M_Damage = 13,//Points * 0
//};
public static int GetSoulCount(uint data)
{
if (data == 0)
return 0;
var stringdata = data.ToString("D6");
var Type = (RelicType)int.Parse(stringdata.Substring(3, 1));
switch (Type)
{
case RelicType.Common:
return 3;
case RelicType.Gold:
return 6;
case RelicType.Featured:
return 6;
}
return 0;
}
public static ConquerItem RandomRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
int val = Kernel.Random.Next(1, 6);
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= val; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public static ConquerItem RandomSuperRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= 5; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (attr.relictype == RelicType.Common)
goto again;
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public enum RunesType : uint
{
//4100000
P_Strike = 1,//Points * 4
M_Strike = 2,//Points * 4
Immunity = 3,//Points * 4
Break = 4,//Points * 4
Anti_Break = 5,//Points * 4
MaxHP= 6,//Points * 0
P_Attack = 7,//Points * 2
M_Attack = 8,//Points * 0
M_Defense = 9,//Points * 5
Final_P_Attack = 10,//Points * 0
Final_M_Attack = 11,//Points * 0
Final_P_Damage = 12,//Points * 0
Final_M_Damage = 13,//Points * 0
};
public static uint CreatRelicAttr(int val, int isheight, RelicsAttribute type)
{
string result = val.ToString("D3") + isheight + ((int)(type)).ToString("D2");
return uint.Parse(result);
}
public static void HandleRelicDurability(Client.GameState client, ConquerItem relic)
{
if (client.Entity.MapID == 1038 || client.Entity.MapID == 1005)
return;
if (relic.Durability > 0)
{
if (relic.Durability >= 100)
relic.Durability -= 100;
else
relic.Durability = 0;
Database.ConquerItemTable.UpdateDurabilityItem2(relic, relic.ID);
Database.ConquerItemTable.UpdateDurabilityItem(relic);
relic.Mode = Game.Enums.ItemMode.Update;
relic.Send(client);
relic.Mode = Game.Enums.ItemMode.Default;
}
else if (relic.Durability == 0)
{
_String str = new _String(true)
{
UID = client.Entity.UID,
Type = 10,
TextsCount = 1
};
str.Texts.Add("EquipBroken");
client.Send(str.ToArray());
client.Send(new Message(Database.ConquerItemInformation.BaseInformations[relic.ID].Name + " is totaly damaged!", Message.TopLeft));
}
}
public static void HandleRepair(Client.GameState client, ConquerItem item, uint CrystalNeeded)
{
if (client.Inventory.Contains(3306885, CrystalNeeded))
{
if (item.Durability < item.MaximDurability)
{
client.Inventory.Remove(3306885, CrystalNeeded);
item.Durability = item.MaximDurability;
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateDurabilityItem(item);
}
}
else
client.Send("You don't have " + CrystalNeeded + " RelicCrystal!");
}
}
}
case "Superrelic":
{
client.Inventory.Add(Relics.RandomSuperRelic(0), Enums.ItemUse.CreateAndAdd);
break;
}
using ConQuerSquad.Network.GamePackets;
using System;
using System.Collections.Generic;
namespace ConQuerSquad.Network
{
public class Relics
{
public static Dictionary<RelicsID, List<Stru>> RelicsItemsInfo = new Dictionary<RelicsID, List<Stru>>()
{
{RelicsID.WesternMirror,new List<Stru>
{
new Stru(){ minValue = 600 , maxvalue = 900, relictype = RelicType.Featured , type = RelicsAttribute.MAttack},
new Stru(){ minValue = 100, maxvalue=200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease},
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 30, maxvalue = 49, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease },
}},
{RelicsID.ImperialTripodVessel,new List<Stru>()
{
new Stru(){ minValue = 500 , maxvalue = 800, relictype = RelicType.Featured , type = RelicsAttribute.HP},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.AntiBreak },
new Stru(){ minValue = 50, maxvalue = 60, relictype = RelicType.Gold, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Immunity },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttack },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttack },
}},
{RelicsID.BeadsofCalmSea,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.SkillCriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
}},
{RelicsID.HeartlessSeal,new List<Stru>()
{
new Stru(){ minValue = 200 , maxvalue = 300, relictype = RelicType.Featured , type = RelicsAttribute.PAttack},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Breakthrough},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease},
}},
{RelicsID.BellofDoom,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.CriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease},
}},
};
public class Stru
{
public RelicsAttribute type;
public int minValue;
public int maxvalue;
public RelicType relictype;
}
public enum RelicType
{
Featured = 2,
Gold = 1,
Common = 0,
}
public enum RelicsID
{
WesternMirror = 4100001,
ImperialTripodVessel = 4100002,
BeadsofCalmSea = 4100003,
HeartlessSeal = 4100004,
BellofDoom = 4100005
}
public enum RelicsAttribute
{
None = 0,
CriticalStrike = 1,
SkillCriticalStrike = 2,
Immunity = 3,
Breakthrough = 4,
AntiBreak = 5,
HP = 6,
PAttack = 7,
MAttack = 8,
MDefence = 9,
PAttackIncrease = 10,
MAttackIncrease = 11,
PDmgIncrease = 12,
MDmgIncrease = 13
}
//public enum RelicsType : uint
//{
// //4100000
// P_Strike = 1,//Points * 4
// M_Strike = 2,//Points * 4
// Immunity = 3,//Points * 4
// Break = 4,//Points * 4
// Anti_Break = 5,//Points * 4
// MaxHP = 6,//Points * 0
// P_Attack = 7,//Points * 2
// M_Attack = 8,//Points * 0
// M_Defense = 9,//Points * 5
// Final_P_Attack = 10,//Points * 0
// Final_M_Attack = 11,//Points * 0
// Final_P_Damage = 12,//Points * 0
// Final_M_Damage = 13,//Points * 0
//};
public static int GetSoulCount(uint data)
{
if (data == 0)
return 0;
var stringdata = data.ToString("D6");
var Type = (RelicType)int.Parse(stringdata.Substring(3, 1));
switch (Type)
{
case RelicType.Common:
return 3;
case RelicType.Gold:
return 6;
case RelicType.Featured:
return 6;
}
return 0;
}
public static MsgItemInfo RandomRelic(uint ID = 0)
{
MsgItemInfo item = new MsgItemInfo(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
int val = Kernel.Random.Next(1, 6);
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= val; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public static MsgItemInfo RandomSuperRelic(uint ID = 0)
{
MsgItemInfo item = new MsgItemInfo(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= 5; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (attr.relictype == RelicType.Common)
goto again;
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public enum RunesType : uint
{
//4100000
P_Strike = 1,//Points * 4
M_Strike = 2,//Points * 4
Immunity = 3,//Points * 4
Break = 4,//Points * 4
Anti_Break = 5,//Points * 4
MaxHP = 6,//Points * 0
P_Attack = 7,//Points * 2
M_Attack = 8,//Points * 0
M_Defense = 9,//Points * 5
Final_P_Attack = 10,//Points * 0
Final_M_Attack = 11,//Points * 0
Final_P_Damage = 12,//Points * 0
Final_M_Damage = 13,//Points * 0
};
public static uint CreatRelicAttr(int val, int isheight, RelicsAttribute type)
{
string result = val.ToString("D3") + isheight + ((int)(type)).ToString("D2");
return uint.Parse(result);
}
public static void HandleRelicDurability(Client.GameState client, MsgItemInfo relic)
{
if (client.Player.MapID == 1038 || client.Player.MapID == 1005)
return;
if (relic.Durability > 0)
{
if (relic.Durability >= 100)
relic.Durability -= 100;
else
relic.Durability = 0;
Database.ConquerItemTable.UpdateDurabilityItem2(relic, relic.ID);
Database.ConquerItemTable.UpdateDurabilityItem(relic);
relic.Mode = Game.Enums.ItemMode.Update;
relic.Send(client);
relic.Mode = Game.Enums.ItemMode.Default;
}
else if (relic.Durability == 0)
{
MsgName str = new MsgName(true)
{
UID = client.Player.UID,
Type = 10,
TextsCount = 1
};
str.Texts.Add("EquipBroken");
client.Send(str.ToArray());
client.Send(new MsgTalk(Database.ConquerItemInformation.BaseInformations[relic.ID].Name + " is totaly damaged!", MsgTalk.TopLeft));
}
}
public static void HandleRepair(Client.GameState client, MsgItemInfo item, uint CrystalNeeded)
{
if (client.Inventory.Contains(3306885, CrystalNeeded))
{
if (item.Durability < item.MaximDurability)
{
client.Inventory.Remove(3306885, CrystalNeeded);
item.Durability = item.MaximDurability;
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateDurabilityItem(item);
}
}
else
client.Send("You don't have " + CrystalNeeded + " RelicCrystal!");
}
}
}
public void LoadItemRunes(MsgItemInfo item)
{
if (item.Position == MsgItemInfo.Relics)
{
for (int x = 0; x <= item.Runes.Length; x++)
{
if (item.Runes.Length > x)
{
uint Type = item.Runes[x] % 100;
uint value = item.Runes[x];
value -= item.Runes[x] % 1000;
value = value / 1000;
if (Type == (uint)Relics.RunesType.P_Strike)
Player.CriticalStrike += (int)value;
if (Type == (uint)Relics.RunesType.M_Strike)
Player.SkillCStrike += (int)value;
if (Type == (uint)Relics.RunesType.Immunity)
Player.Immunity += (int)value;
if (Type == (uint)Relics.RunesType.Break)
Player.Breaktrough += (int)(value / 10);
if (Type == (uint)Relics.RunesType.Anti_Break)
Player.Counteraction += (int)(value / 10);
if (Type == (uint)Relics.RunesType.MaxHP)
Player.ItemHP += value;
if (Type == (uint)Relics.RunesType.P_Attack)
{
Player.BaseMaxAttack += value;
Player.BaseMinAttack += value;
}
if (Type == (uint)Relics.RunesType.M_Attack)
Player.MagicAttack += value;
if (Type == (uint)Relics.RunesType.M_Defense)
Player.MagicDefence += (ushort)value;
if (Type == (uint)Relics.RunesType.Final_P_Attack)
Player.PhysicalDamageIncrease += (ushort)value;
if (Type == (uint)Relics.RunesType.Final_M_Attack)
Player.PhysicalDamageDecrease += (ushort)value;
if (Type == (uint)Relics.RunesType.Final_P_Damage)
Player.PhysicalDamageDecrease += (ushort)value;
if (Type == (uint)Relics.RunesType.Final_M_Damage)
Player.MagicDamageDecrease += (ushort)value;
}
}
Player.Buffer.RelicPower = Player.RunesType;
}
}
using Rayzo.Network.GamePackets;
using System;
using System.Collections.Generic;
namespace Rayzo.Network
{
public class Relics
{
public static Dictionary<RelicsID, List<Stru>> RelicsItemsInfo = new Dictionary<RelicsID, List<Stru>>()
{
{RelicsID.WesternMirror,new List<Stru>
{
new Stru(){ minValue = 600 , maxvalue = 900, relictype = RelicType.Featured , type = RelicsAttribute.MAttack},
new Stru(){ minValue = 100, maxvalue=200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease},
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 30, maxvalue = 49, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease },
}},
{RelicsID.ImperialTripodVessel,new List<Stru>()
{
new Stru(){ minValue = 500 , maxvalue = 800, relictype = RelicType.Featured , type = RelicsAttribute.HP},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.AntiBreak },
new Stru(){ minValue = 50, maxvalue = 60, relictype = RelicType.Gold, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Immunity },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttack },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttack },
}},
{RelicsID.BeadsofCalmSea,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.SkillCriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
}},
{RelicsID.HeartlessSeal,new List<Stru>()
{
new Stru(){ minValue = 200 , maxvalue = 300, relictype = RelicType.Featured , type = RelicsAttribute.PAttack},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Breakthrough},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease},
}},
{RelicsID.BellofDoom,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.CriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease},
}},
};
public class Stru
{
public RelicsAttribute type;
public int minValue;
public int maxvalue;
public RelicType relictype;
}
public enum RelicType
{
Featured = 2,
Gold = 1,
Common = 0,
}
public enum RelicsID
{
WesternMirror = 4100001,
ImperialTripodVessel = 4100002,
BeadsofCalmSea = 4100003,
HeartlessSeal = 4100004,
BellofDoom = 4100005
}
public enum RelicsAttribute
{
None = 0,
CriticalStrike = 1,
SkillCriticalStrike = 2,
Immunity = 3,
Breakthrough = 4,
AntiBreak = 5,
HP = 6,
PAttack = 7,
MAttack = 8,
MDefence = 9,
PAttackIncrease = 10,
MAttackIncrease = 11,
PDmgIncrease = 12,
MDmgIncrease = 13
}
//public enum RelicsType : uint
//{
// //4100000
// P_Strike = 1,//Points * 4
// M_Strike = 2,//Points * 4
// Immunity = 3,//Points * 4
// Break = 4,//Points * 4
// Anti_Break = 5,//Points * 4
// MaxHP = 6,//Points * 0
// P_Attack = 7,//Points * 2
// M_Attack = 8,//Points * 0
// M_Defense = 9,//Points * 5
// Final_P_Attack = 10,//Points * 0
// Final_M_Attack = 11,//Points * 0
// Final_P_Damage = 12,//Points * 0
// Final_M_Damage = 13,//Points * 0
//};
public static int GetSoulCount(uint data)
{
if (data == 0)
return 0;
var stringdata = data.ToString("D6");
var Type = (RelicType)int.Parse(stringdata.Substring(3, 1));
switch (Type)
{
case RelicType.Common:
return 3;
case RelicType.Gold:
return 6;
case RelicType.Featured:
return 6;
}
return 0;
}
public static ConquerItem RandomRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
int val = Kernel.Random.Next(1, 6);
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= val; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public static ConquerItem RandomSuperRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= 5; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (attr.relictype == RelicType.Common)
goto again;
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public enum RunesType : uint
{
//4100000
P_Strike = 1,//Points * 4
M_Strike = 2,//Points * 4
Immunity = 3,//Points * 4
Break = 4,//Points * 4
Anti_Break = 5,//Points * 4
MaxHP= 6,//Points * 0
P_Attack = 7,//Points * 2
M_Attack = 8,//Points * 0
M_Defense = 9,//Points * 5
Final_P_Attack = 10,//Points * 0
Final_M_Attack = 11,//Points * 0
Final_P_Damage = 12,//Points * 0
Final_M_Damage = 13,//Points * 0
};
public static uint CreatRelicAttr(int val, int isheight, RelicsAttribute type)
{
string result = val.ToString("D3") + isheight + ((int)(type)).ToString("D2");
return uint.Parse(result);
}
public static void HandleRelicDurability(Client.GameState client, ConquerItem relic)
{
if (client.Entity.MapID == 1038 || client.Entity.MapID == 1005)
return;
if (relic.Durability > 0)
{
if (relic.Durability >= 100)
relic.Durability -= 100;
else
relic.Durability = 0;
Database.ConquerItemTable.UpdateDurabilityItem2(relic, relic.ID);
Database.ConquerItemTable.UpdateDurabilityItem(relic);
relic.Mode = Game.Enums.ItemMode.Update;
relic.Send(client);
relic.Mode = Game.Enums.ItemMode.Default;
}
else if (relic.Durability == 0)
{
_String str = new _String(true)
{
UID = client.Entity.UID,
Type = 10,
TextsCount = 1
};
str.Texts.Add("EquipBroken");
client.Send(str.ToArray());
client.Send(new Message(Database.ConquerItemInformation.BaseInformations[relic.ID].Name + " is totaly damaged!", Message.TopLeft));
}
}
public static void HandleRepair(Client.GameState client, ConquerItem item, uint CrystalNeeded)
{
if (client.Inventory.Contains(3306885, CrystalNeeded))
{
if (item.Durability < item.MaximDurability)
{
client.Inventory.Remove(3306885, CrystalNeeded);
item.Durability = item.MaximDurability;
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateDurabilityItem(item);
}
}
else
client.Send("You don't have " + CrystalNeeded + " RelicCrystal!");
}
}
}
case "Superrelic":
{
client.Inventory.Add(Relics.RandomSuperRelic(0), Enums.ItemUse.CreateAndAdd);
break;
}
using Rayzo.Network.GamePackets;
using System;
using System.Collections.Generic;
namespace Rayzo.Network
{
public class Relics
{
public static Dictionary<RelicsID, List<Stru>> RelicsItemsInfo = new Dictionary<RelicsID, List<Stru>>()
{
{RelicsID.WesternMirror,new List<Stru>
{
new Stru(){ minValue = 600 , maxvalue = 900, relictype = RelicType.Featured , type = RelicsAttribute.MAttack},
new Stru(){ minValue = 100, maxvalue=200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease},
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 30, maxvalue = 49, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease },
}},
{RelicsID.ImperialTripodVessel,new List<Stru>()
{
new Stru(){ minValue = 500 , maxvalue = 800, relictype = RelicType.Featured , type = RelicsAttribute.HP},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.AntiBreak },
new Stru(){ minValue = 50, maxvalue = 60, relictype = RelicType.Gold, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Immunity },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.Breakthrough },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttack },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttack },
}},
{RelicsID.BeadsofCalmSea,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.SkillCriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
}},
{RelicsID.HeartlessSeal,new List<Stru>()
{
new Stru(){ minValue = 200 , maxvalue = 300, relictype = RelicType.Featured , type = RelicsAttribute.PAttack},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Breakthrough},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 100, relictype = RelicType.Common, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease},
}},
{RelicsID.BellofDoom,new List<Stru>()
{
new Stru(){ minValue = 100 , maxvalue = 200, relictype = RelicType.Featured , type = RelicsAttribute.CriticalStrike},
new Stru(){ minValue = 100, maxvalue= 200, relictype= RelicType.Gold , type = RelicsAttribute.Immunity},
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.AntiBreak },
new Stru(){ minValue = 100, maxvalue = 200, relictype = RelicType.Gold, type= RelicsAttribute.Breakthrough},
new Stru(){ minValue = 300, maxvalue = 500, relictype = RelicType.Gold, type= RelicsAttribute.PAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MDmgIncrease },
new Stru(){ minValue = 30, maxvalue = 50, relictype = RelicType.Common, type= RelicsAttribute.MDefence },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.MAttackIncrease },
new Stru(){ minValue = 100, maxvalue = 300, relictype = RelicType.Common, type= RelicsAttribute.PDmgIncrease},
}},
};
public class Stru
{
public RelicsAttribute type;
public int minValue;
public int maxvalue;
public RelicType relictype;
}
public enum RelicType
{
Featured = 2,
Gold = 1,
Common = 0,
}
public enum RelicsID
{
WesternMirror = 4100001,
ImperialTripodVessel = 4100002,
BeadsofCalmSea = 4100003,
HeartlessSeal = 4100004,
BellofDoom = 4100005
}
public enum RelicsAttribute
{
None = 0,
CriticalStrike = 1,
SkillCriticalStrike = 2,
Immunity = 3,
Breakthrough = 4,
AntiBreak = 5,
HP = 6,
PAttack = 7,
MAttack = 8,
MDefence = 9,
PAttackIncrease = 10,
MAttackIncrease = 11,
PDmgIncrease = 12,
MDmgIncrease = 13
}
//public enum RelicsType : uint
//{
// //4100000
// P_Strike = 1,//Points * 4
// M_Strike = 2,//Points * 4
// Immunity = 3,//Points * 4
// Break = 4,//Points * 4
// Anti_Break = 5,//Points * 4
// MaxHP = 6,//Points * 0
// P_Attack = 7,//Points * 2
// M_Attack = 8,//Points * 0
// M_Defense = 9,//Points * 5
// Final_P_Attack = 10,//Points * 0
// Final_M_Attack = 11,//Points * 0
// Final_P_Damage = 12,//Points * 0
// Final_M_Damage = 13,//Points * 0
//};
public static int GetSoulCount(uint data)
{
if (data == 0)
return 0;
var stringdata = data.ToString("D6");
var Type = (RelicType)int.Parse(stringdata.Substring(3, 1));
switch (Type)
{
case RelicType.Common:
return 3;
case RelicType.Gold:
return 6;
case RelicType.Featured:
return 6;
}
return 0;
}
public static ConquerItem RandomRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
int val = Kernel.Random.Next(1, 6);
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= val; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(new Random(Kernel.Random.Next()).Next(attr.minValue, attr.maxvalue), (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public static ConquerItem RandomSuperRelic(uint ID = 0)
{
ConquerItem item = new ConquerItem(true);
var relic = (RelicsID)Kernel.Random.Next(4100001, 4100006);
if (ID == 0)
item.ID = (uint)relic;
else
item.ID = ID;
item.Color = Game.Enums.Color.White;
item.Durability = item.MaximDurability = 10000;
var info = RelicsItemsInfo[relic];
if (ID != 0)
{
info = RelicsItemsInfo[(RelicsID)ID];
}
List<RelicsAttribute> haved = new List<RelicsAttribute>();
uint[] Runes = new uint[5] { 0, 0, 0, 0, 0 };
for (int i = 1; i <= 5; i++)
{
again:
var attr = info[new Random(Kernel.Random.Next()).Next(info.Count)];
if (attr.relictype == RelicType.Common)
goto again;
if (haved.Contains(attr.type))
goto again;
haved.Add(attr.type);
switch (i)
{
case 1:
Runes[0] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 2:
Runes[1] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 3:
Runes[2] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 4:
Runes[3] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
case 5:
Runes[4] = CreatRelicAttr(attr.maxvalue, (int)attr.relictype, attr.type);
break;
}
}
item.Runes = Runes;
return item;
}
public enum RunesType : uint
{
//4100000
P_Strike = 1,//Points * 4
M_Strike = 2,//Points * 4
Immunity = 3,//Points * 4
Break = 4,//Points * 4
Anti_Break = 5,//Points * 4
MaxHP= 6,//Points * 0
P_Attack = 7,//Points * 2
M_Attack = 8,//Points * 0
M_Defense = 9,//Points * 5
Final_P_Attack = 10,//Points * 0
Final_M_Attack = 11,//Points * 0
Final_P_Damage = 12,//Points * 0
Final_M_Damage = 13,//Points * 0
};
public static uint CreatRelicAttr(int val, int isheight, RelicsAttribute type)
{
string result = val.ToString("D3") + isheight + ((int)(type)).ToString("D2");
return uint.Parse(result);
}
public static void HandleRelicDurability(Client.GameState client, ConquerItem relic)
{
if (client.Entity.MapID == 1038 || client.Entity.MapID == 1005)
return;
if (relic.Durability > 0)
{
if (relic.Durability >= 100)
relic.Durability -= 100;
else
relic.Durability = 0;
Database.ConquerItemTable.UpdateDurabilityItem2(relic, relic.ID);
Database.ConquerItemTable.UpdateDurabilityItem(relic);
relic.Mode = Game.Enums.ItemMode.Update;
relic.Send(client);
relic.Mode = Game.Enums.ItemMode.Default;
}
else if (relic.Durability == 0)
{
_String str = new _String(true)
{
UID = client.Entity.UID,
Type = 10,
TextsCount = 1
};
str.Texts.Add("EquipBroken");
client.Send(str.ToArray());
client.Send(new Message(Database.ConquerItemInformation.BaseInformations[relic.ID].Name + " is totaly damaged!", Message.TopLeft));
}
}
public static void HandleRepair(Client.GameState client, ConquerItem item, uint CrystalNeeded)
{
if (client.Inventory.Contains(3306885, CrystalNeeded))
{
if (item.Durability < item.MaximDurability)
{
client.Inventory.Remove(3306885, CrystalNeeded);
item.Durability = item.MaximDurability;
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
Database.ConquerItemTable.UpdateDurabilityItem(item);
}
}
else
client.Send("You don't have " + CrystalNeeded + " RelicCrystal!");
}
}
}
case "Superrelic":
{
client.Inventory.Add(Relics.RandomSuperRelic(0), Enums.ItemUse.CreateAndAdd);
break;
}
|
| الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| ازاى اجيب ريلكات صوبر | mody33221 | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2020-07-17 04:11 AM |
| عندي مشكله ف الجوب سنتر | mohamedomar | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-02-15 01:31 PM |
| مشكله ف الجوب سنتر | Ahmed helmy | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2020-02-13 04:37 PM |
| سوبر جيلد وار | Peter | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-08-31 01:49 AM |
| عاوز اضيف سوبر جيلد وير | abuhaneen | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-07-13 10:39 AM |