Can Someone Guide Me how to edit NPC dialog for once only for CoEmu v2 Source

05/27/2009 23:41 xXVamXx#1
Hai guys I need help here.Can someone guide me on how to add or edit NPC dialog and also to add thing like examples CPAdmin Guy dialog.

Question: Which .cs i should go and wat NPC id do i have to find.
and how to send money and remove item form MYChar.

Just guide me or post here for 1 NPC dialog only.
05/28/2009 00:00 scottdavey#2
Common sense tells me to ctrl and f some of the CP guys dialog and see where it resides..

What does it tell you?
05/28/2009 00:03 Zeroxelli#3
I doubt there will be any dialog for the CP NPC in the market, he's not coded in. Go to Handlers/NpcTalk.cs and add a CASE for his ID. :)
05/28/2009 01:30 xXVamXx#4
Now I need the guide on how the deduction of money and then send the CPs packets to character in dialog. COz i try do it but when i relog the CPs gone and the money when back the same amount.
05/28/2009 01:32 AndreaCo#5
what i am doing to learn how its coded in is i am reading all the npc dialogs, then if you understand c# you will understand what each thing does.
05/28/2009 01:50 Zeroxelli#6
Quote:
Originally Posted by xXVamXx View Post
Now I need the guide on how the deduction of money and then send the CPs packets to character in dialog. COz i try do it but when i relog the CPs gone and the money when back the same amount.
That's normal, you have to manually update the database with the amount.

i.e.:
Code:
UPDATE characters SET Money=999999 WHERE Name="TestChar";
EDIT: What? There are functions for that built into the server xD
05/28/2009 02:46 tao4229#7
Quote:
Originally Posted by scottdavey View Post
Common sense tells me to ctrl and f some of the CP guys dialog and see where it resides..

What does it tell you?
System.NullReferenceException
-Parameter name: 'Common sense'
05/28/2009 02:46 scottdavey#8
Quote:
Originally Posted by Zeroxelli View Post
That's normal, you have to manually update the database with the amount.

i.e.:
Code:
UPDATE characters SET Money=999999 WHERE Name="TestChar";
EDIT: What? There are functions for that built into the server xD
Will cause too much lag, best just to call mysql querys when the player disconnects saving the clientside values.
05/28/2009 04:35 PeTe Ninja#9
scottdavey released saving CPs just a while ago.. check it out
05/28/2009 08:12 xXVamXx#10
Pete ninja Dun mind can u gave me the link that scottdavey release the CPs saving.

Damn I still got the same problem after relog CPs goes back to the same amount and only money will be stay as it if examples like

Before exchange cash with CPAdmin = money 500000 CPs 0

After exchange = money 50000 CPs 100000

Then after relog its goes back to i.e 1 but cash is 450000 CPs 0. How guys can u all just help me this once bout the saving of CPs.
05/28/2009 08:37 xXVamXx#11
Yeah Done thanks man
05/28/2009 08:41 HooliGan73#12
Quote:
Originally Posted by xXVamXx View Post
Pete ninja Dun mind can u gave me the link that scottdavey release the CPs saving.

Damn I still got the same problem after relog CPs goes back to the same amount and only money will be stay as it if examples like

Before exchange cash with CPAdmin = money 500000 CPs 0

After exchange = money 50000 CPs 100000

Then after relog its goes back to i.e 1 but cash is 450000 CPs 0. How guys can u all just help me this once bout the saving of CPs.
here is way to fix your problem Credit go to scottdavey & BrokeN^WinG
go to Database folder and then open Database.cs edit this part :
Code:
public static void SaveCharacter(Character Client)
		{
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `Level` = " + Client.Level + ", `WHMoney` = " + Client.WHMoney + ", `PkPoints` = " + Client.PkPoints + ", `xCord` = " + Client.X + ", `yCord` = " + Client.Y + ", `Map` = " + (int)Client.Map + ", `HairStyle` = " + Client.Hair + ", `Class` = " + (int)Client.Class + ", `Exp` = " + Client.Exp + ", `Money` = " + Client.Money + ", `CPoints` = " + Client.CPs + ", `Str` = " + Client.Strength + ",`Vit` = " + Client.Vitality + ", `Spi` = " + Client.Spirit + ", `Dex` = " + Client.Dexterity + ", `StatPoints` = " + Client.StatPoints + ", `FirstLog` = " + 1 + ", `Reborn` = " + Client.Reborn + ", `HP` = " + Client.CurrentHP + ", `MP` = " + Client.CurrentMP + " WHERE `CharID` = " + Client.ID, DatabaseConnection.NewConnection());
			Cmd.ExecuteNonQuery();
			Cmd.Connection.Close();
			Cmd.Connection.Dispose();
			Cmd.Dispose();
		}
and it's will save your CPS fine
btw try to search in official post before you make Thread about your problem ;)
07/23/2009 08:00 Night Angel#13
Which file you're editing? I want understand
09/04/2009 01:45 .Jack.#14
Quote:
Originally Posted by Night Angel View Post
Which file you're editing? I want understand
NPCText.cs or NPCDialog.cs;

But if they're going into databases etc.

ExternalDatabase.cs / Database.cs

I think. i havent seen in a while...
09/04/2009 04:54 samehvan#15
Code:
#region CP Admin
                case 2071: // CP ADMIN
                    {
                        if (LinkBack == 0)
                        {
                            Text("HELLO , i can help you changing your DragonBalls to CPs,so how many u wanna change", CSocket);
                            Link("DragonBall", 1, CSocket);
                            Link("DragonBall Scroll", 2, CSocket);
                            Link("Just passing by", 255, CSocket);
                            Face(6, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (HasItem(1088000,1,CSocket))
                            {
                                if (CSocket.Client.CPs + 215 > 999999999)
                                    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You can not hold more then 999,999,999 CPs", Struct.ChatType.Top));

                                else
                                {
                                    DeleteItem(1088000, 1, CSocket);
                                    CSocket.Client.CPs += 215;
                                    CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                }
                            }
                            else
                            {
                                Text("You don't have any DragonBalls.", CSocket);
                                Link("I see.", 255, CSocket);
                                Face(6, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if (HasItem(720028, 1, CSocket))
                            {
                                if (CSocket.Client.CPs + 2150 > 999999999)
                                    CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You can not hold more then 999,999,999 CPs", Struct.ChatType.Top));

                                else
                                {
                                    DeleteItem(720028, 1, CSocket);
                                    CSocket.Client.CPs += 2150;
                                    CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
                                }
                            }
                            else
                            {
                                Text("You don't have any DragonBall scrolls.", CSocket);
                                Link("I see.", 255, CSocket);
                                Face(6, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
                #endregion