ShadowM wrote...
What the best Auto Split gold / Item notification system and how can we make it better?
Your request is extremely vague. What do you want to notify the server (or PC) concerning? What are you looking for when you want to make something better?
I made a bare bones skeleton (not functional as is) to sort through many of the CC desires in treasure generation.
//This system would assume treasure selection being stored in
//a database, where strings instead of objects are being stored
const int TREASURE_PROBABILITY = 75;
const int MAX_ITEMS = 10;
const int GOLD_PERCENT = 21;
//This will not compile as it uses functions I have not declared
//The functions GenerateTreasure(), ReportTreausure(), and GetRandomTreasure()
//are best defined by user's desires.
void GenerateAndReportTreasure(object oKiller, object oCreature)
{
int nProb = TREASURE_PROBABILITY;
int nCount = MAX_ITEMS;
//I would use gold percent as part of the generate treasure
//using GetGoldPieceValue of each item created to determine gold
int nGold = GOLD_PERCENT;
string sItem = GetLocalString(oCreature, "specltresr");
if(sItem != "") {GenerateTreasure("sItem", nGold); ReportTreasure("sItem", oKiller, oCreature);}
if(GetLocalInt(oCreature, "NoRandomTreasure")) nCount = 0;
int nRacial = GetRacialType(oCreature);
int nCR = GetChallengeRating(oCreature);
while((Random(100) < nProb) && nCount)
{
sItem = GetRandomTreasure(nRacial, nCR);
GenerateTreasure("sItem", nGold); ReportTreasure("sItem", oKiller, oCreature);
nProb = (nProb * nProb)/100;
nCount--;
}
}
Modifié par WhiZard, 23 décembre 2011 - 07:27 .