Storm's Unique Object Generator

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Storm's Unique Object Generator

Postby Tolakram » Mon Jul 12, 2010 7:50 pm

Released to the public today.

?page=userreleases&view=628

Enjoy!
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Storm's Unique Object Generator

Postby rdsandersjr » Mon Jul 12, 2010 8:07 pm

Thank you! Are you going to include this in the SVN?
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio

Re: Storm's Unique Object Generator

Postby Tolakram » Mon Jul 12, 2010 8:08 pm

Not right now. May promote it to SVN in a few days ... needs some work to make it a core quality generator ... it's all scriptified at the moment. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Storm's Unique Object Generator

Postby rdsandersjr » Mon Jul 12, 2010 8:13 pm

Understandable =) Thanks again.
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio

Re: Storm's Unique Object Generator

Postby Urza » Sat Jul 24, 2010 3:47 am

Hi,
Code: Select all
public static bool WriteMagicalName(eProperty property, ItemUnique item)
      {

         if (hPropertyToMagicPrefix.ContainsKey(property))
         {
            string str = hPropertyToMagicPrefix[property];
                switch (ServerProperties.Properties.DB_LANGUAGE)
                {
                    case "EN":
                        item.Name = str + " " + item.Name;
                        break;
                    case "DE":
                        item.Name = item.Name + " " + str;
                        break;
                    default:
                        item.Name = str + " " + item.Name;
                        break;
                }

                return true;
         }

         return false;
      }


So it is better for other languages.

thx urza
User avatar
Urza
Developer
 
Posts: 671
Joined: Sun Jan 23, 2005 11:15 am
Website: http://www.juwesch.eu
Location: Germany/Delitzsch

Re: Storm's Unique Object Generator

Postby Leodagan » Thu Aug 22, 2013 11:42 am

Again digging up an old topic...

StormUniqueObjectGenerator.cs feels like it needs some update ?

It was said to be added to SVN and isn't there, this looks like the most up to date revision available ?

The script fails to compile with an unreferenced var "log" at line 54

I added :
Code: Select all
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
at the begining of the class (I copy/pasted it from another Class...)

and has some unreachable statement (line 2484, a previous "return false;" is used to prevent from adding Crossbow skills) the code should be commented out...

I won't provide patch as I didn't test my updates (only made it compile...) and it could be an outdated version if I missed a newer other topic ?
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Storm's Unique Object Generator

Postby Tolakram » Thu Aug 22, 2013 11:49 am

I released a copy once, and I don't remember telling anyone it would go into SVN. It's not really core quality. I don't have time to do much of anything, much less maintain this. I suggest you attach your version for others to use, no harm in that.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Storm's Unique Object Generator

Postby Leodagan » Thu Aug 22, 2013 12:42 pm

[...] May promote it to SVN in a few days ... [...]
That's what made me look all over SVN if it wasn't in a specific branch or somewhere else ;)

I'll release my updates as soons as it is tested !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Storm's Unique Object Generator

Postby Leodagan » Thu Aug 22, 2013 3:41 pm

here is my edited version of StormUniqueLoot Generator, sorry I don't have a patch file as this is not in SVN, tortoise isn't doing all the work for me and I'm too lazy to find a workaround
Attachments
StormUniqueObjectGenerator.cs
(123.95 KiB) Downloaded 37 times
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Storm's Unique Object Generator

Postby Leodagan » Fri Aug 23, 2013 4:19 pm

I don't know if this is gonna be hated or loved...

I needed to do something special with Unique Loot, and ended up doing too much workaround on Storm script !

So I converted it to a class that extends ItemUnique base dataobject, it was some work and it's absolutely DIRTY !!

But honestly I love it already, just make new GeneratedUniqueItem(); anywhere in the DOL code and you have yourself a random item based on StormScript rules !

use the Randomizer() procedures to make it as you like, most of static functions has been turned into procedures (maybe too much private, and some basic static I left, don't know why... it was convenient the time I wrote it)

I have tested it on a few batch with the empty constructor it work as expected, you can implement it in your own loot generator as you like !

You can call the Randomizer with Realm attribute, Level attribute, Object Type and Slot, Toa enabled bonus (make your own region check or throw your own random !), Call the GenerateItemQuality() with mob CON after randomization (it resets price)

It's kind of really dirty, I'll check if I need improvement in my future coding, for the moment it work is I expect it !

Nota : all Acuity skills are replaced with +acuity, so I could workaround the duplicated skill check...
Attachments
GeneratedUniqueItem.cs
(121.48 KiB) Downloaded 36 times
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Storm's Unique Object Generator

Postby Argo » Fri Aug 23, 2013 11:17 pm

Leo, i see the endless possibilities of this jewel, it would suit my server setting PERFECT but i wonder how i can implement it. At the moment i am using the storm unique lootgenerator and i wonder how to use your lootgenerator. could you give an example how to use it please?

regards
Argo
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany

Re: Storm's Unique Object Generator

Postby Leodagan » Sat Aug 24, 2013 7:03 am

create your own loot generator derived from LootGeneratorBase (take example on another lootgenerator)

and override the GenerateLoot proc to include a new instance of GeneratedUniqueItem in some way.
Code: Select all
public override LootList GenerateLoot(GameNPC mob, GameObject killer) { //get basic loot list LootList loot = base.GenerateLoot(mob, killer); //create a ROG GeneratedUniqueItem item = new GeneratedUniqueItem(); //Randomize the ROG with Realm param and Level param item.RandomizeItem(killer.Realm, Math.Max(mob.level, 51)); //Set Quality depending on mob Con item.GenerateItemQuality(GameObject.GetConLevel(killer.Level, mob.Level)); //Add it to loot loot.addFixed(item, 1); }
This one is really basic ;), you'll need some more check to see if the killer is not a mob or a pet ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Storm's Unique Object Generator

Postby Graveen » Sat Aug 24, 2013 7:43 am

Do not hesitate to extend the actual core lootgenerator, as soon as you are preserving compatibility.
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: Storm's Unique Object Generator

Postby Argo » Sat Aug 24, 2013 8:25 am

so damn cool, i love it :)
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany

Re: Storm's Unique Object Generator

Postby Leodagan » Sat Aug 24, 2013 8:40 am

Don't use this work as this... I found a bug in using Randomize proc after item creation (item randomize twice, and first row use everything random)

I'm migrating Randomize into constructors so it won't happen again

I'm not using it in a loot generator for the moment, but I'll post my basic "UniquelootGen" based on storm one (I rewrote the /genunique command handler for testing purposes)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest