BlackTulip that works as it should.
Code:
using System;
using Redux.Game_Server;
using Redux.Structures;
namespace Redux.Items
{
/// <summary>
/// Handles item usage for [723584] Black Tulip
/// </summary>
public class Item_723584:IItem
{
public override void Run(Player _client, ConquerItem _item)
{
ConquerItem arm;
_client.TryGetEquipmentByLocation(Enum.ItemLocation.Armor, out arm);
if (arm != null && arm.Color != 2)
{
arm.Color = 2;
_client.SpawnPacket.ArmorColor = 2;
_client.SendToScreen(_client.SpawnPacket, true);
_client.Send(Packets.Game.ItemInformationPacket.Create(arm, Enum.ItemInfoAction.Update));
arm.Save();
_client.DeleteItem(_item);
}
}
}
}
Also add this line to ConquerItem.cs under the Save method:
(This is why it wasnt saving when you logout)
Code:
DbItem.Color = Color;
Quote:
Originally Posted by !DeX!
i got MAD about blackTuilp my last Code
Code:
using Redux.Enum;
using Redux.Game_Server;
using Redux.Packets.Game;
using Redux.Structures;
using System;
using Redux.Network;
using Redux.Managers;
using Redux.Database.Domain;
using System.Collections.Generic;
namespace Redux.Items
{
public class Item_723584 : IItem
{
public override void Run(Player client, ConquerItem _mainItem )
{
if (client.TryGetEquipmentByLocation(ItemLocation.Armor, out _mainItem))
{
Structures.ConquerItem arm;
client.TryGetEquipmentByLocation(Enum.ItemLocation.Armor, out arm);
if (arm != null)
{
arm.Color = 2;
arm.Save();
client.Send(ItemInformationPacket.Create(arm, Enum.ItemInfoAction.Update));
client.SpawnPacket.ArmorColor = 2;
client.SendToScreen(client.SpawnPacket);
}
_mainItem.Color = 2;
_mainItem.Color = 2;
PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "WELLDONE, " + client.Name + " Make HIS ARMOR BLACK "));
_mainItem.Save();
client.Send(ItemInformationPacket.Create(_mainItem, ItemInfoAction.Update));
_mainItem.Save();
client.SpawnPacket = SpawnEntityPacket.Create(client);
SpawnEntityPacket packet = new SpawnEntityPacket();
packet.ArmorColor = 2;
_mainItem.Save();
client.Send(ItemInformationPacket.Create(_mainItem, ItemInfoAction.Update));
client.SendToScreen(client.SpawnPacket);
client.DeleteItem(723584);
}
}
}
}
When u drop it in ground and pickitup it Will Save IT AS Black xD
but When use it and relogin Will not save :(
|
Take a look at my black tulip above, it does exactly what it needs to.
The code you posted above, you do the same thing over about 3 times.
You had everything you needed inside your second if statement...