NeverwinterConnections.com

   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Giving Variable Starting Gold
Pages: 1  
   Author  Topic: Giving Variable Starting Gold  (Read 36 times)
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847
Giving Variable Starting Gold
Return To Top       

An idea I'm trying to implement is varying starting gold based on PC charisma with a bonus for taking Silver Palm feat. I've fiddled around with Lilac's Scripting wizards and my own limited coding skills to no avail. Here's what I cobbled together...

==========================================
//Put this script OnUsed
// Starting gold adjustment and free stuff

#include "nw_i0_tool"

int StartGold;
int Charisma;

void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);

CreateItemOnObject("supplykit002", oPC);

CreateItemOnObject("nw_it_spdvscr501", oPC);

Charisma = (GetAbilityScore(oPC, ABILITY_CHARISMA, TRUE));

if (GetHasFeat(FEAT_SILVER_PALM, oPC))
{
Charisma = Charisma +4;
}

StartGold = ((Charisma/22) * 600);
RewardPartyGP(StartGold, oPC, FALSE);
}
==============================================

Any and all help would be appreciated

Regards

Karvon

I.P. Logged
Gulfwulf

Forum God


Last On: 02/09/12
View Profile
Message Player

United States

Posts: 4798

Return To Top       

Using the RewardParty function will give the gold to everybody in the party. I'd use the GiveGoldToCreature instead. Here's a stripped down version:

void main()
{
string sTag = GetTag(OBJECT_SELF);
object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

if (GetLocalInt(oPC, sTag) == TRUE) return;

SetLocalInt(oPC, sTag, TRUE);

CreateItemOnObject("supplykit002", oPC);

CreateItemOnObject("nw_it_spdvscr501", oPC);

int Charisma = (GetAbilityScore(oPC, ABILITY_CHARISMA, TRUE));

if (GetHasFeat(FEAT_SILVER_PALM, oPC)) Charisma = Charisma +4;

int StartGold = ((Charisma/22) * 600);

GiveGoldToCreature(oPC, StartGold);
}

I.P. Logged
Lazybones

Forum God


Last On: 12/31/11
View Profile
Message Player

United States

Posts: 4695

Return To Top       

RewardPartyGP(StartGold, oPC, FALSE)

is identical to

GiveGoldToCreature(oPC, StartGold).

I think the problem is the division that you have in the int StartGold. You end up with a decimal which won't work with either of those functions.

« Last Edit: on: Jun 1, 2010, 4:34AM » I.P. Logged
Gulfwulf

Forum God


Last On: 02/09/12
View Profile
Message Player

United States

Posts: 4798

Return To Top       

True, but that command requires the plot include. Personally, I don't like using includes unless I have to. Anyway, a better formula may be five gold per CHA point; that way a character with 14 CHA, would get 70 gold and with silver palm, it'd be 90 gold. If that's too low, you can always increase the multiplier. If you want to go that route, change this line:
int StartGold = ((Charisma/22) * 600);

to:

int StartGold = (Charisma * 5 or 10 or whatever);

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

Thanks guys.

I think I'm going to go with the simpler adj charisma * 30 for a max of 660 gp. As this is for a MP campaign without DM intervention, the extra gold can be used for additional healing supplies to insure we don't have a TPK too easily

Regards

Karvon

I.P. Logged
Pages: 1  
Moderators: Rizzen, Shinji, Gilaun, Garnak, J'Dai Voisin, Lazybones, Ochobee, Eliandi
   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Giving Variable Starting Gold

 
Copyright © 2002 Shawn Schultz. All rights reserved.
All trademarks are properties of their respective owners. Read our Terms of Use and our Privacy Policy.