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

Data/XML/Groups.xml/Flags dont work #2790

Closed
EmperorEduardo opened this issue Feb 14, 2020 · 10 comments
Closed

Data/XML/Groups.xml/Flags dont work #2790

EmperorEduardo opened this issue Feb 14, 2020 · 10 comments
Labels
needs-triage Needs testing with screenshot/video confirmation

Comments

@EmperorEduardo
Copy link

EmperorEduardo commented Feb 14, 2020

If you make any changes this it doesn't work.
<flag cannotusecombat="1" />

@EPuncker
Copy link
Contributor

EPuncker commented Feb 14, 2020

yes it works, I've just tested

<flag cannotusecombat="1" />
try attack:
"you may not attack this creature"

<flag cannotusecombat="0" />
try attack:
succeed

@DSpeichert DSpeichert added the needs-triage Needs testing with screenshot/video confirmation label Feb 14, 2020
@EmperorEduardo
Copy link
Author

EmperorEduardo commented Feb 15, 2020

example: I set <flag cannotattackmonster="0" />
"you may not attack this creature"
Did you really test well?
Sscreenshot: https://i.imgur.com/BJmuFoX.png

@EPuncker
Copy link
Contributor

yes I tested it well, also make sure that you are using default TFS groups.xml (that is the one that I'm using), since you seem to be using an edited one that god group id is 4, so your group_id in your database should be 4 instead of 3, next time reporting a bug, try to reproduce it with vanilla TFS,
45fbb6b6-bddc-4e50-a712-349f305a26f4

@EmperorEduardo
Copy link
Author

EmperorEduardo commented Feb 15, 2020

I has vanilla TFS. My bad. I tested with one.
Yes now... I needed set both options from 1 to 0
<flag cannotattackmonster="0" />
and
<flag cannotusecombat="0" />

@EPuncker
Copy link
Contributor

so, bug solved? xD

@zeeb1337
Copy link

zeeb1337 commented Feb 18, 2020

<flag cannotattackplayer="0" /> doesn't seem to work.
error1
No changes to groups.xml and character is triple checked to be group_id 3 with account type 5.

@EPuncker
Copy link
Contributor

EPuncker commented Feb 18, 2020

<flag cannotattackplayer="0" /> doesn't seem to work.
error1
No changes to groups.xml and character is triple checked to be group_id 3 with account type 5.

<flag cannotusecombat="0" /> is zero or one? the cannotattackplayer and cannotattackmonster works only together with that flag, you can't change only one and expect it to work...

right:

<flag cannotusecombat="0" /> <flag cannotattackplayer="1" />

wrong:
<flag cannotusecombat="1" /> <flag cannotattackplayer="1" />

in other words: you need to enable combat AND enable the combat type you want, either monster or player, not only one setting

@EPuncker
Copy link
Contributor

@EmperorEduardo was you able to understand? if you think this is not a but, you could close this issue

@zeeb1337
Copy link

zeeb1337 commented Feb 23, 2020

<flag cannotusecombat="0" /> -- Can use combat
<flag cannotattackplayer="0" /> -- Can attack players
<flag cannotattackmonster="0" /> -- Can attack monsters

All 3 checks out as FALSE, as they should if you want your GM to practically be an invincible player. Which means that there is obviously something wrong when I can't attack players but I can attack monsters with these settings.

Don't close it since it's still an issue.

@zeeb1337
Copy link

zeeb1337 commented Feb 23, 2020

Now it's SOLVED

combat.cpp

bool Combat::isProtected(const Player* attacker, const Player* target)
{
	uint32_t protectionLevel = g_config.getNumber(ConfigManager::PROTECTION_LEVEL);
	if (target->getLevel() < protectionLevel || attacker->getLevel() < protectionLevel) {
		return true;
	}

	//if (attacker->getVocationId() == VOCATION_NONE || target->getVocationId() == VOCATION_NONE) {
		//return true;
	//}

	if (attacker->getSkull() == SKULL_BLACK && attacker->getSkullClient(target) == SKULL_NONE) {
		return true;
	}

	return false;
}

Switch out the old one with this in the sources please so we can bury this 5+ year old problem once and for all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs testing with screenshot/video confirmation
Projects
None yet
Development

No branches or pull requests

4 participants