Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 01:41

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

Advertisement



[Help,Request]Change item npc

Discussion on [Help,Request]Change item npc within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
~jochemke~'s Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
[Help,Request]Change item npc

hey,

i've been trying to add a npc that can trade ur item as example lvl 15 super +4 tro armor and hten u can choose the class u want for example warrior it will give a lvl 15 sup +4 warrior armor and takes away ur old +4 item
i wanna do this for all items but i really don't know how i can make it like that

if anyone can help me
ty very much
~jochemke~ is offline  
Old 12/18/2008, 17:47   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
If you look at the ItemTypes, you will see patterns in the IDs, you can then use those patterns to change it.
Also look into the Reborn code, that can probably help you.


Edit:

Have a look at this code, just made it by looking at the armor patterns, haven't tested it since I'm unable to.
Note: It uses a different NPC System, so you can't just copy & paste, but you can get sorta how to do it.

Code:
                if (NPCID == 99999)//Armor Swaper
                {
                    byte J = Char.Job;
                    int Change = 0;
                    if (Control == 0)
                    {
                        Say("Would you like to swap your armor for another classes?");
                        Link("Trojan's.", 1);
                        Link("Warrior's.", 2);
                        Link("Taoist's.", 3);
                        Link("Archer's.", 4);
                        Face(20);
                        Finish();
                    }
                    if (Control >= 1 && Control <= 4)
                    {
                        if (Control == 1)//Make Trojan
                        {
                            if (J >= 10 && J <= 15)
                            {
                                Say("You're already that class!");
                                Link("Sorry.", 255);
                                Face(20);
                                Finish();
                            }
                            if (J >= 20 && J <= 25)
                                Change = 1000;
                            if (J >= 40 && J <= 45)
                                Change = 3000;
                            if (J >= 100 && J <= 145)
                                Change = 4000;
                        }
                        else if (Control == 2)//Make Warrior
                        {
                            if (J >= 20 && J <= 25)
                            {
                                Say("You're already that class!");
                                Link("Sorry.", 255);
                                Face(20);
                                Finish();
                            }
                            if (J >= 10 && J <= 15)
                                Change = -1000;
                            if (J >= 40 && J <= 45)
                                Change = 2000;
                            if (J >= 100 && J <= 145)
                                Change = 3000;
                        }
                        else if (Control == 3)//Make Taoist
                        {
                            if (J >= 10 && J <= 15)
                                Change = -4000;
                            if (J >= 20 && J <= 25)
                                Change = -3000;
                            if (J >= 40 && J <= 45)
                                Change = -1000;
                            if (J >= 100 && J <= 145)
                            {
                                Say("You're already that class!");
                                Link("Sorry.", 255);
                                Face(20);
                                Finish();
                            }
                        }
                        else if (Control == 4)//Make Archer
                        {
                            if (J >= 10 && J <= 15)
                                Change = -2000;
                            if (J >= 20 && J <= 25)
                                Change = -1000;
                            if (J >= 40 && J <= 45)
                            {
                                Say("You're already that class!");
                                Link("Sorry.", 255);
                                Face(20);
                                Finish();
                            }
                            if (J >= 100 && J <= 145)
                                Change = 1000;
                        }

                        string[] Armor_Sp = Char.Equips[3].Split('-');//Get the Armors full ID split up
                        string Armor_ID = Armor_Sp[0];//Armor ID
                        string Armor_Details = Armor_Sp[1] + "-" + Armor_Sp[2] + "-" + Armor_Sp[3] + "-" + Armor_Sp[4] + "-" + Armor_Sp[5];//Detials; +, -, HP, etc
                        uint F_Armor = Convert.ToUInt32(Convert.ToUInt32(Armor_ID) + Change);//Change the ID to the new ID

                        Char.RemoveItem(Char.Equips_UIDs[3]);//Delete old Armor

                        Char.AddItem(F_Armor + "-" + Armor_Details, 3, (uint)General.Rand.Next(346623472));//Add New Armor
                        //NOTE: Change the "3" to "0" if you want to add the item to your inventory instead of equiping it.

                        //Send Packets =P
                        World.UpdateSpawn(Char);
                        Char.SendEquips(true);

                        Say("There's your new armor!");
                        Link("Thanks!.", 255);
                        Face(20);
                        Finish();
                    }
                }
kinshi88 is offline  
Thanks
1 User
Old 12/18/2008, 18:46   #3
 
~jochemke~'s Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
kk changed it so it works on lotf /u just deleted some things right?
gonna test it right now
tnx for ur help already
~jochemke~ is offline  
Old 12/18/2008, 22:31   #4
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Yikes... Sending a lot of unneeded packets there :\
Code:
                        Char.RemoveItem(Char.Equips_UIDs[3]);//Delete old Armor

                        Char.AddItem(F_Armor + "-" + Armor_Details, 3, (uint)General.Rand.Next(346623472));//Add New Armor
                        //NOTE: Change the "3" to "0" if you want to add the item to your inventory instead of equiping it.

                        //Send Packets =P
                        //Char.MyClient.SendPacket(General.MyPackets.Vital(Char.UID, 26, Char.GetStat())); Don't need this, unless you updated their statflags, which for all I can see you didn't.
                        //Char.MyClient.SendPacket(General.MyPackets.Vital(Char.UID, 12, ulong.Parse(Char.Avatar.ToString() + Char.Model.ToString()))); Didn't change model either.
                        World.UpdateSpawn(Char);

                        //World.SpawnMeToOthers(Char, false); Don't need this, its the same as UpdateSpawn pretty much.
                        //World.SpawnOthersToMe(Char, false); Why do you need to get the entites around them when you change armor??
                        Char.SendEquips(true);

                        Say("There's your new armor!");
                        Link("Thanks!.", 255);
                        Face(20);
                        Finish();
tao4229 is offline  
Old 12/18/2008, 23:46   #5
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Quote:
Originally Posted by tao4229 View Post
Yikes... Sending a lot of unneeded packets there :\
Code:
                        Char.RemoveItem(Char.Equips_UIDs[3]);//Delete old Armor

                        Char.AddItem(F_Armor + "-" + Armor_Details, 3, (uint)General.Rand.Next(346623472));//Add New Armor
                        //NOTE: Change the "3" to "0" if you want to add the item to your inventory instead of equiping it.

                        //Send Packets =P
                        //Char.MyClient.SendPacket(General.MyPackets.Vital(Char.UID, 26, Char.GetStat())); Don't need this, unless you updated their statflags, which for all I can see you didn't.
                        //Char.MyClient.SendPacket(General.MyPackets.Vital(Char.UID, 12, ulong.Parse(Char.Avatar.ToString() + Char.Model.ToString()))); Didn't change model either.
                        World.UpdateSpawn(Char);

                        //World.SpawnMeToOthers(Char, false); Don't need this, its the same as UpdateSpawn pretty much.
                        //World.SpawnOthersToMe(Char, false); Why do you need to get the entites around them when you change armor??
                        Char.SendEquips(true);

                        Say("There's your new armor!");
                        Link("Thanks!.", 255);
                        Face(20);
                        Finish();
Yes I know =P
kinshi88 is offline  
Old 12/19/2008, 12:12   #6
 
~jochemke~'s Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
well i doesn't work yet
but i'm trying to get it to work
and i don't want help yet cause then i learned nothing
now i will learn it or something xD
~jochemke~ is offline  
Reply


Similar Threads Similar Threads
[Request]How to Change Item Colour or selected item when use lootalarm
05/14/2010 - 12Sky2 - 0 Replies
ex1. item is rare colour i want to change to elite colour. ex2. item is rare but i don't want it then no alarm.
Item Change
03/15/2010 - World of Warcraft - 1 Replies
Moin, habe da mal eine Frage ist es noch möglich mit dem Patch 3.3.2 einen Item Swap zu machen? Zum Beispiel den Style von den Season 7 Schulter in Season 8 zu machen? Damals ging es ganz einfach mit Glitchy nun meldet es bei mir nur noch einen Fehler bei dem Prozess. Wäre ganz Nett wenn mir da wer fixx helfen könnte und Auskunft geben könnte. lg
i want to change name of item
07/18/2009 - CO2 Private Server - 4 Replies
i want to change the name of item but when i open itemtype.dat its open with wrong language help me plz
change name from item?
03/11/2008 - Conquer Online 2 - 3 Replies
hello ^^ can any1 tell me how can i change the name from a item on the ground?also not the name in inventory/wh/shop only on the ground ^^' i will the name change from all ref and uni names to the same name ._.



All times are GMT +2. The time now is 01:41.


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