Discussion on [Release] MillionaireLee (NPC) + DBScroll/MetScroll Functionality within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
EDIT: Changed two '==' to '>=' as nTL3fTy pointed out, dunno what I was thinking Oh and for the people whom it's only taking 1 DB, This happened to me once but I can't seem to replicate it. It only happened when the DBs all had the same UID, which shouldn't have been in the first place...
Screenshot:
Code A: NpcTalk.cs:
Code:
case 5004: // MillionaireLee
{
if (LinkBack == 0)
{
Text("Hello! I can free up space in your inventory by packing 10 DragonBalls or Meteors into a DragonScroll or MeteorScroll!", CSocket);
Link("Make me a DragonScroll.", 1, CSocket);
Link("Make me a MeteorScroll.", 2, CSocket);
Link("No thanks!", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
int DBCount = 0;
List<int> DBList = new List<int>();
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088000)
{
DBCount++;
DBList.Add(Item.UID);
}
if (DBCount == 10)
break;
}
if (DBCount >= 10)
{
foreach (int DBUID in DBList)
{
CSocket.Client.Inventory.Remove(DBUID);
CSocket.Send(ConquerPacket.ItemUsage(DBUID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(DBUID);
}
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 720028;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You obtained a DragonScroll!", Struct.ChatType.Top));
}
else
{
Text("Fool! How dare you try and rip me off!", CSocket);
Link("Sorry!", 255, CSocket);
End(CSocket);
break;
}
}
else if (LinkBack == 2)
{
int MetCount = 0;
List<int> MetList = new List<int>();
foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
{
if (Item.ItemID == 1088001)
{
MetCount++;
MetList.Add(Item.UID);
}
if (MetCount == 10)
break;
}
if (MetCount >= 10)
{
foreach (int DBUID in MetList)
{
CSocket.Client.Inventory.Remove(DBUID);
CSocket.Send(ConquerPacket.ItemUsage(DBUID, 255, Struct.ItemUsage.RemoveItem));
Database.Database.DeleteItem(DBUID);
}
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 720027;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You obtained a MeteorScroll!", Struct.ChatType.Top));
}
else
{
Text("Fool! How dare you try and rip me off!", CSocket);
Link("Sorry!", 255, CSocket);
End(CSocket);
break;
}
}
break;
}
Code B: UseItem.cs:
Code:
#region Misc.
case 720027: // MeteorScroll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 1088001;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
}
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the MeteorScroll and obtained 10 Meteors.", Struct.ChatType.Top));
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
}
break;
}
case 720028: // DragonScroll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;
SubItem.Dura = 1;
SubItem.ItemID = 1088000;
SubItem.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(SubItem, CSocket);
while (!created)
{
SubItem.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(SubItem, CSocket);
}
CSocket.Client.Inventory.Add(SubItem.UID, SubItem);
CSocket.Send(ConquerPacket.ItemInfo(SubItem.UID, SubItem.ItemID, SubItem.Plus, SubItem.Bless, SubItem.Enchant, SubItem.Soc1, SubItem.Soc2, SubItem.Dura, SubItem.MaxDura, SubItem.Position, SubItem.Color));
}
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You used the DragonScroll and obtained 10 DragonBalls.", Struct.ChatType.Top));
}
else
{
Delete = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Not enough space in inventory.", Struct.ChatType.Top));
}
break;
}
#endregion
okay, after testing this. it dont work so well :P. firstly it wont pack DBs. secondly. when you pack mets it checks for 10 but only takes one and makes the scroll.
okay, after testing this. it dont work so well :P. firstly it wont pack DBs. secondly. when you pack mets it checks for 10 but only takes one and makes the scroll.
Can't seem to replicate that.. You sure it's a normal DB?
Quote:
Originally Posted by Nirion
Thanks Man, I tried coding this last night...I failed On the other hand this will give me some reference for some other npcs I have in mind.
[QUOTE=Zeroxelli;2295119]
Can't seem to replicate that.. You sure it's a normal DB?QUOTE]
Well, I used the dragon ***** and mets from the shopping mall to test. so it should be a normal one right? :P. Unless. i put the wrong codes in. but im 99.9% sure i did it right.
Can't seem to replicate that.. You sure it's a normal DB
Well, I used the dragon ***** and mets from the shopping mall to test. so it should be a normal one right? :P. Unless. i put the wrong codes in. but im 99.9% sure i did it right.
Still can't see to replicate it o.0
Scrolls work just fine packing & unpacking with mets/DBs from mall, as in the screenshot.
If I have 10 DBs he takes 1 and gives me a scroll.
Then if I open the scroll and re-scroll them he will take 10 DBs.
But if I have 29 DBs he'll take 20 and give me 1 scroll.
If I had 20 DBs he'd take none and give me free scrolls.
bot stucked when executing StorageAuto functionality 01/08/2010 - Ragnarok Online - 0 Replies Hi All,
Basically i have two related problems
1) my character freezes on the storage map. However this only occurs when im autobuying something.
2) after the bot finish autobuying, autostorage is activated, it goes out of the map and get stuck/freeze.
issuing 'autostorage' makes it properly go to storage and store things. then it opens storage for the second time doing nothing. then tries to autosell even if i configured it to not autosell thereby producing error. now it freezes...
[TIP] EASY ALL WIN FOR ENGINES WITHOUT HOTKEY FUNCTIONALITY 08/25/2009 - Grand Chase - 25 Replies Guyz may technique ako para mabilis ang allwin
ndi na kailangan double click or enter para mag change ng value...
PARANG HOTKEY NA DIN
Requirements: Allwin Address.....
First..... double click mo muna ung value then change to 1.. sunod change value ulit sa 0......
[Release]MillionaireLee.sql For TQBinary 5065 07/15/2009 - CO2 PServer Guides & Releases - 5 Replies here is MillionaireLee.sql for TQBinary To Pack Mets And DBs
This Is Da Link MEGAUPLOAD - The leading online storage and file delivery service
if u liked my post plz hit thanks button
MetScroll Bugged? 06/29/2009 - CO2 Private Server - 2 Replies case 720027: // MeteorScroll
{
if (CSocket.Client.Inventory.Count <= 30)
{
for (int i = 0; i < 10; i++)
{
Struct.ItemInfo SubItem = new Struct.ItemInfo();
SubItem.Bless = SubItem.Enchant = SubItem.Position =
SubItem.Color = SubItem.Soc1 = SubItem.Soc2 = SubItem.Plus = 0;...
Omg Metscroll 04/09/2006 - Conquer Online 2 - 11 Replies right thats it im serverly pissed off i been hunting allllll day i get few +1 shit like that i get 10 mets i go to market turn mets into scroll and BAM no scroll someone gotta help me here before i kick the shit outa something lol