do_score_snip.c
snippets · 12.4 KB · 2010-03-30
do_score replacement for LoW4 (any GodWars derivative with little tweaking).
Download « Back to the snippets list
/* This is just a simple replacement for the stock score function for low4. It should
* work for any Godwars derivative with little to no tweaking, but it has only been
* tested on LoW4. Nothing needs to be done to this to make it work in a stock low4,
* but you may want to colorize divide_to_char in act_info.c. The divide_to_char that
* is on the mud this was designed for is a little different than the one in the stock
* release of LoW4. Here is what the divide_to_char function looks like in my mud, in
* case you removed it or your code doesn't have it for some reason.
*
* void divide_to_char(CHAR_DATA *ch)
* {
* stc("{m-------------------------------------------------------------------------------{x\r\n",ch);
* }
*
* You may use this in any way you like as long as you abide by the other licenses
* on LoW4. I don't require an email or any credits in a helpfile or any of those
* other insane terms on snippets. Just don't claim this as your own work.
*
* I would like to take this opportunity to request that you release any and all
* snippets you can to help the Godwars community grow. A good place to release
* snippets for any and all codebases is www.mudbytes.net. They have the biggest
* code repository available at the moment and it is still growing. A good place
* to find any Godwars related code and snippets is www.godwars.net.
*
* If you need help installing this (you really shouldn't have problems with this one)
* visit the forums at www.mudbytes.net and ask for some help. That is where I go
* for most of my coding related questions. There are also forums available at
* www.godwars.net which I visit often as well.
*
* -Igabod-
*/
/*
* New score function by -Igabod-
*/
void do_score(CHAR_DATA *ch,char *argument)
{
char buf[MAX_STRING_LENGTH];
char golc[MAX_STRING_LENGTH];
int a_c = char_ac(ch);
if (!IS_NPC(ch) && (IS_EXTRA(ch,EXTRA_OSWITCH) || IS_HEAD(ch,LOST_HEAD) || IS_EXTRA(ch,EXTRA_PLASMA) || IS_EXTRA(ch,EXTRA_ASH)))
{
obj_score(ch,ch->pcdata->chobj);
return;
}
divide_to_char(ch);
sprintf(buf,"{RCharacter Data for {Y%s{x",ch->name);
cent_to_char(buf,ch);
divide_to_char(ch);
stc("\r\n",ch);
sprintf(buf,"{cTitle:{D%s {cPlay Time: {R%d {whours{x\r\n",IS_NPC(ch) ? "" : ch->pcdata->title,(get_age(ch) - 17) * 2);
stc(buf,ch);
stc("{cPosition: {w",ch);
if (ch->position == POS_DEAD) stc("{wDEAD!{x ",ch);
else if (ch->position == POS_MORTAL) stc("{wMortally Wounded{x ",ch);
else if (ch->position == POS_INCAP) stc("{wIncapacitated{x ",ch);
else if (ch->position == POS_STUNNED) stc("{wStunned{x ",ch);
else if (ch->position == POS_SLEEPING) stc("{wSleeping{x ",ch);
else if (ch->position == POS_RESTING) stc("{wResting{x ",ch);
else if (ch->position == POS_MEDITATING) stc("{wMeditating{x ",ch);
else if (ch->position == POS_SITTING) stc("{wSitting{x ",ch);
else if (ch->position == POS_STANDING) stc("{wStanding{x ",ch);
else if (ch->position == POS_FIGHTING) stc("{wFighting{x ",ch);
sprintf(buf," {cWimpy: {R%d {whp{x\r\n",ch->wimpy);
stc(buf,ch);
sprintf( buf,"{cAutoexit: %s. {cAutoloot: %s. {cAutosac: %s.{x\r\n",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT)) ? "{GYES{x" : "{RNO{x",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOLOOT)) ? "{GYES{x" : "{RNO{x",
(!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOSAC) ) ? "{GYES{x" : "{RNO{x");
stc(buf,ch);
sprintf(buf,"{cPrimal: {R%d{x ",ch->practice);
stc(buf,ch);
sprintf(buf,"{cQuest Points: {Y%d{x ",ch->pcdata->quest);
stc(buf,ch);
sprintf(buf,"{cExperience: {Y%d{x\r\n",ch->exp);
stc(buf,ch);
sprintf(buf,"{cAlignment: {R%d{x ",ch->alignment);
stc(buf,ch);
stc("{wYou are ",ch);
if (ch->alignment > 900) stc("{wangelic.{x\r\n",ch);
else if (ch->alignment > 700) stc("{wsaintly{x\r\n",ch);
else if (ch->alignment > 350) stc("{wgood{x\r\n",ch);
else if (ch->alignment > 100) stc("{wkind{x\r\n",ch);
else if (ch->alignment > -100) stc("{wneutral{x\r\n",ch);
else if (ch->alignment > -350) stc("{wmean{x\r\n",ch);
else if (ch->alignment > -700) stc("{wevil{x\r\n",ch);
else if (ch->alignment > -900) stc("{wdemonic{x\r\n",ch);
else stc("{wsatanic{x\r\n",ch);
sprintf(buf,"{cArmor Class: {R%d{x ",a_c);
stc(buf,ch);
stc("{wYou are ",ch);
if (a_c >= 101) stc("{wnaked!{x\r\n",ch);
else if (a_c >= 80) stc("{wbarely clothed.{x\r\n",ch);
else if (a_c >= 60) stc("{wwearing clothes.{x\r\n",ch);
else if (a_c >= 40) stc("{wslightly armored.{x\r\n",ch);
else if (a_c >= 20) stc("{wsomewhat armored.{x\r\n",ch);
else if (a_c >= -50) stc("{warmored.{x\r\n",ch);
else if (a_c >= -150) stc("{wwell armored.{x\r\n",ch);
else if (a_c >= -300) stc("{wstrongly armored.{x\r\n",ch);
else if (a_c >= -500) stc("{wheavily armored.{x\r\n",ch);
else if (a_c >= -750) stc("{wsuperbly armored.{x\r\n",ch);
else if (a_c >= -1000) stc("{wdivinely armored.{x\r\n",ch);
else stc("{wultimately armored!{x\r\n",ch);
sprintf(buf,"{cHitroll: {R%d{x {cDamroll: {R%d{x {cDamcap: {R%d{x\r\n",char_hitroll(ch),char_damroll(ch),ch->damcap[0]);
stc(buf,ch);
sprintf(buf,"{cStr: {R%d{x {cInt: {R%d{x {cWis: {R%d{x {cDex: {R%d{x {cCon: {R%d{x\r\n",
get_curr_str(ch),get_curr_int(ch),get_curr_wis(ch),get_curr_dex(ch),get_curr_con(ch));
stc(buf,ch);
sprintf(buf,"{cHp: {W%d{C/{w%d {cMana: {W%d{C/{w%d {cMove: {W%d{C/{w%d{x\r\n",
ch->hit,ch->max_hit,ch->mana,ch->max_mana,ch->move,ch->max_move);
stc(buf,ch);
divide_to_char(ch);
cent_to_char("{RKills and Status{x\r\n",ch);
sprintf(buf,"{cStatus: {R%d {wYou are ",ch->race);
stc(buf,ch);
if (!IS_NPC(ch) && ch->level == 1) stc("{wa Mortal.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 2) stc("{wa Mortal.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 7) stc("{wa Builder.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 8) stc("{wa Quest Maker.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 9) stc("{wan Enforcer.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 10) stc("{wa Judge.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 11) stc("{wa High Judge.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->level == 12) stc("{wan Implementor.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 0) stc("{wan Avatar.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 10) stc("{wan Immortal.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 20) stc("{wa Godling.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 30) stc("{wa Demigod.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 40) stc("{wa Lesser God.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race <= 50) stc("{wa Greater God.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race >= 60) stc("{wa Supreme God.{x\r\n",ch);
else if (!IS_NPC(ch) && ch->race >= 60) stc("{wa Ultimate God.{x\r\n",ch);
else if (!IS_NPC(ch)) stc( "{Ya Bugged Character!{x\r\n",ch);
sprintf(buf,"{cMkills: {R%d{x {cMdeaths: {R%d {cPkills: {R%d {cPdeaths: {R%d{x\r\n",
ch->mkill,ch->mdeath,ch->pkill,ch->pdeath);
stc(buf,ch);
if (ch->fight_timer > 0)
{
sprintf(buf,"{c#FFIGHT TIMER: {Y#F%d {w#Fticks remaining.{x#n\r\n",ch->fight_timer);
stc(buf,ch);
}
divide_to_char(ch);
if (ch->class > 0)
{
cent_to_char("{RClass Related{x\r\n",ch);
sprintf(buf,"{cGeneration: {R%d{x\r\n",ch->pcdata->stats[UNI_GEN]);
stc(buf,ch);
if (!IS_NPC(ch) && (IS_CLASS(ch,CLASS_DEMON) || IS_SET(ch->special,SPC_CHAMPION)))
{
sprintf(buf,"{cDemon points: {R%d {wout of {r%d {wdemon points stored.\r\n",
ch->pcdata->stats[DEMON_CURRENT],ch->pcdata->stats[DEMON_TOTAL]);
stc(buf,ch);
if (ch->pcdata->stats[DEMON_POWER] > 0)
{
sprintf(buf,"{cDemon Armor Bonus: {R+%d {wHitroll and Damroll{x\r\n",
((ch->pcdata->stats[DEMON_POWER]) * ch->pcdata->stats[DEMON_POWER]));
stc(buf,ch);
}
}
if (!IS_NPC(ch) && IS_CLASS(ch,CLASS_DROW))
{
sprintf(buf,"{cDrow Points: {M%d {cMagic Resistance: {m%d{x\r\n",
ch->pcdata->stats[DROW_POWER],ch->pcdata->stats[DROW_MAGIC]);
stc(buf,ch);
}
if (!IS_NPC(ch) && IS_CLASS(ch,CLASS_MONK))
{
sprintf(buf,"{cBlock Counter: {R%d{x\r\n",ch->monkblock);
stc(buf,ch);
sprintf(buf,"{cChi: {Y%d{R/{y%d{x",ch->chi[CURRENT],ch->chi[MAXIMUM]);
stc(buf,ch);
sprintf(buf,"{cFocus Points: {R%d{R/{B%d{x",ch->focus[CURRENT],ch->focus[MAXIMUM]);
stc(buf,ch);
}
if (!IS_NPC(ch) && IS_CLASS(ch,CLASS_VAMPIRE))
{
sprintf(buf,"{cBlood Pool: {R%d{x",ch->pcdata->condition[COND_THIRST]);
stc(buf,ch);
if (ch->beast < 0 ) sprintf(golc,"{R#FYou are a cheat!{x#n\r\n");
else if (ch->beast == 0 ) sprintf(golc,"{wYou have attained Golconda!{x\r\n");
else if (ch->beast <= 5 ) sprintf(golc,"{wYou have almost reached Golconda!{x\r\n");
else if (ch->beast <= 10) sprintf(golc,"{wYou are nearing Golconda!{x\r\n");
else if (ch->beast <= 15) sprintf(golc,"{wYou have great control over your beast.{x\r\n");
else if (ch->beast <= 20) sprintf(golc,"{wYour beast has little influence over your actions.{x\r\n");
else if (ch->beast <= 30) sprintf(golc,"{wYou are in control of your beast.{x\r\n");
else if (ch->beast <= 40) sprintf(golc,"{wYou are able to hold back the beast.{x\r\n");
else if (ch->beast <= 60) sprintf(golc,"{wYou are constantly struggling for control of your beast.{x\r\n");
else if (ch->beast <= 75) sprintf(golc,"{wYour beast has great control over your actions.{x\r\n");
else if (ch->beast <= 90) sprintf(golc,"{wThe power of the beast overwhelms you.{x\r\n");
else if (ch->beast <= 99) sprintf(golc,"{wYou have almost lost your battle with the beast!{x\r\n");
else sprintf(golc,"{wThe beast has taken over!{x\r\n");
sprintf(buf,"{cBeast: {R%d{x %s",ch->beast,golc);
stc(buf,ch);
sprintf(buf,"{cBeast Bonus: {R+%d {wHitroll {R+%d {wDamroll{x\r\n",ch->pcdata->stats[UNI_RAGE],ch->pcdata->stats[UNI_RAGE]);
stc(buf,ch);
}
if (IS_CLASS(ch,CLASS_WEREWOLF))
{
sprintf(buf,"{cGnosis: {W%d{R/{w%d{x ",ch->gnosis[GCURRENT],ch->gnosis[GMAXIMUM]);
stc(buf,ch);
sprintf(buf,"{cSilver Tolerance: {R%d{x\r\n",ch->pcdata->powers[WPOWER_SILVER]);
stc(buf,ch);
sprintf(buf,"{cRage Bonus: {R+%d {wHitroll {R+%d {wDamroll{x\r\n",ch->pcdata->stats[UNI_RAGE],ch->pcdata->stats[UNI_RAGE]);
stc(buf,ch);
}
if (IS_CLASS(ch,CLASS_NINJA))
{
sprintf(buf,"{cNinja Ki: {R%d {wout of {r500 {wstored.{x ",ch->pcdata->powers[NINJAKI]);
stc(buf,ch);
sprintf(buf,"{cHaraKiri: {R%d {wticks{x\r\n",ch->pcdata->powers[HARA_KIRI]);
stc(buf,ch);
sprintf(buf,"{cMichi Bonus: {R+%d {wHitroll and Damroll{x\r\n",ch->pcdata->stats[UNI_RAGE]);
stc(buf,ch);
}
}
divide_to_char(ch);
return;
}