Author Topic: Best Auto split loot system?  (Read 334 times)

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Best Auto split loot system?
« on: December 22, 2011, 03:46:08 am »


               What the best Auto Split gold / Item notification system and how can we make it better?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Best Auto split loot system?
« Reply #1 on: December 23, 2011, 07:26:30 pm »


               

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 .
                     
                  


            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Best Auto split loot system?
« Reply #2 on: December 24, 2011, 05:59:09 pm »


               The PC notified what other party member received and see the part about auto split gold you know this party split treasure system. There are a few on the vault. Sorry if I was not more specific.