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

Correct BlackSkull spells limitations #2333

Merged
merged 5 commits into from Dec 17, 2017
Merged

Conversation

nekiro
Copy link
Member

@nekiro nekiro commented Sep 10, 2017

This pull request should fix #2329

According to http://tibia.wikia.com/wiki/Skull_System

When a player has a black skull they will no longer be able to attack an unmarked player - that is any player without a skull. In addition to this, a black-skulled player may not use area attack spells and runes (i.e. Hell's Core, Explosion, etc.), as well as Burst Arrows to prevent black skulls from killing unmarked players indirectly. They also cannot summon or convince creatures, or use Undead Legion or strike spells (i.e. Energy Strike) which are not aimed at a target.

Copy link
Contributor

@wgrr wgrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since tfs is not a vanilla replica, this behavior should be configurable, or even better, could be completely done in lua when #2102 be merged.

@@ -1,4 +1,9 @@
function onCastSpell(creature, variant)
if player:getSkull() == SKULL_BLACK then
Copy link
Contributor

@wgrr wgrr Sep 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player is nil value here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@@ -7,7 +12,7 @@ function onCastSpell(creature, variant)
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing

if player:getSkull() == SKULL_BLACK then
return false
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace

src/monster.cpp Outdated
if (player->getSkull() == SKULL_BLACK) {
return false;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

src/spells.cpp Outdated
player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
return false;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@@ -7,7 +12,7 @@ function onCastSpell(creature, variant)
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing

Copy link
Member

@ranisalt ranisalt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@WibbenZ
Copy link
Member

WibbenZ commented Dec 15, 2017

@nekiro Can you resolve the conflicts?

@DSpeichert DSpeichert merged commit ee5156a into otland:master Dec 17, 2017
@nekiro nekiro deleted the black-skull-fix branch December 18, 2017 17:04
@WibbenZ WibbenZ added this to the 1.3 milestone Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No BlackSkull spells limitations
5 participants