Aller au contenu

Photo

droping all players gold


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Madasahatter

Madasahatter
  • Members
  • 111 messages
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);

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
/////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 .


#3
420

420
  • Members
  • 190 messages
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

#4
Madasahatter

Madasahatter
  • Members
  • 111 messages
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 ?

#5
Baragg

Baragg
  • Members
  • 271 messages

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.

#6
420

420
  • Members
  • 190 messages

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 .


#7
ChaosInTwilight

ChaosInTwilight
  • Members
  • 89 messages
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.