Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUT]Custom Room Tags.

Status
Not open for further replies.
Newbie Spellweaver
Joined
Mar 10, 2012
Messages
50
Reaction score
5
Hey Guys,
before i go learn to work with MWidgets i want to create one tutorial to make Custom Room Tags.
Well, i keep this short just follow the step. The functions you have to find out by you self, i can't teach you that.

In this tutorial we are going to make a Custom room tag to have all the HP'S/AP's the same.

Syntax
Code:
If you are making a custom room tag you always have to start with:
if(strstr(ZGetGameClient()->GetStageName(), "[ROOMTAGNAME]"))
in the Room Tag field you type the room tag name.
So you will have this:
if(strstr(ZGetGameClient()->GetStageName(), "[SAMPLE]"))
{
Function
}

Our first Function (HP/AP for every player the same):
Put this code in ZCharacter.cpp
Code:
// HP and AP 500/500
	if(strstr(ZGetGameClient()->GetStageName(), "[500HP]"))
	{
		m_Property.fMaxHP.Set_CheckCrc(500);
		m_fPreMaxHP = 500;
		m_Property.fMaxAP.Set_CheckCrc(500);
		m_fPreMaxAP = 500;
	}

I hope you guys learned a little bit from this.
Happy Coding!

Credits: qet123
 
Last edited by a moderator:
Hi, I'm Omar!
Loyal Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
Oh, so qet, you claim credits for this now, huh?

Anyway, the smarter way was to use sscanf for the [500HP].
 
Newbie Spellweaver
Joined
Mar 10, 2012
Messages
50
Reaction score
5
Oh, so qet, you claim credits for this now, huh?

Anyway, the smarter way was to use sscanf for the [500HP].
I Always work with strstr by my self, also i see no difference in it.
 
Good Guy George
Loyal Member
Joined
Apr 12, 2009
Messages
1,260
Reaction score
239
Code:
if(strstr(ZGetGameClient()->GetStageName(), "[500HP]"))
{
m_Property.fMaxHP.Set_CheckCrc(500);
m_fPreMaxHP = 500;
m_Property.fMaxAP.Set_CheckCrc(500);
m_fPreMaxAP = 500;
}
Or let them type own value: ([HP=XX] [AP=XX])
Code:
int newhp = 0;
int newap = 0;
if(sscanf(ZGetGameClient()->GetStageName(), "[HP=%i] [AP=%i]", &newhp, &newap))
{
if(newhp > 0)
{
m_Property.fMaxHP.Set_CheckCrc(newhp);
m_fPreMaxHP = newhp;
}
if(newap > 0)
{
m_Property.fMaxAP.Set_CheckCrc(newap);
m_fPreMaxAP = newap;
}
else
{
m_Property.fMaxHP.Set_CheckCrc(pCharInfo->nHP + fAddedHP);
m_fPreMaxHP = pCharInfo->nHP + fAddedHP;
m_Property.fMaxAP.Set_CheckCrc(pCharInfo->nAP + fAddedAP);
m_fPreMaxAP = pCharInfo->nAP + fAddedAP;
}
}
 
Last edited:
Junior Spellweaver
Joined
Nov 29, 2009
Messages
129
Reaction score
7
Or let them type own value: ([HP=XX] [AP=XX])
Code:
int newhp = 0;
int newap = 0;
if(sscanf(ZGetGameClient()->GetStageName(), "[HP=%i] [AP=%i]", &newhp, &newap))
{
if(newhp > 0)
{
m_Property.fMaxHP.Set_CheckCrc(newhp);
m_fPreMaxHP = newhp;
}
if(newap > 0)
{
m_Property.fMaxAP.Set_CheckCrc(newap);
m_fPreMaxAP = newap;
}
else
{
m_Property.fMaxHP.Set_CheckCrc(pCharInfo->nHP + fAddedHP);
m_fPreMaxHP = pCharInfo->nHP + fAddedHP;
m_Property.fMaxAP.Set_CheckCrc(pCharInfo->nAP + fAddedAP);
m_fPreMaxAP = pCharInfo->nAP + fAddedAP;
}
}

No good idea, because then people use it to get free exp. :love:
 
Hi, I'm Omar!
Loyal Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
if(200 > newhp > 0) is certainly invalid.

if(sscanf()) is also invalid.
 
Hi, I'm Omar!
Loyal Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
It would do the same even without the if.
 
Status
Not open for further replies.
Back
Top