new struct _ZONEINFO reemerges! (includes offset)

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Fri Jul 25, 2003 5:50 am

bump for new offset, as I think this should be cvsed, its good info...
for eqgame 11 jul 2003

Code: Select all

Zoneinfo=006B144C
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Jul 25, 2003 2:58 pm

Is the zone structure still valid? Er, never mind.

/zem command is in now because I'm looking for a new zone to hunt in and I'm too lazy to look up all the experience modifiers online.

In CVS and in the downloads zip.

Untested, please provide feedback.
Last edited by dont_know_at_all on Fri Jul 25, 2003 3:20 pm, edited 2 times in total.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Fri Jul 25, 2003 3:06 pm

yeah i pasted this in my macroparse cpp and /echo $zone(zem) works fine...

Code: Select all

PCHAR ParseMacroParameter(PSPAWNINFO pChar, PCHAR szOriginal)
{
	CHAR szOutput[MAX_STRING] = {0};
	CHAR szVar[MAX_STRING] = {0};
	DWORD i,j = 0;
	PCHARINFO pCharInfo = NULL;
	[b]PZONEINFO pZone = (PZONEINFO)0x006B144C;//11jul2003[/b]

Code: Select all

j+=strlen(GetFullZone(pCharInfo->ZoneBoundId));
						[b]// $zone(zem)
						} else if (!strncmp("zone(zem)",szVar,9)) {
							i+=8;
							float BASE_ZEM = 75.0; 
							float zem = 0; 
							float bonus = 0; 
							CHAR szTemp[MAX_STRING] = {0}; 
							zem = pZone->ZoneExpModifier * 100; 
							bonus = zem - BASE_ZEM; 
							sprintf(szTemp, "Zone experience modifier: %.1f%% (%.1f%% %s)", zem, (bonus<0) ? 0-bonus : bonus, (bonus<0) ? "penalty" : "bonus" );
							strcat(szOutput,szTemp);
							DebugSpew("zem- %s",szTemp);
							j+=strlen(szTemp);

					   [/b]// $zone(Unknown)
bold is the added lines...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

rcolbert
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sat Jul 26, 2003 3:55 pm

My way of adding $zone(zem)

Post by rcolbert » Sun Jul 27, 2003 1:04 am

This is probably not as clean as it could be but here goes.

MQ.h

Code: Select all

FLOAT		GetZoneZem				(BOOL bSBonus);
EQLib_Utilities.cpp

Code: Select all

// ***************************************************************************
// Function:    GetZoneZem
// Description: Returns the raw ZEM for the current zone.
// ***************************************************************************
FLOAT GetZoneZem(BOOL bSBonus)
{
	FLOAT BASE_ZEM = 75.0;
	FLOAT ZEM = 0;
	FLOAT BONUS = 0;
	PZONEINFO ZoneInfo = NULL;
	if (!EQADDR_ZONEINFO) return NULL;

	ZoneInfo = (PZONEINFO) EQADDR_ZONEINFO;
	ZEM = ZoneInfo->ZoneExpModifier *100;
	BONUS = ZEM - BASE_ZEM;

	if (bSBonus) {
		return (FLOAT)BONUS;	
	} else {
		return (FLOAT)ZEM;
	}
}
macroparse.cpp

Code: Select all

						// $zone(zem)
						} else if (!strncmp("zone(zem)",szVar,9)) {
							i+=8;
							CHAR szTemp[MAX_STRING] = {0};
							sprintf(szTemp, "%.1f%", GetZoneZem(false));
							strcat(szOutput,szTemp);
							j+=strlen(szTemp);
							
						// $zone(bonuz)
						} else if (!strncmp("zone(bonus)",szVar,11)) {
							i+=10;
							CHAR szTemp[MAX_STRING] = {0};
							sprintf(szTemp, "%.1f%", GetZoneZem(true));
							strcat(szOutput,szTemp);
							j+=strlen(szTemp);
*Edited to correct a flub in my lacking C++ skills
Last edited by rcolbert on Sun Jul 27, 2003 1:18 pm, edited 1 time in total.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 27, 2003 3:50 am

btw...I would vote on all parser code being done similarly. A function somewhere else that does all the work, then just one line in the main parser routine.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Jul 27, 2003 2:32 pm

Why is that?

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 27, 2003 2:34 pm

Looks cleaner, imo. The file that contains most of the parser code is the largest file already and is sometimes very hard to read through unless you spend time with it. That's all.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Jul 27, 2003 2:39 pm

I am opposed to moving code away from where it is used without a good reason. If the subroutine is used in more that one place (say for /zem and $zone(zem)), then that would be a good reason. But moving code for purely esoteric reasons makes me crazy, er, crazier.

After all, size doesn't matter.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jul 27, 2003 4:36 pm

hehe..I like pretty/neat code ...it makes me happy :)

Seriously though, it's the reason I'll never mess with Perl ...it looks "ugly" to me ..hehe

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Mon Jul 28, 2003 12:29 pm

PMP sucks... I'll admit that

I could probably drop at least 500 lines of it just by condensing all of the $char(), $target(), and $spawn() variables... only need to handle them once, instead of 3 times.
- Plazmic





xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: new struct _ZONEINFO reemerges! (includes offset)

Post by xyilla » Tue Jan 20, 2026 7:00 pm