Boa tarde Pessoal, vendo trazer a vocês a Barber, um npc de mudar o cabelo do seu character.
Primeiramente abra o Projecto
em seguida va a Handler/NPCTalk.cs
Adicione em um dos casos
Aperte Ctrl+F e procure por
Adicione abaixo do codigo acima
Pronto ,você já tem o NPC
Agora va em Handler/UseItem.cs, adicione o codigo abaixo em um dos Casos
agora procure por
Adicione logo abaixo do codigo acima
Creditos : I'am Noob do elitepvprs.
Pronto , Codigo completinhoo!!
Boa Tarde a Todos
Primeiramente abra o Projecto
em seguida va a Handler/NPCTalk.cs
Adicione em um dos casos
- Código:
case 10002://Barber
{
if (LinkBack == 0)
{
CSocket.Client.Hair_old = CSocket.Client.Hair;
Text("I'm capable of changing your hairstyles at a cost of 500 silvers.", CSocket);
Link("New Dynasty Hairstyles.", 1, CSocket);
Link("New Styles.", 2, CSocket);
Link("Nostalgic styles.", 3, CSocket);
Link("PC Styles", 4, CSocket);
Link("Keep my current style.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Text("Which style would you like to select from?", CSocket);
Link("New Dynasty 1", 5, CSocket);
Link("New Dynasty 2", 6, CSocket);
Link("New Dynasty 3", 7, CSocket);
Link("New Dynasty 4", 8, CSocket);
Link("New Dynasty 5", 9, CSocket);
Link("Next Page", 60, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 60)
{
Text("Which style would you like to select from?", CSocket);
Link("New Dynasty 6", 10, CSocket);
Link("New Dynasty 7", 11, CSocket);
Link("New Dynasty 8", 12, CSocket);
Link("New Dynasty 9", 13, CSocket);
Link("New Dynasty 10", 14, CSocket);
Link("Next Page", 61, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 61)
{
Text("Which style would you like to select from?", CSocket);
Link("New Dynasty 11", 15, CSocket);
Link("I changed my mind.", 65, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 2)
{
Text("Which style would you like to select from?", CSocket);
Link("New Style 1", 16, CSocket);
Link("New Style 2", 17, CSocket);
Link("New Style 3", 18, CSocket);
Link("New Style 4", 19, CSocket);
Link("New Style 5", 20, CSocket);
Link("Next Page", 62, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 62)
{
Text("Which style would you like to select from?", CSocket);
Link("New Style 6", 21, CSocket);
Link("New Style 7", 22, CSocket);
Link("New Style 8", 23, CSocket);
Link("New Style 9", 24, CSocket);
Link("New Style 10", 25, CSocket);
Link("Next Page", 63, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 63)
{
Text("Which style would you like to select from?", CSocket);
Link("New Style 11", 26, CSocket);
Link("I changed my mind.", 65, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 3)
{
Text("Which style would you like to select from?", CSocket);
Link("Nostalgic 1", 27, CSocket);
Link("Nostalgic 2", 28, CSocket);
Link("Nostalgic 3", 29, CSocket);
Link("Nostalgic 4", 30, CSocket);
Link("Nostalgic 5", 31, CSocket);
Link("Next Page", 64, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 64)
{
Text("Which style would you like to select from?", CSocket);
Link("Nostalgic 6", 32, CSocket);
Link("Nostalgic 7", 33, CSocket);
Link("Nostalgic 8", 34, CSocket);
Link("I changed my mind.", 65, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack == 4)
{
Text("Which style would you like to select from?", CSocket);
Link("PC Style 1", 35, CSocket);
Link("PC Style 2", 36, CSocket);
Link("PC Style 3", 37, CSocket);
Link("PC Style 4", 38, CSocket);
Link("PC Style 5", 39, CSocket);
Link("I changed my mind.", 65, CSocket);
Face(30, CSocket); End(CSocket);
}
else if (LinkBack >= 5 && LinkBack <= 15)
{
CSocket.Client.Hair = calcHairColor(CSocket.Client.Hair) + 36 + LinkBack; // change hair
ConquerPacket.ToLocal(ConquerPacket.Effect(CSocket.Client.ID, "Health"), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Your hair style has been changed. Are you satisfied with it?", CSocket);
Link("Yes. Thank you", 50, CSocket);
Link("Pick another style", 1, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack >= 16 && LinkBack <= 26)
{
CSocket.Client.Hair = calcHairColor(CSocket.Client.Hair) + 14 + LinkBack; // change hair
ConquerPacket.ToLocal(ConquerPacket.Effect(CSocket.Client.ID, "Health"), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Your hair style has been changed. Are you satisfied with it?", CSocket);
Link("Yes. Thank you", 50, CSocket);
Link("Pick another style", 2, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack >= 27 && LinkBack <= 34)
{
CSocket.Client.Hair = calcHairColor(CSocket.Client.Hair) - 17 + LinkBack; // change hair
ConquerPacket.ToLocal(ConquerPacket.Effect(CSocket.Client.ID, "Health"), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Your hair style has been changed. Are you satisfied with it?", CSocket);
Link("Yes. Thank you", 50, CSocket);
Link("Pick another style", 3, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack >= 35 && LinkBack <= 39)
{
CSocket.Client.Hair = calcHairColor(CSocket.Client.Hair) - 14 + LinkBack; // change hair
ConquerPacket.ToLocal(ConquerPacket.Effect(CSocket.Client.ID, "Health"), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Your hair style has been changed. Are you satisfied with it?", CSocket);
Link("Yes. Thank you", 50, CSocket);
Link("Pick another style", 4, CSocket);
Face(30, CSocket);
End(CSocket);
}
else if (LinkBack == 50) //check/deduct money
{
if (CSocket.Client.Money >= 500)
{
Money(-500, CSocket);
Text("I hope you enjoy your new hair style.", CSocket);
Link("Thanks.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
else
{
CSocket.Client.Hair = CSocket.Client.Hair_old;
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("You do not have 500 Silvers to change your hair style.", CSocket);
Link("Sorry sir.", 255, CSocket);
Face(30, CSocket);
End(CSocket);
}
}
else if (LinkBack == 65)
{
CSocket.Client.Hair = CSocket.Client.Hair_old;
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Dare you try to rip me off?! Be gone, fool!", CSocket);
Link("Sorry sir.", 255, CSocket);
Face(30, CSocket); End(CSocket);
}
else
{
CSocket.Client.Hair = CSocket.Client.Hair_old;
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
Text("Dare you try to rip me off?! Be gone, fool!", CSocket);
Link("Sorry sir.", 255, CSocket);
Face(30, CSocket); End(CSocket);
}
break;
}
Aperte Ctrl+F e procure por
- Código:
public static void Text(string value, ClientSocket CSocket)
Adicione abaixo do codigo acima
- Código:
public static int calcHairColor(int hairID)
{
return (int)(hairID / 100) * 100;
}
Pronto ,você já tem o NPC
Agora va em Handler/UseItem.cs, adicione o codigo abaixo em um dos Casos
- Código:
#region Hair Dyes
case 1060030: //black dye
{
CSocket.Client.Hair = 300 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060090: //white dye
{
CSocket.Client.Hair = 400 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060080: //red dye
{
CSocket.Client.Hair = 500 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060070://brown dye
{
CSocket.Client.Hair = 600 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060060://green dye
{
CSocket.Client.Hair = 700 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060050://blue dye
{
CSocket.Client.Hair = 800 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
case 1060040://violet dye
{
CSocket.Client.Hair = 900 + calcHairStyle(CSocket.Client.Hair);
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Hair, Struct.StatusTypes.HairStyle));
break;
}
#endregion
agora procure por
- Código:
if (Delete)
{
CSocket.Client.Inventory.Remove(Item.UID);
CSocket.Send(ConquerPacket.ItemUsage(Item.UID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(Item.UID);
}
}
Adicione logo abaixo do codigo acima
- Código:
public static int calcHairStyle(int hair)
{
return hair % 100;
}
Creditos : I'am Noob do elitepvprs.
Pronto , Codigo completinhoo!!
Boa Tarde a Todos