Particle's Custom RPG

Assistance => Assistance & Feedback => Topic started by: Hollywood on February 3, 2004 07:47 pm CST

Title: EXP Modifier
Post by: Hollywood on February 3, 2004 07:47 pm CST
In the stats of the Documentation section, EXP modifier is listed for each class. Does this actually do anything?
Title:
Post by: Particle on February 3, 2004 09:46 pm CST
Yes.  Certain classes are rewarded more EXP than others.
Title:
Post by: Hollywood on February 3, 2004 10:19 pm CST
Wow. Never knew. I keep screwing myself by picking Bard... :(
Title:
Post by: -eViL- on February 4, 2004 04:53 am CST
thats odd particle.  normal tribes rpg does not use them so i do not see how you can say yes.

Code: [Select]
function DistributeExpForKilling(%damagedClient)
{
dbecho($dbechoMode2, "DistributeExpForKilling(" @ %damagedClient @ ")");

%dname = Client::getName(%damagedClient);
%dlvl = fetchData(%damagedClient, "LVL");

%count = 0;

//parse $damagedBy and create %finalDamagedBy
%nameCount = 0;
%listCount = 0;
%total = 0;
for(%i = 1; %i <= $maxDamagedBy; %i++)
{
if($damagedBy[%dname, %i] != "")
{
%listCount++;

%n = GetWord($damagedBy[%dname, %i], 0);
%d = GetWord($damagedBy[%dname, %i], 1);

%flag = 0;
for(%z = 1; %z <= %nameCount; %z++)
{
if(%finalDamagedBy[%z] == %n)
{
%flag = 1;
%dCounter[%n] += %d;
}
}
if(%flag == 0)
{
%nameCount++;
%finalDamagedBy[%nameCount] = %n;
%dCounter[%n] = %d;

%p = IsInWhichParty(%n);
if(%p != -1)
{
%id = GetWord(%p, 0);
%inv = GetWord(%p, 1);
if(%inv == -1)
{
%tmppartylist[%id] = %tmppartylist[%id] @ %n @ " ";
if(String::findSubStr(%tmpl, %id @ " ") == -1)
%tmpl = %tmpl @ %id @ " ";
}
}
}
%total += %d;
}
}

//clear $damagedBy
for(%i = 1; %i <= $maxDamagedBy; %i++)
$damagedBy[%dname, %i] = "";

//parse thru all tmppartylists and determine the number of same party members involved in exp split
for(%w = 0; (%a = GetWord(%tmpl, %w)) != -1; %w++)
{
%n = CountObjInList(%tmppartylist[%a]);
for(%ww = 0; (%aa = GetWord(%tmppartylist[%a], %ww)) != -1; %ww++)
%partyFactor[%aa] = %n;
}

//distribute exp
for(%i = 1; %i <= %nameCount; %i++)
{
if(%finalDamagedBy[%i] != "")
{
%listClientId = NEWgetClientByName(%finalDamagedBy[%i]);

%slvl = fetchData(%listClientId, "LVL");

if(RPG::isAiControlled(%damagedClient))
{
if(%slvl > 100)
%value = 0;
else
{
%f = (101 - %slvl) / 10;
if(%f < 1) %f = 1;

%a = (%dlvl - %slvl) + 8;
%b = %a * %f;
if(%b < 1) %b = 1;

%z = %b * 0.10;
%y = getRandom() * %z;
%r = %y - (%z / 2);

%c = %b + %r;

%value = %c;
}
}
else
{
%value = 0;
}

//rank point bonus
if(fetchData(%listClientId, "MyHouse") != "")
{
%ph = Cap(GetRankBonus(%listClientId), 1.00, 3.00);
%value = %value * %ph;
}

%perc = %dCounter[%finalDamagedBy[%i]] / %total;
%final = Cap(round( %value * %perc ), "inf", 1000);

//determine party exp
%pf = %partyFactor[%finalDamagedBy[%i]];
if(%pf != "" && %pf >= 2)
%pvalue = round(%final * (1.0 + (%pf * 0.1)));
else
%pvalue = 0;

storeData(%listClientId, "EXP", %final, "inc");
if(%final > 0)
Client::sendMessage(%listClientId, 0, %dname @ " has died and you gained " @ %final @ " experience!");
else if(%final < 0)
Client::sendMessage(%listClientId, 0, %dname @ " has died and you lost " @ -%final @ " experience.");
else if(%final == 0)
Client::sendMessage(%listClientId, 0, %dname @ " has died.");

if(%pvalue != 0)
{
storeData(%listClientId, "EXP", %pvalue, "inc");
Client::sendMessage(%listClientId, $MsgWhite, "You have gained " @ %pvalue @ " party experience!");
}

Game::refreshClientScore(%listClientId);
}
}
}
Title:
Post by: UnderGod on February 4, 2004 06:58 pm CST
It was used in the oldGetLevel and oldGetEXP functions. This is back in AD&D days. The code was just left in there incase server owners would want to use the old exp system.

A lot of people complained about the new one when it first came out.
Title:
Post by: Newbie on February 4, 2004 07:21 pm CST
Bards level fast too Hollywood..

Mages level the slowest, of course. >_<
Title:
Post by: Hollywood on February 4, 2004 09:58 pm CST
I was looking at the EXP modifier, whre Bards get .8 That would be pretty big over time. If it doesn't matter, then my comment doesn't either. :P