|
You last visited: Today at 19:26
Advertisement
[Release]adding npc giving +12 item
Discussion on [Release]adding npc giving +12 item within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
06/12/2009, 01:34
|
#16
|
elite*gold: 0
Join Date: Jun 2009
Posts: 4
Received Thanks: 0
|
its the same ID but All edit I Maked in the source didn't worked =/
|
|
|
06/12/2009, 02:51
|
#17
|
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
|
Quote:
Originally Posted by olokorrmelo
its the same ID but All edit I Maked in the source didn't worked =/
|
*ahem* rebuild the *solution each time you edit or add something >.<
|
|
|
06/24/2009, 03:05
|
#18
|
elite*gold: 0
Join Date: Mar 2008
Posts: 83
Received Thanks: 10
|
For what reason the npc name is Conductres?
Who i can change it?
Uff i am find the answer is simple the name of the npc are alowed in tqnpc if you want the name of npc copy the subtype id on the selected npc and change
In this case 280 is Conducttres but 9110 is mine Supervisor.
|
|
|
07/04/2009, 07:06
|
#19
|
elite*gold: 0
Join Date: Jun 2009
Posts: 361
Received Thanks: 99
|
Okay, I pasted the first code correctly. But where do i paste the second code? ^^ this-> public static void AddItem(int itemid, int bless, int dura, int enchant, int plus, int position, int soc1, int soc2, int color, ClientSocket CSocket)
{
Struct.ItemInfo Item = new Struct.ItemInfo();
if (dura == 255)
{
Item.Dura = Item.MaxDura;
}
else
{
Item.Dura = dura;
}
Item.Bless = bless;
Item.Enchant = enchant;
Item.ItemID = itemid;
Item.Plus = plus;
Item.Position = position;
Item.Soc1 = soc1;
Item.Soc2 = soc2;
Item.Color = color;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}
CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
}
|
|
|
08/09/2009, 00:54
|
#20
|
elite*gold: 0
Join Date: Mar 2006
Posts: 14
Received Thanks: 3
|
My first C# coding hope it won't give you any bugs else tell me.
I made CPAdmin and Milionaire Lee, i'm sorry if they are allready posted.
CPAdmin
Code:
case 2071://CPAdmin
{
if (LinkBack == 0)
{
Text("Hello! I am the CP Admin, here you can trade your DragonBalls for CPs.", CSocket);
Text("Remember, you can exchange a DragonBall for 215 CPs, or exchange a", CSocket);
Text("DragonBall Scroll for 2150 CPs.", CSocket);
Link("Exchange a DBScroll", 1, CSocket);
Link("Exchange a DragonBall", 2, CSocket);
Link("I have nothing!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1) //DBScroll
{
bool ContainItem = false;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 720028) //DBScroll
{
CSocket.Client.Inventory.Remove(Item.UID);//Remove
CSocket.Send(ConquerPacket.ItemUsage(Item.UID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(Item.UID);
ContainItem = true;
break;
}
}
if (ContainItem)
{
CSocket.Client.CPs += 2150;//Add
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
Text("Here you go, 2150 CPs. Spend them well!", CSocket);
Link("I will, thanks!", 255, CSocket);
End(CSocket);
}
else
{
Text("Where is your DBScroll?", CSocket);
Link("Sorry, I have none.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2) //DragonBall
{
bool ContainItem = false;
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088000) //DragonBall
{
CSocket.Client.Inventory.Remove(Item.UID);//Remove
CSocket.Send(ConquerPacket.ItemUsage(Item.UID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(Item.UID);
ContainItem = true;
break;
}
}
if (ContainItem)
{
CSocket.Client.CPs += 215;//Add
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.CPs, Struct.StatusTypes.InvCPoints));
Text("Here you go, 215 CPs. Spend them well!", CSocket);
Link("I will, thanks!", 255, CSocket);
End(CSocket);
}
else
{
Text("You don't have any DragonBalls. Come Back when you get one.", CSocket);
Link("Sure, I will.", 255, CSocket);
End(CSocket);
}
}
break;
}
Put this part in the "Handlers/NpcTalk.cs" file
Milionaire Lee
Code:
case 5004://Milionaire Lee (Meteors -> MeteorScroll / DragonBalls -> DBScroll)
{
if (LinkBack == 0)
{
Text("Hunting meteors and dagonballs is an exciting thing.", CSocket);
Text("However, they also pile up in your inventories.", CSocket);
Link("Agreed. How do you deal with it?", 1, CSocket);
Link("I am poor and do not have the problem.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
Text("I can pack dragonballs and meteors for you. Give me 10 meteors or 10", CSocket);
Text("dragonballs. I will make it to a MeteorScroll or a DBScroll that occupies", CSocket);
Text("only one slot. Just right click on it, it will return 10 meteors or 10", CSocket);
Text("dragonballs again.", CSocket);
Link("Cool. Please pack my meteors.", 2, CSocket);
Link("Cool. Please pack my dragonballs.", 3, CSocket);
End(CSocket);
}
else if (LinkBack == 2)
{
int[] ContainItems = new int[10];
int Counter = 0;
foreach (Struct.ItemInfo InvItem in CSocket.Client.Inventory.Values)
{
if (InvItem.ItemID == 1088001) //Meteor
{
ContainItems[Counter] = InvItem.UID;
Counter++;
if (Counter == 10)
{
foreach (int UID in ContainItems)
{
CSocket.Client.Inventory.Remove(UID);//Remove
CSocket.Send(ConquerPacket.ItemUsage(UID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(UID);
}
Struct.ItemInfo Item = new Struct.ItemInfo();//MeteorScroll
Item.Bless = 0;
Item.Enchant = 0;
Item.ItemID = 720027;
Item.Plus = 0;
Item.Position = 0;
Item.Soc1 = 0;
Item.Soc2 = 0;
Item.Color = 0;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}
CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Your meteors have been packed successfully.", Struct.ChatType.Top));
break;
}
}
}
if (Counter < 10)
{
Text("Sorry, you don't have 10 meteors.", CSocket);
Link("OK, I know.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
int[] ContainItems = new int[10];
int Counter = 0;
foreach (Struct.ItemInfo ItemInv in CSocket.Client.Inventory.Values)
{
if (ItemInv.ItemID == 1088000) //DragonBall
{
ContainItems[Counter] = ItemInv.UID;
Counter++;
if (Counter == 10)
{
foreach (int UID in ContainItems)
{
CSocket.Client.Inventory.Remove(UID);//Remove
CSocket.Send(ConquerPacket.ItemUsage(UID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(UID);
}
Struct.ItemInfo Item = new Struct.ItemInfo();//DBScroll
Item.Bless = 0;
Item.Enchant = 0;
Item.ItemID = 720028;
Item.Plus = 0;
Item.Position = 0;
Item.Soc1 = 0;
Item.Soc2 = 0;
Item.Color = 0;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}
CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Your dragonballs have been packed successfully.", Struct.ChatType.Top));
break;
}
}
}
if (Counter < 10)
{
Text("Sorry, you don't have 10 dragonballs.", CSocket);
Link("OK, I know.", 255, CSocket);
End(CSocket);
}
}
break;
}
Put this part in the "Handlers/NpcTalk.cs" file.
Code:
case 720027://MeteorScoll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo ItemScroll = new Struct.ItemInfo();//Meteor
ItemScroll.Bless = 0;
ItemScroll.Enchant = 0;
ItemScroll.ItemID = 1088001;
ItemScroll.Plus = 0;
ItemScroll.Position = 0;
ItemScroll.Soc1 = 0;
ItemScroll.Soc2 = 0;
ItemScroll.Color = 0;
ItemScroll.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(ItemScroll, CSocket);
while (!created)
{
ItemScroll.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(ItemScroll, CSocket);
}
CSocket.Client.Inventory.Add(ItemScroll.UID, ItemScroll);
CSocket.Send(ConquerPacket.ItemInfo(ItemScroll.UID, ItemScroll.ItemID, ItemScroll.Plus, ItemScroll.Bless, ItemScroll.Enchant, ItemScroll.Soc1, ItemScroll.Soc2, ItemScroll.Dura, ItemScroll.MaxDura, ItemScroll.Position, ItemScroll.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You opened the MeteorScroll and get 10 Meteors.", Struct.ChatType.Top));
}
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Your inventory is full.", Struct.ChatType.Top));
}
break;
}
case 720028://DBScoll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo ItemScroll = new Struct.ItemInfo();//DragonBall
ItemScroll.Bless = 0;
ItemScroll.Enchant = 0;
ItemScroll.ItemID = 1088000;
ItemScroll.Plus = 0;
ItemScroll.Position = 0;
ItemScroll.Soc1 = 0;
ItemScroll.Soc2 = 0;
ItemScroll.Color = 0;
ItemScroll.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(ItemScroll, CSocket);
while (!created)
{
ItemScroll.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(ItemScroll, CSocket);
}
CSocket.Client.Inventory.Add(ItemScroll.UID, ItemScroll);
CSocket.Send(ConquerPacket.ItemInfo(ItemScroll.UID, ItemScroll.ItemID, ItemScroll.Plus, ItemScroll.Bless, ItemScroll.Enchant, ItemScroll.Soc1, ItemScroll.Soc2, ItemScroll.Dura, ItemScroll.MaxDura, ItemScroll.Position, ItemScroll.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You opened the DBScroll and get 10 DragonBalls.", Struct.ChatType.Top));
}
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Your inventory is full.", Struct.ChatType.Top));
}
break;
}
Then add this in the "Handlers/UseItem.cs" file to make the MeteorScroll/DBScroll working.
Please thank if you used it, so i know my work is not done for nothing.
de_marvin
|
|
|
 |
|
Similar Threads
|
[Help] Adding New Item
05/04/2010 - CO2 Private Server - 4 Replies
Hey, i'm trying to add a new blade.
I got a new c3>effect>blade folder called 410999 with edits in it cause i'm making my own weapon.
This is what I have as my 3dtexture.ini:
919191=c3/effect/blade/410999/1.dds
929292=c3/effect/blade/410999/2.dds
939393=c3/effect/blade/410999/3.dds
949494=c3/effect/blade/410999/4.dds
959595=c3/effect/blade/410999/5.dds
|
[Release] Pharmacist,Blacksmith,Armorer and Old General Giving out Item at Birth Vill
07/06/2009 - CO2 PServer Guides & Releases - 6 Replies
Hi Guy I would no will this will help you but here are the Release of Pharmacist,Blacksmith,Armorer and Old General give ou some basic item at Birth Village.
Credit will goes to $Hadow
Look for case 10008://Phermacist Bitch at NPCTalk.cs
Replace it with this:
case 10008://Phermacist Bitch
{
if (LinkBack == 0)
|
[HELP] adding an item
06/19/2008 - EO PServer Hosting - 2 Replies
hey all,
can somone give me a guide or video for doing hex editing to add a item i have tryed the itemtype editor that was posted but that messed up it so i need to manuly edit it :)
thanks all
hio77
|
Adding in a New Item
05/16/2008 - EO PServer Hosting - 6 Replies
I have tried to add in a new item which is a Mandarin outfit with a different texture.
I made a new id for it and have added it into the itemtype database and itemtype.dat
I have added in the dds and c3 files into the appropriate folders.
c3:
c3/mesh
dds:
|
All times are GMT +1. The time now is 19:27.
|
|