Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2008, 11:29 PM
zeiksz2
Fire Beetle
 
Join Date: Oct 2007
Posts: 20
Default [wip] detailed exp gain

getting xp was a fabled thing those days i was playing. ya never knew how much you get, never knew how much to be done.. so here you go with some detailed xp.

description:
after "you gain experience/group xp" line you get line for xp and if needed aa xp. you get info that what kind of xp it is (normal or aa) then the amount then how much you are to do to gain a level and then how much of this exp gain you need to do the level.

example:
you gain experience!
normal: 10 (to go: 20 (2 from this)) - means you got 10 xp and you are to get 2 times 10 xp more to do the level.

Code:
			//we get xp or group xp, so we set up message
			if(this->IsGrouped())
				this->Message_StringID(15,GAIN_GROUPXP);
			else
				this->Message_StringID(15,GAIN_XP);


********* start



			//and we continue with some details..
			char szoveg [256];
			if (set_exp>m_pp.exp)
			{
				char ding [128];
				int togo = GetEXPForLevel(GetLevel()+1)-set_exp;
				//gain of normal xp
				if (togo<0) 
				{
					snprintf(ding,128,"%s","DING!"); 
				} else {
					if (togo/(set_exp-m_pp.exp)<10000)
					{
						snprintf(ding,128,"to go: %i (%i from this)",togo,togo/(set_exp-m_pp.exp));
					} else {
						snprintf(ding,128,"to go: %i (way to go)",togo);
					}
				}
				//no ding on max level - replace 65 with the function
				if (GetLevel()!=65)
				{
					snprintf(szoveg,256,"Normal: %i(%s)",set_exp-m_pp.exp,(char*)ding);
					Message(15,(char*)szoveg);
				}
			}
			if (set_aaxp>m_pp.expAA)
			{
				char ding2 [128];
				int togo2 = max_AAXP-set_aaxp;
				//gain of aa xp
				if (togo2<0) 
				{
					snprintf(ding2,128,"%s","DING!"); 
				} else { 
					if (togo2/(set_aaxp-m_pp.expAA)<10000)
					{
						snprintf(ding2,128,"to go: %i (%i from this)",togo2,togo2/(set_aaxp-m_pp.expAA));
					} else {
						snprintf(ding2,128,"to go: %i (way to go)",togo2);
					}
				}
				snprintf(szoveg,256,"AA: %i(%s)",set_aaxp-m_pp.expAA,(char*)ding2);
				Message(15,(char*)szoveg);
			}
		}
	}


******** end


	else if((set_exp + set_aaxp) < (m_pp.exp+m_pp.expAA)){ //only loss message if you lose exp, no message if you gained/lost nothing.
		Message(15, "You have lost experience.");
	}
my questions - in what i like to get help:
- how to get the level cap? (what function?) i placed a simple 65 into code
- just my second code in c, so ... dumb newbie question: how to round UP numbers? if you see the code you will see that the (from this) values are rounded down - so you may get message 10xp "(to go: 1 (0 from this))"
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:50 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3