Register for your free account! | Forgot your password?

You last visited: Today at 02:48

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

Advertisement



[Release] SantaClaus NPC

Discussion on [Release] SantaClaus NPC within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
[Release] SantaClaus NPC & Meteor TearPack fix

I know this is really n00bie. But here's my way of adding a Santa:
Code:
if (CurrentNPC == 1337)//SantaClaus
                        {
                            SendPacket(General.MyPackets.NPCSay("Ho ho ho! I am SantaClaus. I am giving away free +12 Christmas Hats and double-exp time until server restart. Would you like one?"));
                            SendPacket(General.MyPackets.NPCLink("Yes, please.", 1));
                            SendPacket(General.MyPackets.NPCLink("No thanks, Santa.", 255));
                            SendPacket(General.MyPackets.NPCSetFace(0));
                            SendPacket(General.MyPackets.NPCFinish());
                        }
                        if (CurrentNPC == 37822)//GiftChest
                        {
                            SendPacket(General.MyPackets.NPCSay("This is your chance to get free meteors to upgrade your items!"));
                            SendPacket(General.MyPackets.NPCLink("Yes, hand 'em over.", 1));
                            SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                            SendPacket(General.MyPackets.NPCSetFace(0));
                            SendPacket(General.MyPackets.NPCFinish());
                        }
Code:
if (CurrentNPC == 1337)
                        {
                            if (Control == 1)
                            {
                                SendPacket(General.MyPackets.NPCSay("So..you really want something, huh? I can give you either a Christmas Hat, a Gift Hat or Double-Exp."));
                                SendPacket(General.MyPackets.NPCSay(" What would you like?"));
                                SendPacket(General.MyPackets.NPCLink("Christmas Hat.", 5));
                                SendPacket(General.MyPackets.NPCLink("Gift Hat.", 6));
                                SendPacket(General.MyPackets.NPCLink("Get double-exp time.", 7));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 5)
                            {
                                MyChar.AddItem("115500-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Christmas Hat
                                SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 6)
                            {
                                MyChar.AddItem("115710-12-7-255-13-13", 0, (uint)General.Rand.Next(346623472));//Christmas Hat
                                SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 7)
                            {
                                if (!MyChar.EPotRate)
                                {
                                    MyChar.EPotXP = 3600;
                                    MyChar.EPotXP2 = MyChar.EPotXP2 * 2;
                                    MyChar.EPotRate = true;
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 19, MyChar.EPotXP));
                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                    World.UpdateSpawn(MyChar);

                                    SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                    SendPacket(General.MyPackets.NPCSetFace(0));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.NPCSay("Come back when you don't have double exp."));
                                    SendPacket(General.MyPackets.NPCSetFace(0));
                                    SendPacket(General.MyPackets.NPCFinish());
                                }
                            }
                        }
                        if (CurrentNPC == 37822)
                        {
                            if (Control == 1)
                            {
                                SendPacket(General.MyPackets.NPCSay("Choose something and you will get."));
                                SendPacket(General.MyPackets.NPCSay(" What would you like?"));
                                SendPacket(General.MyPackets.NPCLink("MeteorScroll.", 5));
                                SendPacket(General.MyPackets.NPCLink("CelestialStone.", 6));
                                SendPacket(General.MyPackets.NPCLink("Christmas Pack.", 7));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 5)
                            {
                                MyChar.AddItem("720027-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//MeteorScroll
                                SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 6)
                            {
                                MyChar.AddItem("721259-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//CelestialStone
                                SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (Control == 7)
                            {
                                MyChar.AddItem("722869-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));//Christmas Pack.
                                SendPacket(General.MyPackets.NPCSay("Merry Christmas, and have a happy newyear!"));
                                SendPacket(General.MyPackets.NPCSetFace(0));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
                        }

How to make the Christmas Packs work:


Search for "public void UseItem(ulong ItemUID, string Item)" in Character.cs & Add this above "else if (ItemParts[0] == "720028")":
Code:
            else if (ItemParts[0] == "723711")//MeteorTear Pack
            {
                if (ItemsInInventory <= 35)
                {
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722869")//Christmas Pack
            {
                if (ItemsInInventory <= 37)
                {
                    AddItem("720372-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("720372-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("720372-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "720372")//Christmas Bag
            {
                if (ItemsInInventory <= 37)
                {
                    AddItem("722868-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("720372-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("720372-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722868")//Happiness Bell
            {
                if (Level < 130 && EPotRate == false)
                AddExp((ulong)20060000, false);
                RemoveItem(ItemUID);
            }
Add the NPCs to your Database & your done.

Edit#
The SantaClaus Type is: 2090
The GiftChest Type is: 2580
justprownage is offline  
Thanks
4 Users
Old 12/24/2008, 18:33   #2
 
onlyme64's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
I will try that, thanks.
onlyme64 is offline  
Old 12/24/2008, 19:35   #3
 
~Demented~'s Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 183
Received Thanks: 70
Well it will work but thier is one thing ummmmmmmm
yea thats it in the PHPMyAdmin you will the Type <.< becouse if you type 1 in type it will be shopkeeper not santa <.< maybe u can put u rPHPMyAdmin line here?
~Demented~ is offline  
Old 12/24/2008, 19:46   #4
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Quote:
Originally Posted by ~Demented~ View Post
Well it will work but thier is one thing ummmmmmmm
yea thats it in the PHPMyAdmin you will the Type <.< becouse if you type 1 in type it will be shopkeeper not santa <.< maybe u can put u rPHPMyAdmin line here?
Sorry forgot to mention that.
justprownage is offline  
Old 12/24/2008, 19:47   #5
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Code:
            else if (ItemParts[0] == "723711")//MeteorTear Pack
            {
                if (ItemsInInventory <= [B][COLOR="Red"]35[/COLOR][/B])
                {
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722869")//Christmas Pack
            {
                if (ItemsInInventory <= [B][COLOR="Red"]39[/COLOR][/B])
                {
                    AddItem("722868-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722868")//Happiness Bell
            {
                [B][COLOR="Red"]if (Level < 130 && EPotRate == false)
                    AddExp((ulong)20060000, false);
                RemoveItem(ItemUID);[/COLOR][/B]
            }
Fixed the common sense errors -- why check if the person has less than or equal to 30 items in his/her inventory when only 5 items are being added?
nTL3fTy is offline  
Old 12/24/2008, 19:49   #6
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Quote:
Originally Posted by nTL3fTy View Post
Code:
            else if (ItemParts[0] == "723711")//MeteorTear Pack
            {
                if (ItemsInInventory <= [B][COLOR="Red"]35[/COLOR][/B])
                {
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    AddItem("1088002-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722869")//Christmas Pack
            {
                if (ItemsInInventory <= [B][COLOR="Red"]39[/COLOR][/B])
                {
                    AddItem("722868-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                    RemoveItem(ItemUID);
                }
            }
            else if (ItemParts[0] == "722868")//Happiness Bell
            {
                [B][COLOR="Red"]if (Level < 130 && EPotRate == false)
                    AddExp((ulong)20060000, false);
                RemoveItem(ItemUID);[/COLOR][/B]
            }
Fixed the common sense errors -- why check if the person has less than or equal to 30 items in his/her inventory when only 5 items are being added?
Okay, I'll fix it. Thanks. I didn't check the code carefully.
justprownage is offline  
Old 12/24/2008, 19:50   #7
 
~Demented~'s Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 183
Received Thanks: 70
well i get like 15 errors so i quit it

i rated it 5 Stars incase it works for others
~Demented~ is offline  
Old 12/24/2008, 20:55   #8
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
Talking

Quote:
Originally Posted by ~Demented~ View Post
well i get like 15 errors so i quit it

i rated it 5 Stars incase it works for others
Lol.
justprownage is offline  
Old 12/24/2008, 21:03   #9
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Quote:
Originally Posted by ~Demented~ View Post
well i get like 15 errors so i quit it

i rated it 5 Stars incase it works for others
this means...to have an server and dont even know how to copy and paste
alexbigfoot is offline  
Old 12/24/2008, 22:50   #10
 
elite*gold: 0
Join Date: Dec 2008
Posts: 19
Received Thanks: 1
this is good.
crappyreleases2 is offline  
Thanks
1 User
Old 12/25/2008, 02:01   #11
 
flamesco's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 21
Received Thanks: 0
i can help people put this in im very good at that kindof

also instead of santa giving this to you i can make it drop =]
flamesco is offline  
Old 12/25/2008, 02:39   #12
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
Flames, try to avoid double posting in the future.
tanelipe is offline  
Reply


Similar Threads Similar Threads
[RELEASE]SantaClaus giving out Xmass Hats for males/females.
01/23/2011 - EO PServer Guides & Releases - 9 Replies
Hey everyone i've made this Santa Claus NPC to give out Xmass hats for females and males as it's my first release here i guess it's pretty good(just my opinion) well i've seen some releases to do with this before but it as sort of hard to understand so here it is. ALL YOU HAVE TO DO IS COPY IT AND PASTE IT INTO CQ_ACTION..CQ_NPC AND CQ_TASK. cq_action 4050 4051 0 101 0 Ho!~Ho!~Ho!~Hello~there~%user_n ame!~Christmas~has~come~again~so~i~guess~it's~time ~to~lolok~like~me....



All times are GMT +1. The time now is 02:49.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.