Edits your actual dye (1 is the body one, 2 is the accessory) on the DB and on char (no need to nexus). You need to enter the value "Tex#" (#=1/2) in the dyes/cloths XMLs.
Just add this to the commands:
Code:
else if (cmd.Equals("dye1", StringComparison.OrdinalIgnoreCase))
{
int converted = dyes_hextointmod.hextoint(args[0].ToString(), false);
using (var db1 = new Database())
{
using (var mysqlcommand = db1.CreateQuery())
{
mysqlcommand.CommandText = "UPDATE characters SET tex1 = @tex1 WHERE accId=@accId AND charId=@charId AND charId=@charId;";
mysqlcommand.Parameters.AddWithValue("@accId", psr.Account.AccountId);
mysqlcommand.Parameters.AddWithValue( @tex1", converted);
mysqlcommand.Parameters.AddWithValue("@charId", psr.Character.CharacterId);
if (mysqlcommand.ExecuteNonQuery() > 0)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified dye!"
});
else if (mysqlcommand.ExecuteNonQuery() == -1)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified dye!"
});
else
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Error!"
});
}
};
psr.Player.Texture1 = converted;
UpdateCount++;
}
else if (cmd.Equals("cloth1", StringComparison.OrdinalIgnoreCase))
{
int converted = dyes_hextointmod.hextoint(args[0].ToString(), true);
using (var db1 = new Database())
{
using (var mysqlcommand = db1.CreateQuery())
{
mysqlcommand.CommandText = "UPDATE characters SET tex1 = @tex1 WHERE accId=@accId AND charId=@charId AND charId=@charId;";
mysqlcommand.Parameters.AddWithValue("@accId", psr.Account.AccountId);
mysqlcommand.Parameters.AddWithValue( @tex1", converted);
mysqlcommand.Parameters.AddWithValue("@charId", psr.Character.CharacterId);
if (mysqlcommand.ExecuteNonQuery() > 0)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified cloth!"
});
else if (mysqlcommand.ExecuteNonQuery() == -1)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified cloth!"
});
else
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Error!"
});
}
};
psr.Player.Texture1 = converted;
UpdateCount++;
}
else if (cmd.Equals("dye2", StringComparison.OrdinalIgnoreCase))
{
int converted = dyes_hextointmod.hextoint(args[0].ToString(), false);
using (var db1 = new Database())
{
using (var mysqlcommand = db1.CreateQuery())
{
mysqlcommand.CommandText = "UPDATE characters SET tex2 = @tex2 WHERE accId=@accId AND charId=@charId;";
mysqlcommand.Parameters.AddWithValue("@accId", psr.Account.AccountId);
mysqlcommand.Parameters.AddWithValue( @tex2", converted);
mysqlcommand.Parameters.AddWithValue("@charId", psr.Character.CharacterId);
if (mysqlcommand.ExecuteNonQuery() > 0)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified dye!"
});
else if (mysqlcommand.ExecuteNonQuery() == -1)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified dye!"
});
else
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Error!"
});
}
};
psr.Player.Texture2 = converted;
UpdateCount++;
}
else if (cmd.Equals("cloth2", StringComparison.OrdinalIgnoreCase))
{
int converted = dyes_hextointmod.hextoint(args[0].ToString(), true);
using (var db1 = new Database())
{
using (var mysqlcommand = db1.CreateQuery())
{
mysqlcommand.CommandText = "UPDATE characters SET tex2 = @tex2 WHERE accId=@accId AND charId=@charId;";
mysqlcommand.Parameters.AddWithValue("@accId", psr.Account.AccountId);
mysqlcommand.Parameters.AddWithValue( @tex2", converted);
mysqlcommand.Parameters.AddWithValue("@charId", psr.Character.CharacterId);
if (mysqlcommand.ExecuteNonQuery() > 0)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified cloth!"
});
else if (mysqlcommand.ExecuteNonQuery() == -1)
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Modified cloth!"
});
else
psr.SendPacket(new TextPacket()
{
BubbleTime = 0,
Stars = -1,
Name = "",
Text = "Error!"
});
}
};
psr.Player.Texture2 = converted;
UpdateCount++;
}
You will need that new class too (Rightclick on project>Add Item>Class>call it dyes_hextointmod), copypaste that code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace db
{
static public class dyes_hextointmod
{
public static int hextoint(String hex, bool cloth)
{
int converted = 0;
if (hex.StartsWith("0x"))
{
hex = hex.Substring(2);
if (cloth == true)
hex = "0" + hex;
converted = Convert.ToInt32(hex, 16);
}
else
if (cloth == true)
hex = "0" + hex;
converted = Convert.ToInt32(hex, 16);
return converted;
}
}
}