Learner Gots some Q's.

06/24/2009 11:55 duddz#1
Ok well im just started to get into this coding stuff and i have coded a Npc to give me +1 items. I have no problem with that stuff now. My questions are:
1. How do i change the stuff the mobs drop?

2. How do i determine what the Npc case is?(read somewhere but it didnt make sense)

3. I followed the Wuxing over guide but it doesnt take +1 stones, what do i do? If someone could point me in the right direction or help me through that would be nice.

4. When coding a npc i saw how to take money and cps but how do i take Items? The same kind of setup?

5. How do i get the items to do something. Like get the +1Stonepack to give me 5 stones if right clicked?
Code:
                case 723712://+1Stonepack
                    {
                        AddItem(730001, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        AddItem(730001, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        AddItem(730001, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        AddItem(730001, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        AddItem(730001, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        break;
                    }
Is that How i would do that? or is there an easier way?
6. How do i change what is being sold in the shops?

7. How do i code a Npc to take a item and give me items in return?

8. I copyed the Db tocps code editted it put it into a case and now it doesnt work. I get an error saying "Control cannot fall through from one case label ('10062:') to another". Any Help?

Any other helpful hints or tips you think i would need/want would be greatly appreciated.


duddz;)
06/24/2009 14:44 Akarama#2
To change the shops you simply open your shop.dat in BOTH YOUR CONQUER 2.0 FOLDER AND COEMU SOURCE(Game server>bin>Debug)
and edit the item ids in the shops... you have to change the item amount of the shop when youre done if you added or took away anything and both shopp.dats must be the same.
06/24/2009 15:24 Andrew.A#3
Most of these questions and be answered if you use the Search button.
E.G.


2) Use the search button
3) Make sure you completed guide correctly
4) [Only registered and activated users can see links. Click Here To Register...] (Something along those lines)
5) [Only registered and activated users can see links. Click Here To Register...]
06/24/2009 18:31 n0mansland#4
Question 2: You determine the NPC case by the following I'll put a little example

NPC ID: Any non taken number in MySQL
Npc Type: Any non taken number in MySQL (Also the Case ID)
Sub Type: What the NPC looks like (find in Conquer 2.0 Client folder/ini/npc find the NPC you want and the number then ADD a 0 after that number)

Example: WindSage [Type= 833] <--- Change that to 8330

So lets make a WindSage NPC (Ninja Master)

NPC ID = 4000 <--- Random Number (not taken)
NPC Type= 4500 <--- Random Number (not taken)
Sub Type = 8330

So it would look like that if that helps
06/24/2009 19:20 Akarama#5
The way you put the +1stone pack to add +1stones did not work for me.

So i tested something and it worked.
I used the same format as the db scroll and met scrolls

Code:
case 723712: // +1stonepack
{
    if (CSocket.Client.Inventory.Count <= 35)
    {
        for (int i = 0; i < 5; i++)
        {
            Struct.ItemInfo SubItem = new Struct.ItemInfo();
            SubItem.Bless = SubItem.Enchant = SubItem.Position =
            SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = 0;
            SubItem.Plus = 1;
            SubItem.Dura = 1;
            SubItem.ItemID = 730001;
            SubItem.UID = Nano.Rand.Next(1, 9999999);
            bool created = Database.Database.NewItem(SubItem, CSocket);
            while (!created)
            {
                SubItem.UID = Nano.Rand.Next(1, 9999999);
                created = Database.Database.NewItem(SubItem, CSocket);
            }
            CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
            CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
        }
        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the +1StonePack ans obtained 5 +1Stones!", Struct.ChatType.Top));
    }
    else
    {
        Delete = false;
        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
    }
    break;
}
06/24/2009 19:58 duddz#6
Quote:
Originally Posted by Akarama View Post
To change the shops you simply open your shop.dat in BOTH YOUR CONQUER 2.0 FOLDER AND COEMU SOURCE(Game server>bin>Debug)
and edit the item ids in the shops... you have to change the item amount of the shop when youre done if you added or took away anything and both shopp.dats must be the same.
Thank you. Didnt realize it would be that simple.
Quote:
Originally Posted by Andrew.A View Post
Most of these questions and be answered if you use the Search button.
E.G.


2) Use the search button
3) Make sure you completed guide correctly
4) [Only registered and activated users can see links. Click Here To Register...] (Something along those lines)
5) [Only registered and activated users can see links. Click Here To Register...]
I know that. I used the Cp admin guide to figure out my code for stone packs.
Quote:
Originally Posted by n0mansland View Post
Question 2: You determine the NPC case by the following I'll put a little example

NPC ID: Any non taken number in MySQL
Npc Type: Any non taken number in MySQL (Also the Case ID)
Sub Type: What the NPC looks like (find in Conquer 2.0 Client folder/ini/npc find the NPC you want and the number then ADD a 0 after that number)

Example: WindSage [Type= 833] <--- Change that to 8330

So lets make a WindSage NPC (Ninja Master)

NPC ID = 4000 <--- Random Number (not taken)
NPC Type= 4500 <--- Random Number (not taken)
Sub Type = 8330

So it would look like that if that helps
So im looking at the code, How do i code it then, like theres the case 4000 i guess but where does the 4500, and 8330 go?
Quote:
Originally Posted by Akarama View Post
The way you put the +1stone pack to add +1stones did not work for me.

So i tested something and it worked.
I used the same format as the db scroll and met scrolls

Code:
case 723712: // +1stonepack
{
    if (CSocket.Client.Inventory.Count <= 35)
    {
        for (int i = 0; i < 5; i++)
        {
            Struct.ItemInfo SubItem = new Struct.ItemInfo();
            SubItem.Bless = SubItem.Enchant = SubItem.Position =
            SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = 0;
            SubItem.Plus = 1;
            SubItem.Dura = 1;
            SubItem.ItemID = 730001;
            SubItem.UID = Nano.Rand.Next(1, 9999999);
            bool created = Database.Database.NewItem(SubItem, CSocket);
            while (!created)
            {
                SubItem.UID = Nano.Rand.Next(1, 9999999);
                created = Database.Database.NewItem(SubItem, CSocket);
            }
            CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
            CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
        }
        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the +1StonePack ans obtained 5 +1Stones!", Struct.ChatType.Top));
    }
    else
    {
        Delete = false;
        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
    }
    break;
}
What didnt work? Like when you right clicked it? Or when trying to use them?
06/24/2009 20:05 n0mansland#7
Ok

SubType = WHAT the npc LOOKS like

NPC Type = Case ID (Random Number thats not taken in MySQL

Sub Type = What the npc looks like

all the rest of the columns are easy to figure out

You add all that in MySql database

tqnpcs

and

npcs

sql database
06/24/2009 20:09 Akarama#8
when i right clicked it.
but when i use my code it works fine
06/24/2009 21:55 duddz#9
Quote:
Originally Posted by n0mansland View Post
Ok

SubType = WHAT the npc LOOKS like

NPC Type = Case ID (Random Number thats not taken in MySQL

Sub Type = What the npc looks like

all the rest of the columns are easy to figure out

You add all that in MySql database

tqnpcs

and

npcs

sql database
Oooo i See, Well i meant of Existing Npcs
Quote:
Originally Posted by Akarama View Post
when i right clicked it.
but when i use my code it works fine
Thats weird It works for me. Did you put it in ItemUse.cs?
06/24/2009 22:48 n0mansland#10
Quote:
Originally Posted by duddz View Post
Oooo i See, Well i meant of Existing Npcs


Thats weird It works for me. Did you put it in ItemUse.cs?

Well its the same thing either way... For npcs already in it look at their NPC Type and thats the Case ID then start off you code

Code:
case NPCTYPE:
06/25/2009 00:14 Akarama#11
I did put it in itemuse
06/25/2009 12:14 duddz#12
Quote:
Originally Posted by Akarama View Post
I did put it in itemuse
Hmm. Weird.
06/25/2009 17:14 Akarama#13
whatever ill just use that code, doesnt matter. lol i taught myself how to get npcs to give you items XD
06/25/2009 21:22 duddz#14
Im just gonna go with my way. Your way was confusing. But it looks like you Kinda used the CP Admin release and based it off that? i based it off a Npc that gives you free +12 items :D