本文整理汇总了C#中Client.LoadItemStats方法的典型用法代码示例。如果您正苦于以下问题:C# Client.LoadItemStats方法的具体用法?C# Client.LoadItemStats怎么用?C# Client.LoadItemStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.LoadItemStats方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reincarnation
public Reincarnation(Client.GameState client, byte new_class)
{
if (client.Entity.Level < 130)
return;
_client = client;
RemoveSkill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
Addskill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
#region Low level items
for (byte i = 1; i < 9; i++)
{
if (i != 7)
{
Interfaces.IConquerItem item = client.Equipment.TryGetItem(i);
if (item != null && item.ID != 0)
{
try
{
//client.UnloadItemStats(item, false);
Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(client.Entity);
Database.ConquerItemTable.UpdateItemID(item, client);
}
catch
{
Console.WriteLine("Reborn item problem: " + item.ID);
}
}
}
}
Interfaces.IConquerItem hand = client.Equipment.TryGetItem(5);
if (hand != null)
{
client.Equipment.Remove(5);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
}
else
//client.Screen.send(client.Entity.SpawnPacket, false);
#endregion
#region Remove Extra Skill
if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15 && client.Entity.Class == 15)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.DragonWhirl);
}
if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25 && client.Entity.Class == 25)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.Perseverance);
}
if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45 && client.Entity.Class == 45)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.StarArrow);
}
if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55 && client.Entity.Class == 55)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.PoisonStar);
}
if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65 && client.Entity.Class == 65)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.SoulShackle);
}
if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135 && client.Entity.Class == 135)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.AzureShield);
}
if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145 && client.Entity.Class == 145)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.HeavenBlade);
}
#endregion
Database.ReincarnationTable.NewReincarnated(client.Entity);
Game.Features.Reincarnation.ReincarnateInfo info = new Game.Features.Reincarnation.ReincarnateInfo();
info.UID = client.Entity.UID;
info.Level = client.Entity.Level;
info.Experience = client.Entity.Experience;
ServerBase.Kernel.ReincarnatedCharacters.Add(info.UID, info);
client.Entity.FirstRebornClass = client.Entity.SecondRebornClass;
client.Entity.SecondRebornClass = client.Entity.Class;
client.Entity.Class = new_class;
client.Entity.SecondRebornLevel = client.Entity.Level;
client.Entity.Level = 15;
client.Entity.Experience = 0;
client.Entity.Atributes =
(ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornClass, client.Entity.FirstRebornLevel) +
client.ExtraAtributePoints(client.Entity.SecondRebornClass, client.Entity.SecondRebornLevel) + 62);
client.Spells.Clear();
client.Spells = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(100);
switch (client.Entity.FirstRebornClass)
{
case 15:
{
Add(PhoenixProject.Game.Enums.SkillIDs.Cyclone);
Add(PhoenixProject.Game.Enums.SkillIDs.Hercules);
Add(PhoenixProject.Game.Enums.SkillIDs.SpiritHealing);
//.........这里部分代码省略.........
示例2: EquipItem
//.........这里部分代码省略.........
{
if (twohand)
client.Equipment.Remove(5);
item.Position = (byte)itemUsage.dwParam;
if (!client.AlternateEquipment)
{
client.Equipment.Add(item);
}
else
{
client.Equipment.Add505(item);
}
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
}
else
{
if (twohand)
client.Equipment.Remove(5);
client.Equipment.Remove((byte)itemUsage.dwParam);
item.Position = (byte)itemUsage.dwParam;
if (!client.AlternateEquipment)
{
client.Equipment.Add(item);
}
else
{
client.Equipment.Add505(item);
}
}
if (!client.AlternateEquipment)
{
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket();
}
else
{
ClientEquip equips = new ClientEquip(client);
//equips.DoEquips(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket2();
}
Database.ConquerItemTable.UpdateLocation(item, client);
}
}
else
{
Interfaces.IConquerItem item = null;
client.Entity.AttackPacket = null;
if (client.Inventory.TryGetItem(itemUsage.UID, out item) && client.Booth == null)
{
if (item.Suspicious)
return;
Positions pos = GetPositionFromID2(item.ID);
if (client.Entity.MapID == 2060)
{
if (pos == Positions.AltGarment)
示例3: HandlePacket
//.........这里部分代码省略.........
if (client.Inventory.ContainsUID(key))
client.Inventory.Remove(key, PhoenixProject.Game.Enums.ItemUse.Remove, true);
}
client.Inventory.Add(ItemAdd, 0, 1);
}
}
break;
}
case 52:
{
var item = Database.ConquerItemTable.LoadItem(usage.UID);
item.Mode = PhoenixProject.Game.Enums.ItemMode.ChatItem;
item.Send(client);
break;
}
case 41:
{
// var item = Database.ConquerItemTable.LoadItem(usage.UID);
usage.dwParam = 1;
client.Send(usage);
break;
}
case ItemUsage.SwitchEquipsBack:
case ItemUsage.SwitchEquips:
{
client.AlternateEquipment = usage.ID == ItemUsage.SwitchEquips;
if (usage.ID == 45)
{
ClientEquip equips = new ClientEquip(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket2();
client.LoadItemStats2(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.Send(WindowStats(client));
}
else
{
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket();
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.Send(WindowStats(client));
}
usage.dwParam = 1;
client.Send(usage);
break;
}
case ItemUsage.ArrowReload:
{
ReloadArrows(client.Equipment.TryGetItem(ConquerItem.LeftWeapon), client);
break;
}
case ItemUsage.ShowBoothItems:
{
ShowBoothItems(usage, client);
break;
}
case ItemUsage.AddItemOnBoothForSilvers:
case ItemUsage.AddItemOnBoothForConquerPoints:
示例4: Reincarnation
//.........这里部分代码省略.........
{
client.RemoveSpell(new Spell(true) { ID = 6002 });
}
if (client.Entity.Class == 132)
{
client.RemoveSpell(new Spell(true) { ID = 6002 });
}
#endregion
#region Proficiencies
foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
{
proficiency.PreviousLevel = proficiency.Level;
proficiency.Level = 0;
proficiency.Experience = 0;
proficiency.Send(client);
}
#endregion
#region Low level items
for (byte i = 1; i < 9; i++)
{
if (i != 7)
{
Interfaces.IConquerItem item = client.Equipment.TryGetItem(i);
if (item != null && item.ID != 0)
{
try
{
//client.UnloadItemStats(item, false);
Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
Database.ConquerItemTable.UpdateItemID(item, client);
}
catch
{
Console.WriteLine("Reborn item problem: " + item.ID);
}
}
}
}
#region Alt Fix By Amjad
Interfaces.IConquerItem AltRing = client.Equipment.TryGetItem(26);
if (AltRing != null)
{
client.Equipment.Remove(26);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltRightHand = client.Equipment.TryGetItem(24);
if (AltRightHand != null)
{
client.Equipment.Remove(24);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltNecklace = client.Equipment.TryGetItem(22);
if (AltNecklace != null)
示例5: UnequipItem
public static void UnequipItem(ItemUsage usage, Client.GameState client)
{
Positions pos = GetPositionFromID(usage.UID);
if (client.Entity.MapID == 2060)
{
if (usage.dwParam == 9)
{
return;
}
}
if (client.Entity.MapID == 7009)
{
if (usage.dwParam == 9)
{
return;
}
}
if (client.Equipment.Remove((byte)usage.dwParam))
{
if (client.Map.ID == 1039)
client.Entity.AttackPacket = null;
if (!client.AlternateEquipment)
{
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket();
}
else
{
client.LoadItemStats2(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
ClientEquip equips = new ClientEquip(client);
client.Send(equips);
client.Equipment.UpdateEntityPacket2();
}
}
}
示例6: PurifyItem
public static void PurifyItem(Purification ps, Client.GameState client)
{
Interfaces.IConquerItem Item = null, AddingItem = null;
if (client.Inventory.TryGetItem(ps.ItemUID, out Item) && client.Inventory.TryGetItem(ps.AddUID, out AddingItem))
{
if (ps.ItemUID == ps.AddUID)
return;
var PurifyInformation = Database.ConquerItemInformation.BaseInformations[AddingItem.ID];
var ItemInformation = Database.ConquerItemInformation.BaseInformations[Item.ID];
if (PurifyInformation.PurificationLevel > 0)
{
if (ItemInformation.Level >= PurifyInformation.Level)
{
if (client.Inventory.Contains(1088001, PurifyInformation.PurificationMeteorNeed))
{
client.Inventory.Remove(1088001, (byte)PurifyInformation.PurificationMeteorNeed);
if (Item.Purification.PurificationItemID > 0)
Database.ItemAddingTable.RemoveAdding(Item.UID, Item.Purification.PurificationItemID);
client.Send(ps);
ItemAdding.Purification_ purify = new ItemAdding.Purification_();
purify.AddedOn = DateTime.Now;
purify.Available = true;
purify.ItemUID = ps.ItemUID;
purify.PurificationLevel = PurifyInformation.PurificationLevel;
purify.PurificationDuration = 7 * 24 * 60 * 60;
purify.PurificationItemID = AddingItem.ID;
Database.ItemAddingTable.AddPurification(purify);
Item.Purification = purify;
Item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
Item.Send(client);
client.Inventory.Remove(AddingItem, PhoenixProject.Game.Enums.ItemUse.Remove);
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.Send(ps);
}
}
}
}
}
示例7: PurifyRefinery
public static void PurifyRefinery(Purification ps, Client.GameState client)
{
Interfaces.IConquerItem item = null, refine = null;
client.Inventory.TryGetItem(ps.ItemUID, out item);
client.Inventory.TryGetItem(ps.AddUID, out refine);
if (refine != null)
{
if (item == null)
item = client.Equipment.TryGetItem(ps.ItemUID);
if (item != null)
{
Refinery.RefineryItem refineStats;
if (Kernel.DatabaseRefinery.TryGetValue(refine.ID, out refineStats))
{
Boolean valid = true;
if (item.Position < 100)
{
UInt32 iType = item.ID / 1000;
Positions pos = GetPositionFromID(item.ID);
if (pos != (Positions)refineStats.Position)
valid = false;
if (pos == Positions.Garment)
return;
if (pos == Positions.Steed)
return;
if (pos == Positions.Bottle)
return;
if (pos == Positions.SteedArmor)
return;
if (pos == Positions.SteedTalisman)
return;
if (pos == Positions.LeftAccessory)
return;
if (pos == Positions.RightAccessory)
return;
if (pos == Positions.DefenceTalisman)
return;
if (pos == Positions.AttackTalisman)
return;
else if (refineStats.Position == 5)
valid = item.IsTwoHander();
if (iType == refineStats.Position)
valid = true;
}
else
{
if (item.GetItemType() != (ConquerItem.ItemTypes)refineStats.Position)
valid = false;
}
if (valid)
{
if (item.Position == 7)
return;
if (item.Position == 9)
return;
if (item.Position == 11)
return;
if (item.Position == 12)
return;
if (item.Position == 10)
return;
if (item.Position == 18)
return;
if (item.Position == 17)
return;
if (item.Position == 15)
return;
if (item.Position == 16)
return;
client.Inventory.Remove(refine, Game.Enums.ItemUse.Remove);
item.RefineItem = refineStats.Identifier;
item.Mode = Game.Enums.ItemMode.Update;
item.RefineryTime = DateTime.Now.AddDays(7);
item.Send(client);
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
Database.ConquerItemTable.UpdateRefineryItem(item);
Database.ConquerItemTable.UpdateRefineryTime(item);
client.Send(WindowStats(client));
//LoadItemStatus(client);
// c.Send(new Game_HeroStats(c.Hero));
}
else
client.Send(new Message(String.Format("You cannot refine your {0} with that {1}.",
Database.ConquerItemInformation.BaseInformations[item.ID].Name, Database.ConquerItemInformation.BaseInformations[refine.ID].Name), System.Drawing.Color.Red, Message.TopLeft));
}
else
Console.WriteLine(String.Format("No database refinery {0}", refine.ID));
}
}
}
示例8: LoginMessages
//.........这里部分代码省略.........
}
if (client.Entity.Class >= 40 && client.Entity.Class <= 45)
{
if (client.Spells.ContainsKey(1025))
{
client.RemoveSpell(new Spell(true) { ID = 1025 });//SuperMan
}
}
if (client.Entity.Class >= 142 && client.Entity.Class <= 145)
{
if (client.Spells.ContainsKey(6002))
{
client.RemoveSpell(new Spell(true) { ID = 6002 });//PiosnStar
}
}
client.WentToComplete = true;
client.Entity.SendUpdates = true;
foreach (Interfaces.IConquerItem item in client.Inventory.Objects)
{
item.Send(client);
}
foreach (Interfaces.IConquerItem item in client.Equipment.Objects)
if (item != null)
{
if (Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
{
item.Send(client);
ItemUsage usage = new ItemUsage(true) { ID = ItemUsage.EquipItem };
usage.UID = item.UID;
usage.dwParam = item.Position;
client.Send(usage);
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
{
client.Equipment.DestroyArrow(item.Position);
}
}
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.Equipment.UpdateEntityPacket();
ClientEquip equips = new ClientEquip();
equips.DoEquips(client);
client.Send(equips);
foreach (var Guild in ServerBase.Kernel.Guilds.Values)
{
Guild.SendName(client);
}
if (client.Entity.ClanId != 0 && client.Entity.ClanRank != 0 && client.Entity.ClanName != "")
{
if (client.Entity.Myclan != null)
{
Network.GamePackets.Clan cl = new PhoenixProject.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
}
}
ServerTime time = new ServerTime();
time.Year = (uint)DateTime.Now.Year;
time.Month = (uint)DateTime.Now.Month;
time.DayOfYear = (uint)DateTime.Now.DayOfYear;
示例9: CheckItemExtra
public static void CheckItemExtra(Interfaces.IConquerItem i, Client.GameState c)
{
if (i.RefineryTime.Ticks != 0)
{
if (DateTime.Now > i.RefineryTime)
{
i.RefineItem = 0;
i.RefineryTime = new DateTime(0);
Game_ItemSoul expire = new Game_ItemSoul()
{
Identifier = i.UID
};
expire.Expired(c);
i.Send(c);
c.Send(PacketHandler.WindowStats(c));
Database.ConquerItemTable.UpdateRefineryItem(i);
Database.ConquerItemTable.UpdateRefineryTime(i);
if (!c.Equipment.Free(i.Position))
{
//c.UnloadItemStats(i, true);
c.LoadItemStats(c.Entity);
}
}
}
}
示例10: LoginMessages
//.........这里部分代码省略.........
// data.ID = Network.GamePackets.Data.OpenCustom;
// data.dwParam = Network.GamePackets.Data.CustomCommands.Minimize;
// client.Send(data);
// client.Send(new Message(ServerBase.Constants.ServerWebsite + ServerBase.Constants.WebAccExt + ServerBase.Constants.WebVoteExt, System.Drawing.Color.Red, Network.GamePackets.Message.Website));
// };
// client.Send(new NpcReply(NpcReply.MessageBox, "Would you like to consider voting for us? With more votes we will be come a bigger community."));
//}
/*if (client.Entity.VIPLevel != 0)
{
Database.PremiumTable.getVipInfo(client);
if (client.VIPDays != 0)
{
if (DateTime.Now >= client.VIPDate.AddDays(client.VIPDays))
{
client.Entity.VIPLevel = 0;
client.Send(ServerBase.Constants.VIPExpired);
}
else
{
DateTime VipEnds = client.VIPDate.AddDays(client.VIPDays);
TimeSpan span = VipEnds.Subtract(DateTime.Now);
client.Send(ServerBase.Constants.VIPRemaining(span.Days.ToString(), span.Hours.ToString()));
}
}
else
client.Send(ServerBase.Constants.VIPLifetime);
}*/
//if (Program.Today == DayOfWeek.Saturday || Program.Today == DayOfWeek.Sunday)
// client.Send(new Message("Double experience is on.", System.Drawing.Color.Red, Message.World));
client.Send(new MapStatus() { BaseID = client.Map.BaseID, ID = client.Map.ID, Status = Database.MapsTable.MapInformations[client.Map.ID].Status });
if (client.Entity.Hitpoints == 0)
client.Entity.Hitpoints = 1;
client.Entity.VIPLevel = (byte)(client.Entity.VIPLevel + 0);
client.Entity.HandleTiming = true;
if (client.Entity.ExtraBattlePower != 0)
client.Entity.Update(Network.GamePackets.Update.ExtraBattlePower, client.Entity.ExtraBattlePower, false);
if (client.Guild != null)
client.Guild.SendAllyAndEnemy(client);
if (Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID > 2)
client.Send(new Network.GamePackets.Message(Game.ConquerStructures.Broadcast.CurrentBroadcast.Message, "ALLUSERS", Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityName, System.Drawing.Color.Red, Network.GamePackets.Message.BroadcastMessage));
client.Entity.Update(Network.GamePackets.Update.LuckyTimeTimer, client.BlessTime, false);
if (client.Entity.HeavenBlessing != 0)
client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
if (client.ClaimableItem.Count > 0)
foreach (var item in client.ClaimableItem.Values)
item.Send(client);
if (client.DeatinedItem.Count > 0)
foreach (var item in client.DeatinedItem.Values)
item.Send(client);
foreach (Interfaces.IConquerItem item in client.Inventory.Objects)
item.Send(client);
foreach (Interfaces.IConquerItem item in client.Equipment.Objects)
if (item != null)
{
if (Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
{
item.Send(client);
ItemUsage usage = new ItemUsage(true) { ID = ItemUsage.EquipItem };
usage.UID = item.UID;
usage.dwParam = item.Position;
client.Send(usage);
client.LoadItemStats(item);
}
else
{
client.Equipment.DestroyArrow(item.Position);
Console.WriteLine("Announcement: Item have been removed because of invalid info. UID: " + item.UID + ". OWNER: " + client.Entity.Name);
}
}
if (!client.Equipment.Free(5))
{
if (IsArrow(client.Equipment.TryGetItem(5).ID))
{
if (client.Equipment.Free(4))
client.Equipment.DestroyArrow(5);
else
{
if (client.Equipment.TryGetItem(4).ID / 1000 != 500)
client.Equipment.DestroyArrow(5);
}
}
}
client.GemAlgorithm();
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
// Conquer_Online_Server.Game.Attacking.Calculate.Vitals(client.Entity, true);
client.Equipment.UpdateEntityPacket();
EntityEquipment equips = new EntityEquipment(true);
equips.ParseHero(client);
client.Send(equips);
System.Threading.Thread.Sleep(3500);
//if ((int)client.Account.State >= 3)
// client.Entity.AddFlag(Update.Flags.Flashy);
}
示例11: AddandWear
public bool AddandWear(uint id, byte plus, byte times, Client.GameState client)
{
try
{
Database.ConquerItemInformation infos = new Database.ConquerItemInformation(id, plus);
while (times > 0)
{
if (Count <= 39)
{
Interfaces.IConquerItem item = new Network.GamePackets.ConquerItem(true);
item.ID = id;
item.Plus = plus;
item.Color = PhoenixProject.Game.Enums.Color.Red;
item.Durability = item.MaximDurability = infos.BaseInformation.Durability;
Add(item, Enums.ItemUse.CreateAndAdd);
client.Inventory.Remove(item, Game.Enums.ItemUse.Move, true);
PhoenixProject.Network.PacketHandler.Positions pos = PhoenixProject.Network.PacketHandler.GetPositionFromID(item.ID);
item.Position = (byte)pos;
client.Equipment.Add(item);
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.LoadItemStats(client.Entity);
PhoenixProject.Network.GamePackets.ClientEquip equips = new PhoenixProject.Network.GamePackets.ClientEquip();
equips.DoEquips(client);
client.Send(equips);
Database.ConquerItemTable.UpdateLocation(item, client);
}
else
{
return false;
}
times--;
}
}
catch (Exception e)
{
Program.SaveException(e);
}
return true;
}
示例12: GetDialog
//.........这里部分代码省略.........
if (client.Inventory.Contains(id, cost) || useScrolls)
{
if (useScrolls)
{
client.Inventory.Remove(720027, Convert.ToByte((cost / 10) + extraScroll));
client.Inventory.Add(1088001, 0, (byte)addMets);
}
else
client.Inventory.Remove(id, cost);
client.UnloadItemStats(item, false);
if (client.UpdateType == 1)
{
Conquer_Online_Server.Database.ConquerItemInformation infos2 = new Conquer_Online_Server.Database.ConquerItemInformation(infos.CalculateUplevel(), item.Plus);
if (infos2.BaseInformation.ID == infos.BaseInformation.ID)
return;
if (client.Entity.Level < infos2.BaseInformation.Level)
{
dialog.Text("You need level " + infos2.BaseInformation.Level + " first.");
dialog.Option("Ahh sorry.", 255);
dialog.Send();
client.SelectedItem = 0;
client.UpdateType = 0;
return;
}
item.ID = infos.CalculateUplevel();
}
else
item.ID = infos.CalculateDownlevel();
Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(item);
client.Equipment.UpdateEntityPacket();
}
break;
}
case 3:
{
byte cost = (byte)(itemdetail.Level / 30);
cost += (byte)((item.ID % 10) / 2);
uint id = 1088000;
if (client.Inventory.Contains(id, cost))
{
client.Inventory.Remove(id, cost);
client.UnloadItemStats(item, false);
if (item.ID % 10 < 5)
item.ID += 5 - item.ID % 10;
item.ID++;
Conquer_Online_Server.Database.ConquerItemTable.UpdateItemID(item, client);
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(item);
client.Equipment.UpdateEntityPacket();
}
break;
}
}
break;
}
default:
{
if (npcRequest.OptionID == 255)
break;