Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We cannot show the enemy Mana information on the player in SphereServ packages. #1299

Open
uox1 opened this issue Oct 2, 2024 · 15 comments
Open

Comments

@uox1
Copy link

uox1 commented Oct 2, 2024

We can show our own Mana information on the player on the client. If a player is in a Guild or Party, we can still show the mana information. But we cannot show the enemy Mana information on the player in SphereServ packages. How can we do this?

d11

In Client, this send info for player, not enemy..

d3

We can already do this, we just couldn't show the mana bar on the enemy player with any package.

d22

But if the other player is a friendly player, we can do this. So party or guild member

We are using Sphere x1 and I think the Emulator needs to be re-arranged for enemy mana information. Because we can't get this data for the enemy. How can we do this?

@cbnolok
Copy link
Contributor

cbnolok commented Oct 9, 2024

I think that your request is fairly uncommon, so i'm not sure it would be useful to add this option to the core for everyone.
My first guess is that this it's the code involved:

void CClient::addHitsUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addHitsUpdate");
	if ( !pChar )
		return;

	PacketHealthUpdate cmd(pChar, pChar == m_pChar);
	cmd.send(this);
}

void CClient::addManaUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addManaUpdate");
	if ( !pChar )
		return;

	PacketManaUpdate cmd(pChar, true);
	cmd.send(this);

	if ( pChar->m_pParty )
	{
		PacketManaUpdate cmd2(pChar, false);
		pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
	}
}

void CClient::addStamUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addStamUpdate");
	if ( !pChar )
		return;

	PacketStaminaUpdate cmd(pChar, true);
	cmd.send(this);

	if ( pChar->m_pParty )
	{
		PacketStaminaUpdate cmd2(pChar, false);
		pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
	}
}

As you can see, addHitsUpdate sends the hits update to everyone, but stam and mana are sent only to the party members. If you need those to be sent to everyone, you can just remove the pParty check.

@uox1
Copy link
Author

uox1 commented Oct 9, 2024

Thank you for answer. How about adding this as an option for sphere.ini? This option might be a good idea for us and other users.

@cbnolok
Copy link
Contributor

cbnolok commented Oct 9, 2024

I feel that would be a very niche feature, i don't see a place for it in the ini for anyone to use

@canerksk
Copy link
Contributor

canerksk commented Oct 10, 2024

The servers are dependent on SphereServer for many reasons and I recommend that the demands of the servers be evaluated. After all, without these servers, neither Ultima Online nor SphereServer can be sustainable.

Actually this can be done with a tag,

@DavideRei
Copy link
Contributor

DavideRei commented Oct 11, 2024

These changes would require a custom version of the client, so you can use a custom version of Sphere with the changes that you need.
They are not compatible with the standard client.

@xMirroRx
Copy link

Yes, I agree with you. However, this is a bit difficult for those who do not understand the SphereX core.

It would be nice to have these and similar features added as an option in the .ini.

@xMirroRx
Copy link

void CClient::addManaUpdate( CChar *pChar )
{
ADDTOCALLSTACK("CClient::addManaUpdate");
if ( !pChar )
return;

PacketManaUpdate cmd(pChar, true);
cmd.send(this);

if ( pChar->m_pParty )
{
PacketManaUpdate cmd2(pChar, false);
pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
}
}

I did not get any results when I did this.

 void CClient::addManaUpdate( CChar *pChar )
 {
 	ADDTOCALLSTACK("CClient::addManaUpdate");
 	if ( !pChar )
 		return;
 
 	PacketManaUpdate cmd(pChar, true);
 	cmd.send(this);
 
 }

@DavideRei
Copy link
Contributor

Yes, I agree with you. However, this is a bit difficult for those who do not understand the SphereX core.

It would be nice to have these and similar features added as an option in the .ini.

I can see your point but adding a custom feature in my opinion would mean open Sphere-X potentially to any custom feature requested by anyone. It would be challenging to develop and mantain it, struggling between standard and custom clients.
I mean It's difficult to have a free bug stable version now, imagine how it would be with custom clients features.

@xMirroRx
Copy link

If there was another way to do this, that would be perfectly fine, but there are exceptions.

If there was another option that would give everyone access to this packet, this topic wouldn't be opened here. Imagine you are a gamemaster and you want to design and present the game the way you want because you think you can market it the way you designed it, but you can't.

If I didn't know that this could be made an option, I wouldn't have responded after Nolok's second message.

@DavideRei
Copy link
Contributor

You can use sendpacket from scripts to send a packet to the client, but I don't know if it could work in this case.

Eventually, if you want to develop a highly customizable shard, you will need a custom Sphere version just to handle the packets changes, because as you know the packets are crafted for the standard client.
Now you are talking about 1 packet, but what about the future? If you'll need to change 10 packets, do you expect Sphere developers to enable a flag for each package?

@xMirroRx
Copy link

Of course, you know this situation and process better.

@uox1
Copy link
Author

uox1 commented Oct 11, 2024

I think that your request is fairly uncommon, so i'm not sure it would be useful to add this option to the core for everyone. My first guess is that this it's the code involved:

void CClient::addHitsUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addHitsUpdate");
	if ( !pChar )
		return;

	PacketHealthUpdate cmd(pChar, pChar == m_pChar);
	cmd.send(this);
}

void CClient::addManaUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addManaUpdate");
	if ( !pChar )
		return;

	PacketManaUpdate cmd(pChar, true);
	cmd.send(this);

	if ( pChar->m_pParty )
	{
		PacketManaUpdate cmd2(pChar, false);
		pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
	}
}

void CClient::addStamUpdate( CChar *pChar )
{
	ADDTOCALLSTACK("CClient::addStamUpdate");
	if ( !pChar )
		return;

	PacketStaminaUpdate cmd(pChar, true);
	cmd.send(this);

	if ( pChar->m_pParty )
	{
		PacketStaminaUpdate cmd2(pChar, false);
		pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
	}
}

As you can see, addHitsUpdate sends the hits update to everyone, but stam and mana are sent only to the party members. If you need those to be sent to everyone, you can just remove the pParty check.

When we tried this, Party members also lost mana information. So this situation didn't work.

Also, I do not see this as a special server request. Because this already exists in all developing games today. We can only see the mana information of Party players in your system. Why would it be so difficult to see enemy mana information as well? So this can be simply done and added. Doing this does not harm anything or mean that it cannot be used by other SphereX users. I think you won't lose anything by adding enemies to your system for Mana.

@Jhobean
Copy link
Contributor

Jhobean commented Oct 11, 2024

For testing you can simply do a fork of repositiry, change the line and github action will compile it for you.

@uox1
Copy link
Author

uox1 commented Oct 11, 2024

As I said, we tried what @cbnolok suggested and it didn't work. And Party members also lost their information of mana.

@Cypriot-Kibris
Copy link

This system is already a system that works with the Party, so I don't understand why it is not added in a way that we can see the enemy's. as a player i would love to see for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants