public override void RemoveItemFromPanel(CharacterItemRecord obj, int quantity) { if (obj.Quantity == (uint)-quantity) { Client.Send(new ExchangeObjectRemovedMessage(false, obj.UID)); SecondTrader.Send(new ExchangeObjectRemovedMessage(true, obj.UID)); ExchangedItems.Remove(obj); return; } else { obj.Quantity = (uint)(obj.Quantity + quantity); Client.Send(new ExchangeObjectModifiedMessage(false, obj.GetObjectItem())); SecondTrader.Send(new ExchangeObjectModifiedMessage(true, obj.GetObjectItem())); } }
public static void HandleMimicryObjectFreeAndAssociateRequest(MimicryObjectFeedAndAssociateRequestMessage message, WorldClient client) { var mimicryUsable = client.Character.Inventory.GetFirstItem(14485, 1); if (mimicryUsable == null) { return; } CharacterItemRecord hostItem = client.Character.Inventory.GetItem(message.hostUID); CharacterItemRecord foodItem = client.Character.Inventory.GetItem(message.foodUID); if (hostItem == null || foodItem == null) { return; } if (hostItem.Template.TypeEnum == ItemTypeEnum.FAMILIER || foodItem.Template.TypeEnum == ItemTypeEnum.FAMILIER) { client.Character.ReplyError("Les Familiers ne peuvent pas êtres Mimibiotiers"); return; } if (hostItem.IsAssociated || foodItem.IsAssociated) { client.Character.ReplyError("Les objets associés ne peuvent pas être mimibioté."); return; } if (hostItem.GId == foodItem.GId) { client.Character.ReplyError("Les Objets que vous voulez Mimibioter sont les mêmes"); return; } if (hostItem.Template.Level < foodItem.Template.Level) { client.Character.ReplyError("Impossible d'associer ces objets car le niveau de l'item d'appearence est inferieur au niveau de l'item de base."); return; } CharacterItemRecord mimicry = hostItem.ToMimicry(foodItem.GId, foodItem.AppearanceId); if (message.preview) { client.Send(new MimicryObjectPreviewMessage(mimicry.GetObjectItem())); } else { client.Character.Inventory.RemoveItem(message.hostUID, 1); client.Character.Inventory.RemoveItem(message.foodUID, 1); client.Character.Inventory.RemoveItem(message.symbioteUID, 1); client.Character.Inventory.RemoveItem(mimicryUsable, 1); client.Character.Inventory.AddItem(mimicry); mimicry.UpdateElement(); client.Send(new MimicryObjectAssociatedMessage(mimicry.UId)); } }
public static void HandleFeedAndAssociate(MimicryObjectFeedAndAssociateRequestMessage message, WorldClient client) { CharacterItemRecord hostItem = client.Character.Inventory.GetItem(message.hostUID); CharacterItemRecord foodItem = client.Character.Inventory.GetItem(message.foodUID); if (hostItem.GetTemplate().Type == ItemTypeEnum.PET || foodItem.GetTemplate().Type == ItemTypeEnum.PET) { client.Character.Reply("Impossible de mimibioter les familiers."); return; } if (hostItem.ContainEffect(EffectsEnum.Eff_Mimicry) || foodItem.ContainEffect(EffectsEnum.Eff_Mimicry)) { client.Character.Reply("Impossible d'associer ces objets car l'un d'eux possède déja un mimibiote."); return; } if (hostItem.GID == foodItem.GID) { client.Character.Reply("Impossible d'associer ces objets car ce sont les mêmes..."); return; } if (hostItem.GetTemplate().Type != foodItem.GetTemplate().Type) { client.Character.Reply("Impossible d'associer ces objets car ils ne sont pas du même types"); return; } if (hostItem.GetTemplate().Level < foodItem.GetTemplate().Level) { client.Character.Reply("Impossible d'associer ces objets car le niveau de l'item d'appearence est inferieur au niveau de l'item de base."); return; } CharacterItemRecord mimicry = hostItem.ToMimicry(foodItem.GID); if (message.preview) { client.Send(new MimicryObjectPreviewMessage(mimicry.GetObjectItem())); } else { client.Character.Inventory.RemoveItem(message.hostUID, 1); client.Character.Inventory.RemoveItem(message.foodUID, 1); client.Character.Inventory.RemoveItem(message.symbioteUID, 1); client.Character.Inventory.Add(mimicry); client.Send(new MimicryObjectAssociatedMessage(mimicry.UID)); } }
public override void RemoveItemFromPanel(CharacterItemRecord obj, int quantity) { if (obj.IsNull()) { return; } if (obj.Quantity == (uint)-quantity) { Client.Send(new ExchangeObjectRemovedMessage(false, obj.UID)); obj = null; return; } else { obj.Quantity = (uint)(obj.Quantity + quantity); Client.Send(new ExchangeObjectModifiedMessage(false, obj.GetObjectItem())); } }
private void OnObjectModified(CharacterItemRecord obj) { this.Character.Client.Send(new ExchangeObjectModifiedMessage(false, obj.GetObjectItem())); this.SecondTrader.Client.Send(new ExchangeObjectModifiedMessage(true, obj.GetObjectItem())); }
void ExchangedItems_OnItemAdded(CharacterItemRecord obj) { this.Character.Client.Send(new ExchangeObjectAddedMessage(false, obj.GetObjectItem())); this.SecondTrader.Client.Send(new ExchangeObjectAddedMessage(true, obj.GetObjectItem())); }
public override void RemoveItemFromPanel(CharacterItemRecord obj, int quantity) { if (obj.IsNull()) return; if (obj.Quantity == (uint)-quantity) { Client.Send(new ExchangeObjectRemovedMessage(false, obj.UID)); obj = null; return; } else { obj.Quantity = (uint)(obj.Quantity + quantity); Client.Send(new ExchangeObjectModifiedMessage(false, obj.GetObjectItem())); } }
public override void RemoveItemFromPanel(CharacterItemRecord obj, int quantity) { if (obj.Quantity == (uint)-quantity) { Client.Send(new ExchangeObjectRemovedMessage(false, obj.UID)); SecondTrader.Send(new ExchangeObjectRemovedMessage(true, obj.UID)); ExchangedItems.Remove(obj); return; } else { obj.Quantity = (uint)(obj.Quantity + quantity); Client.Send(new ExchangeObjectModifiedMessage(false, obj.GetObjectItem())); SecondTrader.Send(new ExchangeObjectModifiedMessage(true, obj.GetObjectItem())); } }
void CraftedItems_OnItemQuantityChanged(CharacterItemRecord arg1, uint arg2) { this.Character.Client.Send(new ExchangeObjectModifiedMessage(false, arg1.GetObjectItem())); }
void CraftedItems_OnItemAdded(CharacterItemRecord obj) { Character.Client.Send(new ExchangeObjectAddedMessage(false, obj.GetObjectItem())); }