Register for your free account! | Forgot your password?

You last visited: Today at 19:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[release] barber + dyes

Discussion on [release] barber + dyes within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 14
Received Thanks: 10
[release] barber + dyes

i didnt go to co for the text i just started typing. all hairstyles cost 500 silver it should be easy to change if you want some to cost more than others.


in npc talk:

Code:
 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;
                    }
in the same file find:
Code:
public static void Text(string value, ClientSocket CSocket)
above it add:
Code:
public static int calcHairColor(int hairID)
        {
            return (int)(hairID / 100) * 100;
        }
that should be it for the barber npc.

Dyes:
in useitem.cs:
Code:
#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
in useitem.cs find (its towards the end of the file):
Code:
if (Delete)
            {
                CSocket.Client.Inventory.Remove(Item.UID);
                CSocket.Send(ConquerPacket.ItemUsage(Item.UID, 255, Struct.ItemUsage.RemoveItem));
                Database.Database.DeleteItem(Item.UID);
            }
        }
add right after:
Code:
public static int calcHairStyle(int hair)
        {
            return hair % 100;
        }
and that should be it.
iamanoob is offline  
Thanks
6 Users
Old 06/10/2009, 04:32   #2
 
t_dubble_uu's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 180
Im getting an error

Code:
Error	1	'CoEmu_v2_GameServer.Entities.Character' does not contain a definition for 'Hair_old' and no extension method 'Hair_old' accepting a first argument of type 'CoEmu_v2_GameServer.Entities.Character' could be found (are you missing a using directive or an assembly reference?)	C:\Users\Thomas\Desktop\Server Files\5095 Server\CoEmu v2\5095 Source\CoEmu v2 GameServer\Handlers\NpcTalk.cs	4101	44	CoEmu v2 GameServer
t_dubble_uu is offline  
Old 06/10/2009, 04:45   #3
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
I'm assuming you just add
Code:
public int Hair_old = 0;
In Entities/Character.cs
Zeroxelli is offline  
Thanks
2 Users
Old 06/10/2009, 04:56   #4
 
elite*gold: 0
Join Date: Dec 2007
Posts: 14
Received Thanks: 10
yep Zeroxelli is right just add
Code:
public int Hair_old;
in entities/character.cs
anywhere in between the "public int"s is fine
iamanoob is offline  
Thanks
1 User
Old 06/10/2009, 05:54   #5
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
Haha, sorry. My Linux & C++ days make me always give vars a default value if I don't rethink it
Zeroxelli is offline  
Old 06/10/2009, 06:47   #6
 
elite*gold: 0
Join Date: Dec 2007
Posts: 14
Received Thanks: 10
meh didnt notice you put a value o.0 oh well doesnt make a diff its just a temp var
iamanoob is offline  
Old 06/10/2009, 13:58   #7
 
PurePwnage23's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 38
Received Thanks: 18
in useitem.cs find (its towards the end of the file):
Code:
if (Delete)
            {
                CSocket.Client.Inventory.Remove(Item.UID);
                CSocket.Send(ConquerPacket.ItemUsage(Item.UID, 255, Struct.ItemUsage.RemoveItem));
                Database.Database.DeleteItem(Item.UID);
            }
        }
add right after:
Code:
public static int calcHairStyle(int hair)
        {
            return hair % 100;
        }
and that should be it.[/QUOTE]

Can u post How it stays? Kuz im having 1 error ( } expected) and i dont know how to fix it xD
PurePwnage23 is offline  
Old 06/10/2009, 15:22   #8
 
Nirion's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 99
Received Thanks: 33
Thanks, even though I released the one I did a few weeks ago.
Nirion is offline  
Old 06/21/2009, 22:54   #9
 
elite*gold: 0
Join Date: Apr 2007
Posts: 46
Received Thanks: 0
NOT WORKED!!!
auraboreal is offline  
Old 06/22/2009, 07:26   #10
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
worked properly for me... thanks
felipeboladao is offline  
Old 06/27/2009, 20:37   #11
 
elite*gold: 0
Join Date: Jul 2007
Posts: 73
Received Thanks: 1
i got about 132 error with this code i try ti fix but it wont fix i don't know why
0105653642 is offline  
Old 07/14/2009, 19:12   #12
 
elite*gold: 0
Join Date: Jun 2009
Posts: 361
Received Thanks: 98
LOL DUDE! That is one garbage release. I only got 14 errors at the end, I'm pretty sure this is supposed to help. Not give tons of retarded errors
Jay1029 is offline  
Old 07/14/2009, 19:26   #13
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Jay these errors are EASILY fixable. You got Teamviewer?
CIRASH is offline  
Old 07/16/2009, 02:52   #14
 
elite*gold: 0
Join Date: Jan 2009
Posts: 68
Received Thanks: 5
I got 24 errors wtf lol....
Crystal134 is offline  
Old 07/16/2009, 07:47   #15
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
Errors do help, unless you're a noob to coding and don't want to understand a **** thing about the fundamentals of programming..
Zeroxelli is offline  
Reply


Similar Threads Similar Threads
Dyes for MS(moonlight sentinel)?
08/19/2010 - Lineage 2 - 1 Replies
Like on the title, pls what are the best dyes for MS?
Dyes for GH
08/14/2010 - Lineage 2 - 3 Replies
Hi, i just want to know what are the best dyes for ghost hunter.?
[WTB] Black Dyes/Schwarz in Presearing/Tutorial
04/06/2010 - Guild Wars Trading - 0 Replies
Hey epvp-lers, ich kaufe Schwarze Farbstoffläschen im Tutorial von Proph. Preisvorstellungen bitte per PM: -Ektos im Post-Game also im Hauptspiel -Oder €
Slices of meat to dyes?
11/27/2009 - Mabinogi - 11 Replies
Anyone have an itemdb for that? I heard the wonderful rumors of one and then some random dude on the mabinogi forums going awol about it. He left a link to the program but the link led to a private download page. Btw...I noticed when I install mods that the original mabinogi install no longer has a data folder making me wonder if some mods won't work anymore. Is it pointless to add the data folder with itemdb?



All times are GMT +2. The time now is 19:24.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.