Updated CLWeaponNPC to actually give weapons

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Updated CLWeaponNPC to actually give weapons

Postby Leodagan » Wed Aug 28, 2013 4:24 pm

Here is the patch for the "King" NPC file (it was in there...)

And with it the latest CL Weapon SQL I could make (including needed packageID for the NPC to work...)

The CLWeaponNPC should only give weapon the class can equip to character CL 5 or higher !

Put classtype DOL.GS.CLWeaponNPC to the NPC you'd like to give weapons !
Attachments
itemtemplate.zip
(9.33 KiB) Downloaded 29 times
GameKingThroneNpc.cs.patch
(3.28 KiB) Downloaded 27 times
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Updated CLWeaponNPC to actually give weapons

Postby HunabKu » Thu Aug 29, 2013 4:01 am

Nice works, i think Graveen will tell you to commit :)
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: Updated CLWeaponNPC to actually give weapons

Postby Graveen » Thu Aug 29, 2013 7:26 am

I like the way you integrated the dynamic proposal of the weapon, related to class AND to availability in the itemtemplate table.

But, what stopped my commit ask is the fact that PACKAGE_ID is a field used only for package management, and should not be used in selection logic (in example, we could affect more than one PACKAGE_ID to an item). Instead we should use not Id_NB (ahah funny me), but an appropriate ClassType.

Thank you Leo !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Updated CLWeaponNPC to actually give weapons

Postby Leodagan » Thu Aug 29, 2013 7:42 am

I can change the 'WHERE' condition to look for '%package_string%' this case would be able to handle items with different package_id values... (if someone wanted to use a package_id : 'Champion_Weapons;Darkness_Rising_Pkg;Public DB' it will match...)

Id_nb have no 'matching' string that I could use to select only champion_weapons (in the package I found on forum) maybe with a matching list it could work (WHERE id_nb LIKE 'Dextera%' OR LIKE 'Dochar%' [...])
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Updated CLWeaponNPC to actually give weapons

Postby Graveen » Thu Aug 29, 2013 8:12 am

Guess you were answering before i update my above post. Proper thing to do is to use ClassType. At first you can simply base the WHERE clause on this field.

I'm not fan of complexifying a WHERE clause (with fuzzy selector such as LIKE, with multiple conditions etc...), because this is something that is not rock solid.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Updated CLWeaponNPC to actually give weapons

Postby Leodagan » Thu Aug 29, 2013 8:27 am

So I need a CLWeaponItem class extending ItemTemplate (or an other GameItem class ? I didn't check this part of the code too much ;) ) without adding any properties ?

Or just set a arbitrary classtype in itemtemplate table and gameserver won't use this value as class doesn't exists ?
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Updated CLWeaponNPC to actually give weapons

Postby Graveen » Fri Aug 30, 2013 7:50 am

Have to think about it a bit, to see when the specific classtype is applyed to ItemTemplate when becoming an InventoryItem. Because when you are proposing something to choose, you have virtually only ItemTemplate.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest