[RELEASE] Easter Pack Trader

03/09/2010 14:41 .Beatz#1
Hey guys this is my first release so please dont flame.
This is a simple NPC who will trade players Easter Packs for Eggs that they find during gameplay,

First in NPCDialogue.cs add this
Code:
                            #region Easter Pack Giver
                            case 104937:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Happy Easter! Here I can trade Eggs for special packs."));
                                        GC.AddSend(Packets.NPCLink("Like what?", 1));
                                        GC.AddSend(Packets.NPCLink("Just passing by", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        GC.AddSend(Packets.NPCSay("I can trade 5 Special Eggs For a Gold Easter Pack. Also 5 Purple Eggs for a Silver Easter Pack, and 3 Ruby Eggs for a Bronze Easter Pack."));
                                        GC.AddSend(Packets.NPCLink("Ok Trade my Eggs", 76));
                                        GC.AddSend(Packets.NPCLink("No", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 76)
                                    {
                                        GC.AddSend(Packets.NPCSay("What would you like to trade?"));
                                        GC.AddSend(Packets.NPCLink("Here take my Special Eggs.", 3));
                                        GC.AddSend(Packets.NPCLink("Here take my Purple Eggs.", 4));
                                        GC.AddSend(Packets.NPCLink("Here take my Ruby Eggs.", 5));
                                        GC.AddSend(Packets.NPCLink("No", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                    }
                                    if (Control == 3)
                                    {
                                        if (GC.MyChar.InventoryContains(729934, 5))
                                        {
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(729934));
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(729934));
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(729934));
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(729934));
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(729934));
                                            GC.MyChar.AddItem(720121);
                                            GC.AddSend(Packets.NPCSay("Great you have them. Take this pack."));
                                            GC.AddSend(Packets.NPCLink("Thanks Beatz!", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You do not have the required items"));
                                            GC.AddSend(Packets.NPCLink("Ok", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                        if (Control == 4)
                                        {
                                            if (GC.MyChar.InventoryContains(729936, 5))
                                            {
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(729936));
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(729936));
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(729936));
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(729936));
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(729936));
                                                GC.MyChar.AddItem(720122);
                                                GC.AddSend(Packets.NPCSay("Great you have them. Take this pack."));
                                                GC.AddSend(Packets.NPCLink("Thanks Beatz!", 255));
                                                GC.AddSend(Packets.NPCSetFace(30));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                            else
                                            {
                                                GC.AddSend(Packets.NPCSay("You do not have the required items"));
                                                GC.AddSend(Packets.NPCLink("Ok", 255));
                                                GC.AddSend(Packets.NPCSetFace(30));
                                                GC.AddSend(Packets.NPCFinish());
                                            }
                                        }
                                            if (Control == 5)
                                            {
                                                if (GC.MyChar.InventoryContains(729937, 3))
                                                {
                                                    GC.MyChar.RemoveItem(GC.MyChar.NextItem(729937));
                                                    GC.MyChar.RemoveItem(GC.MyChar.NextItem(729937));
                                                    GC.MyChar.RemoveItem(GC.MyChar.NextItem(729937));
                                                    GC.MyChar.AddItem(720123);
                                                    GC.AddSend(Packets.NPCSay("Great you have them. Take this pack."));
                                                    GC.AddSend(Packets.NPCLink("Thanks Beatz!", 255));
                                                    GC.AddSend(Packets.NPCSetFace(30));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                                else
                                                {
                                                    GC.AddSend(Packets.NPCSay("You do not have the required items"));
                                                    GC.AddSend(Packets.NPCLink("Ok", 255));
                                                    GC.AddSend(Packets.NPCSetFace(30));
                                                    GC.AddSend(Packets.NPCFinish());
                                                }
                                            }
                                break;
                            #endregion
Next in mob.cs somewhere around line 553 add this
Code:
#region Easter Eggs
               if (MyMath.ChanceSuccess(4))
                {
                    if (Char != null)
                    {
                        if (Char.Inventory.Count <= 39)
                            Char.AddItem(729934);

                        return;
                    }
                }
                if (MyMath.ChanceSuccess(4))
                {
                    if (Char != null)
                    {
                        if (Char.Inventory.Count <= 39)
                            Char.AddItem(729936);

                        return;
                    }
                }
                if (MyMath.ChanceSuccess(9))
                {
                    if (Char != null)
                    {
                        if (Char.Inventory.Count <= 39)
                            Char.AddItem(729937);

                        return;
                    }
                }
                #endregion
**EDIT**
Sorry fogot to add if you want only certain mobs to drop the items place this under if (Char != null)
if (Name == "Pheasant") Change Pheasant to whatever mob you want to drop the item

Now some people will have the easter packs working and others might not.
So if you dont know if they are working login to your server and try and make one.
/item EasterGoldPack 0
/item EasterSilverPack 0
/item EasterBronzePack 0

If you are then able to open these packs you will not need to add the next lines of code. Also please take not of the number that comes on screen when you try to open the packs if they fail to open.

So go to character.cs and around line 5836 add this
Code:
                    #region EasterGoldPack
                    case [COLOR="Blue"]720121[/COLOR]:
                        {
                            if (Inventory.Count <= 34)
                            {
                                    RemoveItem(NextItem([COLOR="blue"]720121[/COLOR]));
                                    [COLOR="red"]AddItem(730006); // +6 Stones
				                    AddItem(730006); // +6 Stones
                                    AddItem(183305); // SandRaider
                                    AddItem(723017); // EXP Potion
				                    AddItem(723017); // EXP Potion
				                    AddItem(160259, 8); // SteelBoots[/COLOR]
				                    CPs += 100000;
                            }
                            break;
                        }
                    #endregion
                    #region EasterSilverPack
                    case [COLOR="blue"]720122[/COLOR]:
                        {
                            if (Inventory.Count <= 35)
                            {
                                RemoveItem(NextItem([COLOR="blue"]720122[/COLOR]));
                                    [COLOR="red"]AddItem(730004); // +4 Stone
                                    AddItem(181955); // DarkWizard
                                    AddItem(723017); // EXP Potion[/COLOR]
				    CPs += 60000;
                            }
                            break;
                        }
                    #endregion
                    #region EasterBronzePack
                    case [COLOR="blue"]720123[/COLOR]:
                        {
                            if (Inventory.Count <= 35)
                            {
                                RemoveItem(NextItem([COLOR="blue"]720123[/COLOR]));
                                    [COLOR="Red"]AddItem(723832); // +3 Stone
                                    AddItem(191905); // GoodLuck
                                    AddItem(723017); // EXP Potion[/COLOR]
				    CPs += 30000;
                            }
                            break;
                        }
                    #endregion
Change the items in red to anything you want.
Change the numbers in Blue to match the numbers that come up on screen when yo try to open the packs.
I am not sure if i changed mine at all

and for people who are too lazy to make an NPC add this to NPC.txt in oldCODB
Quote:
104937 6270 2 59 1036 153 153
03/09/2010 15:44 ~Yuki~#2
good work
03/09/2010 16:39 Arcо#3
Good job!
Keep up the good work.
03/09/2010 18:59 .Beatz#4
Quote:
Originally Posted by ~Yuki~ View Post
good work
Quote:
Originally Posted by .Arco View Post
Good job!
Keep up the good work.
I am slowly getting there xD .Arco im still trying to figure out that damn NPC im working on lol.
Might release some more easter quests when i have finished them xD
03/09/2010 19:19 .Beatz#5
Quote:
Originally Posted by 6Sh00ter View Post
dude this is good nice good work
Thanks. I got more comin out soon :) just need to think of a few more ideas lol.
Hit th thanks button if ya use it xD
03/09/2010 21:12 killersub#6
this is some good shit! I know many newcomers will refer to this and so will they also learn from this! goodjob I must say matt!
04/01/2010 19:24 HardNotTo#7
very nice, im sure my players will like this

just so you know though in your character.cs for the EasterGoldPack you have an extra chatacter that im sure you accidentaly put in there...Just wanted to let you know before your release gets filled with error help requests

Code:
#region EasterGoldPack
                    case 720121[COLOR="Red"]][/COLOR]:
04/02/2010 01:46 .Beatz#8
Quote:
Originally Posted by HardNotTo View Post
very nice, im sure my players will like this

just so you know though in your character.cs for the EasterGoldPack you have an extra chatacter that im sure you accidentaly put in there...Just wanted to let you know before your release gets filled with error help requests

Code:
#region EasterGoldPack
                    case 720121[COLOR="Red"]][/COLOR]:
haha lol thanks i will go fix it now :)