Power Source Packing NPC

04/12/2010 18:40 folip5#1
K now i will release my own coded NPC it's my first code so yea...
This NPC can pack 10 meteors into met scroll also can pack 20 meteors in 2 met scrolls at once and the same is for DB scrolls this will work only in 5017 sources.
Change the NPC talk in the npctalk and it should look like this


PHP Code:
if (CurrentNPC == 9812)
                        {
                            
SendPacket(General.MyPackets.NPCSay("Hunting meteors and dragonballs is an exciting thing. However, they also pile up in your inventories."));
                            
SendPacket(General.MyPackets.NPCLink("I want to pack my meteors"1));
                            
SendPacket(General.MyPackets.NPCLink("I wanna pack DragonBalls"2));
                            
SendPacket(General.MyPackets.NPCLink("I am poor and do not have the problem."255));
                            
SendPacket(General.MyPackets.NPCSetFace(30));
                            
SendPacket(General.MyPackets.NPCFinish()); 



now go to npcdo and add this code this is the important one



PHP Code:
 if (CurrentNPC == 9812)
                        {
                            if (
Control == 1)
                            {
                                
SendPacket(General.MyPackets.NPCSay("Im a NPC which allow you to pack DragonBalls/Meteors 20 DragonBalls/Meteors into 2 Db/Met Scrolls either 10 met/Dbs into DBScroll/Metscroll"));
                            
                                
SendPacket(General.MyPackets.NPCLink("Cool pack my meteors."3));
                                
SendPacket(General.MyPackets.NPCLink("I wanna pack 10 meteors into 1 meteor scroll"5));
                              
                           
                         
                                
SendPacket(General.MyPackets.NPCLink("I wanna pack 20 meteors into 2 Met Scrolls"7));
                               
                                
SendPacket(General.MyPackets.NPCSetFace(30));
                                
SendPacket(General.MyPackets.NPCFinish());
                            }
                            if (
Control == 7)
                            {
                                if (
MyChar.InventoryContains(108800120))
                                {
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.AddItem("720027-0-0-0-0-0"0, (uint)General.Rand.Next(36457836));
                                    
MyChar.AddItem("720027-0-0-0-0-0"0, (uint)General.Rand.Next(36457836));
                                }
                                if (
Control == 5)
                                {
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));
                                    
MyChar.RemoveItem(MyChar.ItemNext(1088001));

 
                                }
                            }
                        
                            if (
CurrentNPC == 9812)
                            {
                                if (
Control == 2)
                                    
SendPacket(General.MyPackets.NPCSay("Grrr"));
                                
SendPacket(General.MyPackets.NPCLink("I wanna pack 20 DragonBalls into 2 Db scrolls"));
                                
SendPacket(General.MyPackets.NPCSetFace(30));
                                
SendPacket(General.MyPackets.NPCFinish());
                            }
                            {
                                if (
Control == 11)
                                {
                                    if (
MyChar.InventoryContains(108800020))
                                    {
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));

                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));    
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        
MyChar.AddItem("720028-0-0-0-0-0"0, (uint)General.Rand.Next(36457836));
                                        
MyChar.AddItem("720028-0-0-0-0-0"0, (uint)General.Rand.Next(36457836)); 
And i gotta say that there is a part missing at if (Control == 5)
Just wanted you to discover it by yourself it's very easy and i think and a beginner would find it out.Just look at the previosly code won't say at which one cuse it would be too easy, and if you wanna post this anywere else just give me a credits and you're allowed to.
04/12/2010 18:57 [X]-Cape#2
umm add db scroll to inventory after removing the dbs :D thats missing . It should be like : MyChar.AddItem("(DBscrollCode)-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
04/12/2010 19:08 folip5#3
Quote:
Originally Posted by [X]-Cape View Post
umm add db scroll to inventory after removing the dbs :D thats missing . It should be like : MyChar.AddItem("(DBscrollCode)-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
LOl don't post it like that other should keep trying so i would please you to edit your post and are you xCape from aco?
04/12/2010 21:45 Huseby#4
#Moved
04/15/2010 23:35 AndreaCo#5
you should use sumthing like this

for( int x = 0; x < 20; x++)
MyChar.RemoveItem(MyChar.ItemNext(1088000));

that will make your code a lot less big + it looks better ^^

nice job tho
04/17/2010 10:53 folip5#6
Quote:
Originally Posted by AndreaCo View Post
you should use sumthing like this

for( int x = 0; x < 20; x++)
MyChar.RemoveItem(MyChar.ItemNext(1088000));

that will make your code a lot less big + it looks better ^^

nice job tho
ya thanks i completely forgot about the for loop x.x
04/18/2010 03:53 pro4never#7
Quote:
Originally Posted by AndreaCo View Post
you should use sumthing like this

for( int x = 0; x < 20; x++)
MyChar.RemoveItem(MyChar.ItemNext(1088000));

that will make your code a lot less big + it looks better ^^

nice job tho
Aww I was just gonna mention using a for or while loop.


Also... why not use a met/db storage npc so you can store/remove as many as you like? Saves alot of time for players and is a very useful npc to code.

Regardless: Good job. Nice to see ppl trying to release stuff for ppl.
04/18/2010 13:25 folip5#8
Quote:
Originally Posted by pro4never View Post
Aww I was just gonna mention using a for or while loop.


Also... why not use a met/db storage npc so you can store/remove as many as you like? Saves alot of time for players and is a very useful npc to code.

Regardless: Good job. Nice to see ppl trying to release stuff for ppl.
well was in a hurry and didn't reallised that.xD
04/18/2010 16:36 zTREME#9
Quote:
Originally Posted by AndreaCo View Post
you should use sumthing like this

for( int x = 0; x < 20; x++)
MyChar.RemoveItem(MyChar.ItemNext(1088000));

that will make your code a lot less big + it looks better ^^

nice job tho
big code dosn't mean is bad.
But true, he could do like that :)
03/27/2011 14:49 rampe93#10
my problem is i dont know where to put thouse Npc codes should i put them in my navicat SQL or where? please help me out?
thnx
03/28/2011 12:10 Syst3m_W1z4rd#11
Quote:
Originally Posted by rampe93 View Post
my problem is i dont know where to put thouse Npc codes should i put them in my navicat SQL or where? please help me out?
thnx
Put them in your microwave.