Page 1 of 1

Dreaded Seal Collector

PostPosted: Sat Nov 17, 2012 6:51 am
by Bones
Fully functional dreaded seal collectors.
All 5 seal collectors will accept individual or stacked seals.
Glowing, Sanguine, Lambent, Fulgent and Effulgent crafting enabled for all 3 realms.
sql replace file for replacing mobs in database with proper class to enable turning in.
DreadedSealCollector.cs to add to scripts folder will auto add crafting tables, and the seals.

Live like'ish Glowing and Sanguine stack to 10, Lambent and Fulgent stacks to 5 and Effulgent does not stack.

Enjoy, I know I did making this.
Dreaded Seal Collectors.zip
SVN 3129 compliant
(4.29 KiB) Downloaded 329 times

Re: Dreaded Seal Collector

PostPosted: Sat Nov 17, 2012 9:49 am
by Graveen
Thank you VM Bones !

Re: Dreaded Seal Collector

PostPosted: Sun Nov 18, 2012 4:22 am
by Bones
Uh oh! I have an error that needs fixed in the file. It keps adding to the Crafted
X table every time I compile.
Code: Select all
22:20:24,149 - [MAIN] - ERROR - DOL.Database.ObjectDatabase - Error while adding data object: DataObject: CraftedItem, ObjectID{5b356f46-36f7-4207-a821-cd47ed716465} MySql.Data.MySqlClient.MySqlException (0x80004005): Duplicate entry '16565' for key 'PRIMARY' at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at DOL.Database.Connection.DataConnection.ExecuteNonQuery(String sqlcommand) at DOL.Database.Handlers.MySQLObjectDatabase.AddObjectImpl(DataObject dataObject)
This is the part kicking out an error:
Code: Select all
DBCraftedXItem sealx; sealx = GameServer.Database.FindObjectByKey<DBCraftedXItem>("lambent_dreaded_seal"); if (sealx == null) { sealx = new DBCraftedXItem(); sealx.AllowAdd = true; sealx.CraftedItemId_nb = "lambent_dreaded_seal"; sealx.IngredientId_nb = "glowing_dreaded_seal"; sealx.Count = 10; GameServer.Database.AddObject(sealx); if (log.IsDebugEnabled) log.Debug("Added " + sealx.CraftedItemId_nb); }
It seems to be adding the item to the table every time the server starts. I thought the
Code: Select all
sealx = GameServer.Database.FindObjectByKey<DBCraftedXItem>("lambent_dreaded_seal"); if (sealx == null)
part was supposed to catch it and not add. Need to look into this.

Re: Dreaded Seal Collector

PostPosted: Sun Nov 18, 2012 11:14 pm
by Shursan
seal.CraftedItemID = "16565"; // Hib Crafting
You have already one entry of this value.

Search your database for CraftedItem.CraftedItemID = 16565
fix the wrong value and that's done.

Edit: Fixed in next Editor Release.

Re: Dreaded Seal Collector

PostPosted: Mon Nov 19, 2012 3:52 pm
by Bones
Gotcha, Fixed that part ... seal = GameServer.Database.FindObjectByKey<DBCraftedItem>("11836");

The real problem I didn't see is in the craftedXitem area. Every time i start the server it adds the 5 entries to craftedXitems.
Code: Select all
sealx = GameServer.Database.FindObjectByKey<DBCraftedXItem>("lambent_dreaded_seal2"); if (sealx == null) { sealx = new DBCraftedXItem(); sealx.AllowAdd = true; //sealx.CraftedXItem_ID = "lambent_dreaded_seal2"; // this part is not in CraftedXItems sealx.CraftedItemId_nb = "lambent_dreaded_seal2"; sealx.IngredientId_nb = "sanguine_dreaded_seal"; sealx.Count = 10; GameServer.Database.AddObject(sealx); if (log.IsDebugEnabled) log.Debug("Added Crafted X Item " + sealx.CraftedItemId_nb);
I added this part i copied from CraftedItem.cs to CraftedXitem.cs and it compiles fine, but won't start the server.
Code: Select all
/// <summary> /// Crafting id of item to craft /// </summary> [DataElement(AllowDbNull = false)] public string CraftedXItem_ID { get { return m_craftedXItem_ID; } set { Dirty = true; m_craftedXItem_ID = value; } }
I get this error:
Code: Select all
09:45:20,591 - [MAIN] - FATAL - DOL.GS.GameServer - GameServer initialization failed! System.Data.DuplicateNameException: A column named 'CraftedXItem_ID' already belongs to this DataTable. at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table) at System.Data.DataColumnCollection.BaseAdd(DataColumn column) at System.Data.DataColumnCollection.AddAt(Int32 index, DataColumn column) at DOL.Database.ObjectDatabase.RegisterDataObject(Type objType) at DOL.GS.GameServer.InitDB() at DOL.GS.GameServer..ctor(GameServerConfiguration config)

Re: Dreaded Seal Collector

PostPosted: Mon Nov 19, 2012 8:41 pm
by Shursan
sealx = GameServer.Database.FindObjectByKey<DBCraftedXItem>("Your CraftedXItem_ID");

i think that's your solution.

Re: Dreaded Seal Collector

PostPosted: Wed Dec 30, 2015 6:48 pm
by Marko
Sorry to necro this thread, but I cannot seem to get this NPC/script to work properly. I have the same issue where the seals keep getting re-created in the db (so after the initial run through, I just commented out that whole section of the script), and the NPC refuses to interact with the player - no replies, no nothing just "You target [Lady Nina] You examine Lady Nina. It is friendly towards you."

In /mob info It does show that she is Class: DOL.GS.Scripts.DreadedSealCollector (I used the SQL file given in the .zip) Anyone else having issues with this NPC/script? TIA for any ideas.

Re: Dreaded Seal Collector

PostPosted: Wed Dec 30, 2015 8:45 pm
by Marko
Got it figured out. I had to massage a few db tables to unify the template/itemID's across all tables in order to get it working (since some characters and loot tables already had Dreaded Seals with the old IDs. AND I didn't realize her conversation was taking place in the 'Main' window, and I had my 'Combat' window active... So that mystery was solved as well... Thanks again for the script! Quick follow up question though. What if I want the interaction text to be displayed on the 'Combat' window instead of the 'Main' window (like quest text/updates)?

NVM, I figured it out (again). I just sent the messages to CT_System & CL_SystemWindow (instead of CT_Say & CL_ChatWindow) and that seems to work.