Author Topic: droping all players gold  (Read 442 times)

Legacy_Madasahatter

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
droping all players gold
« on: January 09, 2011, 04:56:40 pm »


               I have a script in place that on player death drops gold to a corpse. problem is it only drops 50000 to the corpse and removes all from player. I need it to drop all gold that the player has,

Hear is what im using at the moment...

 /////Now drop player's gold.//////
    nGold = (GetGold(oPC));
    AssignCommand(oCorpse, TakeGoldFromCreature(nGold,oPC,TRUE));
    CreateItemOnObject ("nw_it_gold001", oCorpse, nGold);
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
droping all players gold
« Reply #1 on: January 09, 2011, 05:17:39 pm »


               /////Now drop player's gold.//////
    nGold = GetGold(oPC);
    TakeGoldFromCreature(nGold,oPC,TRUE);
    while(nGold>0)
    {
      CreateItemOnObject ("nw_it_gold001", oCorpse, nGold);
      nGold-= 50000;
    }
               
               

               


                     Modifié par Lightfoot8, 09 janvier 2011 - 05:19 .
                     
                  


            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
droping all players gold
« Reply #2 on: January 09, 2011, 07:14:55 pm »


               Is anyone still maintaining the NWN Lexicon? The gold "stack size" limitation should probably be added to the remarks section of the CreateItemOnObject() function. (Not to mention Lightfoot8's workaround.)

-420
               
               

               
            

Legacy_Madasahatter

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
droping all players gold
« Reply #3 on: January 09, 2011, 08:14:15 pm »


               Lightfoot,



That worked but filled the corpse inventory with multiple 50000 gold pieces, how can i increase the stack size so all gp is in one ? is this in the cep hack file ?
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
droping all players gold
« Reply #4 on: January 09, 2011, 08:20:44 pm »


               

420 wrote...

Is anyone still maintaining the NWN Lexicon? The gold "stack size" limitation should probably be added to the remarks section of the CreateItemOnObject() function. (Not to mention Lightfoot8's workaround.)

-420


The Lexicon has been released to the wild, if anyone wanted to update it further I believe that Lass said they could contact her and get what they needed to do so.
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
droping all players gold
« Reply #5 on: January 09, 2011, 10:05:57 pm »


               

Madasahatter wrote...

Lightfoot,

That worked but filled the corpse inventory with multiple 50000 gold pieces, how can i increase the stack size so all gp is in one ? is this in the cep hack file ?

If you go into the toolset and right-click, Edit Properties the Gold Piece item (located under Miscellaneous>Other in the Standard items menu) and look at the Stack Size field you can see that the limit is 1-50000.

In RPG terms:  A pouch (the 3d representation of the item on the ground) can't hold more than 50,000 gold pieces. So PCs must have a pouch per 50K, as it were.

-420

EDIT: I have no idea if this limit can be circumvented using haks/NWNX.
               
               

               


                     Modifié par 420, 09 janvier 2011 - 10:17 .
                     
                  


            

Legacy_ChaosInTwilight

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
droping all players gold
« Reply #6 on: January 10, 2011, 08:24:35 am »


               Suggestion:  Don't drop the gold, create an item.

Create a bag of holding(varriant) and store the amount of gold the player had as a local INT on the bag, then destroy players gold.  

And give that much gold when the bag is acquired, and destroy the bag.

#include "x2_inc_switches"



void main()

{

    int nEvent =GetUserDefinedItemEventNumber();

    object oPC;

    object oItem;



   //SendMessageToPC(GetFirstPC(),IntToString(nEvent));



 if (nEvent == X2_ITEM_EVENT_ACQUIRE)

    {

        oPC = GetModuleItemAcquiredBy();

        oItem  = GetModuleItemAcquired();

        if(!GetIsPC(oPC)) return;

        int iGPValue = GetLocalInt(oItem, "Bag4Gold"); //Sorry, a "cash for gold" joke was required.

        GiveGoldToCreature(oPC, iGPValue );

        DestroyObject(oItem);

    }

}

Profit.