//gp_goldpile_use
//To override the maximum and minimum ranges, put integer variables "nGoldRangeMax" and "nGoldRangeMin" on the placeable with the new value.
string sGOLDRANGE_MAX = "nGoldRangeMax"; //Defaults to 300, 0 is not a valid entry.
string sGOLDRANGE_MIN = "nGoldRangeMin"; //Defaults to 100, if MAX is specified it will default to 1/3 of that, 0 is not a valid entry.
void main()
{
int nGoldRangeMax = GetLocalInt(OBJECT_SELF,sGOLDRANGE_MAX);
int nGoldRangeMin = GetLocalInt(OBJECT_SELF,sGOLDRANGE_MIN);
if (nGoldRangeMax == 0)
nGoldRangeMax = 150;
if (nGoldRangeMin == 50)
nGoldRangeMin = nGoldRangeMax/3;
int nGP = Random(nGoldRangeMax-nGoldRangeMin)+nGoldRangeMin;
// posibility of 50
if (d100()>50)
return;
object oPC = GetLastKiller();
GiveGoldToCreature(oPC,nGP);
}
Im working for it runs simply on killed creature, by anyone… i wish find the way
If you wish for your scripts to be readable on this forum, try posting them as code:
[code]
paste your script code here
[/code]
You can edit your post(s) to make the changes.
Additional code posting guidelines (click here to expand).
Split different scripts into separate [code] sections for extra readability.
You can use ``` instead of [code] and [/code] (also in separate lines).
If NWScript is not automatically detected by syntax highlighter, force it with ```nwscript in the first line. Use ```plain to disable the highlighting.
Write inline code like this: `short code fragment` ([code] works too).
“Hide details” function (under icon in the post editor) can collapse code sections, significantly reducing post size. Select the code, then choose that option. Result:
Red Prince you seem a nice guy so i want to partecipate to this thread.
Usually i don’t share code not because im jealous but i think here is plenty of more skilled scripter than me,homever i want to share the portion of the script we used on our former action PW.
void CreateRandomGoldOnCreature( object oCreature, int nMinGP, int nMaxGP)
{
inside the onDeath (we use this inside OnUserDefine event but it’s basically the same) put: