Skip to content

I'm having trouble assigning gold to my monsters.

I go into the creature's inventory. Go to misc. then select "gold piece". I put the gold piece into the creature's inventory. when I try to set the amount of gold on that specific creature, i have to edit copy then set the amount. But, when i put that edited copy of the gold piece into another monster's inventory, the amount from the last set amount goes into all creature's inventory using that "gold piece" now.

Example:
1.) Edit Copy of the "gold piece" item. Select amount (100gp for instance), then put that "gold piece" into Creature_01 inventory.
2.) Any creature that is using that specific "gold piece" set to whatever the amount, ALL creatures will get the 100gp. If the copy version of the gold piece is 250gp, all creatures using that item get that amount.
3.) When you try to put that same gold piece into another creature's inventory at a different amount, that amount will go to all creatures that are using that "gold piece".

I could use some help in setting gold on creatures based on their level. I was trying to get 2gp per level of creature, where every 10th level that amount would skip up by 4gp.

Example:
Level - Gold
1-2
2-4
3-6
4-8
5-10
6-12
7-14
8-16
9-18
10-22
11-24
12-26
etc...

Comments

  • ProlericProleric Member Posts: 1,139
    edited December 2022
    In the monster OnSpawn script, you could GiveGoldToCreature() using GetHitDice() to determine the amount.
    Post edited by Proleric on
  • MelkiorMelkior Member Posts: 100
    Proleric is right. Most module makers I know just generate the gold on the creature by script, either on spawn or on death (either way works).

    One advantage of doing it on-death rather than on-spawn is that your script can check the level of the PC who killed the spawn and adjust things like gold amount appropriately. If you're making a multi-player module, then you can also adjust the amount of gold and any item drops based on the number and classes (for example) of the participating PCs.

    It's not really a solution, but it should be an acceptable work-around. What I'd probably do for your situation is to use either variables on the monster blueprint or the monster's CR to direct the script to generate the right amount of gold to be dropped.
  • Ugly_DuckUgly_Duck Member Posts: 171
    I can't find the OnSpawn function in the script generator. Also, can't find GetHitDice thing either
  • ProlericProleric Member Posts: 1,139
    Edit the OnSpawn script in a creature template. You can give it a new name, but easier to save your copy with the same name, so it effects all creatures.

    Like Melkior says, you can control the behaviour by setting variables on the creature (defaulting to "do nothing" if not set). GetLocalInt() is the function to use.

    GetHitDice() is a standard NWScript function - no #include required - see the function filter on the right panel of the script editor.

    The Lexicon has examples.

    This might be just beyond the capability of the script generator, but it's fairly easy scripting.
Sign In or Register to comment.