Author Topic: Loot question.  (Read 367 times)

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« on: September 06, 2013, 07:08:30 am »


               So, I'm supplying my npcs/creatures with items, avoiding checking the dropable check box, the items are still dropping and I guess I'm wondering if there is a mechanic here I'm not understanding?

 
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Loot question.
« Reply #1 on: September 06, 2013, 08:29:03 am »


               The items you're supplying them with are dropping or random items are dropping from the NPCs, period?
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #2 on: September 06, 2013, 04:54:01 pm »


               It was both, I set the variable in OnModuleLoad however, so it's no longer dropping random loot.  At this point I'm just trying to understand how the loot system works in this module, if I check the dropable option, will it drop every time all the time? If I don't check it, shouldn't it not drop it at all? Or does it give it a percentage chance to drop instead?
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Loot question.
« Reply #3 on: September 06, 2013, 05:18:51 pm »


               If you check the droppable option, yes, it should drop every time.  And if you don't select droppable, it should never drop.
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #4 on: September 07, 2013, 12:15:38 am »


               I wonder if a system exists or the scripts exists out there to handle how I want special boss loot to be handled..

I could probably try and write something up for this but basically what I want it to do is to (onDeath) fire the script, look through a coded list of possible loot items then randomly determine what is going to drop from that list.  Right now, it's more or less, if you place a sword on the boss as dropable, the sword is gonna drop.. period.. But what if there's a mage in the party helping? Or a cleric healing? I'd rather everyone get a fair shot at an item/upgrade.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Loot question.
« Reply #5 on: September 07, 2013, 12:36:47 am »


               There are all sorts of ways to random loot drops from a boss.  There are some on the vault.
What I do is give various % chance the boss will drop something from one or more of their equipment slots.  In this way you will actually get something the boss had, not just some random loot from a table. This method can also be used on lesser creatures, where maybe you only check armor slot, left hand, right hand.  Another thing I do for lesser creatures is:on spawn run through their equipment and have a % chance they drop something that is slotted.   Mark it as droppable.  Of course this assumes their stuff is not already so marked.
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Loot question.
« Reply #6 on: September 07, 2013, 12:40:50 am »


               Yeah, that's pretty simple to do.

The "hard" part is actually writing the list (unless it's a very limited number of items).

If you give me the blueprints for some items and the percent chance for each of them I could show you an example.
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #7 on: September 07, 2013, 12:47:05 am »


               

ffbj wrote...

There are all sorts of ways to random loot drops from a boss.  There are some on the vault.
What I do is give various % chance the boss will drop something from one or more of their equipment slots.  In this way you will actually get something the boss had, not just some random loot from a table. This method can also be used on lesser creatures, where maybe you only check armor slot, left hand, right hand.  Another thing I do for lesser creatures is:on spawn run through their equipment and have a % chance they drop something that is slotted.   Mark it as droppable.  Of course this assumes their stuff is not already so marked.


Wouldn't you have trouble getting people class related items from bosses if you did that though? If the boss is a level 40 fighter in full plate, wielding a massive sword and using melee damage based gear, how do you handle having drops happen for say a mage who may happen to be there killing the boss with the others?

I was thinking I'd put a name_boss script in the onDeath that does a random roll 1d5, get the integer result, use a case block, then put the appropriate function call to load the item that way. I had trouble with this a few nights ago though so I'm a bit leary attempting it, it wasn't the loot issue, it was trying to spawn a portal onDeath at a WP marker. But it just wouldn't spawn anything. I couldn't even get a debugging message I threw in there to work lol.
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #8 on: September 07, 2013, 12:53:46 am »


               Re: MagicalMaster,

Only have 2 items made for him at the moment and they are:

The Principal's Ruler (Tag=ThePrincipalsRuler)(Blueprint=theprincruler)
The Principal's Belt (Tag=ThePrincipalsBelt)(Blueprint=theprincbelt)

20% drop rate since each boss will have a potential to drop any (1) item out of (5) possible.
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Loot question.
« Reply #9 on: September 07, 2013, 02:31:16 am »


               You could put something like the following in your OnDeath script...


    string sTag = GetTag(OBJECT_SELF);
    int nRandom;

    if (sTag == "mynpctag")
    {
        nRandom = Random(5)+1;

        if (nRandom < 3)
        {
            CreateItemOnObject("theprincruler");
        }
        else
        {
            CreateItemOnObject("theprincbelt");
        }
    }

Suitably modified, of course - that's a 40% chance for the ruler to drop and a 60% chance for the belt to drop and you'd need to insert the NPC's tag.
               
               

               


                     Modifié par MagicalMaster, 07 septembre 2013 - 01:32 .
                     
                  


            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #10 on: September 07, 2013, 02:37:09 am »


               Hmmm, I'll try that one out, I have something similar to that already but it didn't work the way it was supposed to.  It's quite a learning curve going from CircleMUD coding back to Neverwinter Nights in some aspects. Interesting. Thanks for the nudge in the right direction. '<img'>
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Loot question.
« Reply #11 on: September 07, 2013, 03:37:44 am »


               Well, I went and tested that code before I posted it - when the creature dies, one of those two items is randomly on the remains.

So that specific code works, I promise '<img'>
               
               

               


                     Modifié par MagicalMaster, 07 septembre 2013 - 02:37 .
                     
                  


            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Loot question.
« Reply #12 on: September 08, 2013, 07:22:45 am »


               Thanks, yeah it worked like a charm.. Strangely, in order to get the change to work I had to do a module build, it just wouldn't take for some reason. Thank you for your help, it was an overjoyous moment to see the boss dropping the defined items instead of just handing over the same old thing time after time after time. '<img'>