-
-
Notifications
You must be signed in to change notification settings - Fork 638
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
[Feature] Mechanics from12.72 #143
Conversation
Co-Authored-By: Rick <23365432+fakeshinoda@users.noreply.github.com> Co-Authored-By: Marcos <66353315+marcosvf132@users.noreply.github.com>
Co-Authored-By: Rick <23365432+fakeshinoda@users.noreply.github.com>
Co-Authored-By: Rick <23365432+fakeshinoda@users.noreply.github.com>
Co-Authored-By: Marcos <66353315+marcosvf132@users.noreply.github.com>
@@ -5772,6 +5826,27 @@ bool Game::combatChangeHealth(Creature* attacker, Creature* target, CombatDamage | |||
damage.primary.value = std::abs(damage.primary.value); | |||
damage.secondary.value = std::abs(damage.secondary.value); | |||
|
|||
bool perfectShot = false; | |||
if (attackerPlayer && damage.extension == false && damage.origin == ORIGIN_RANGED && target == attackerPlayer->getAttackedCreature()) { | |||
const Position& targetPos = target->getPosition(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cppcheck] reported by reviewdog 🐶
Local variable 'targetPos' shadows outer variable
src/items/functions/item_parse.cpp
Outdated
int16_t value = pugi::cast<int16_t>(valueAttribute.value()); | ||
Abilities & abilities = itemType.getAbilities(); | ||
for (auto & i: abilities.absorbPercent) { | ||
i += value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cppcheck] reported by reviewdog 🐶
Consider using std::transform algorithm instead of a raw loop.
} else if (stringValue == "reflectpercentall") { | ||
int16_t value = pugi::cast<int16_t>(valueAttribute.value()); | ||
for (auto& i : abilities.reflectPercent) { | ||
i += value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cppcheck] reported by reviewdog 🐶
Consider using std::transform algorithm instead of a raw loop.
Co-Authored-By: Majesty <32709570+MajestyOTBR@users.noreply.github.com>
…to "reflectDamage"
itemid = 35524, | ||
type = "equip", | ||
slot = "right-hand", | ||
level = 150, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains trailing whitespace
itemid = 35524, | ||
type = "equip", | ||
slot = "right-hand", | ||
level = 150, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains trailing whitespace
@@ -64,6 +64,24 @@ enum CreatureIcon_t { | |||
CREATUREICON_HIGHERRECEIVEDDAMAGE = 1, | |||
CREATUREICON_LOWERDEALTDAMAGE = 2, | |||
CREATUREICON_TURNEDMELEE = 3, | |||
CREATUREICON_GREENBALL = 4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are 2 sets of these icons
First set is monster icons (1-3). It supports numbers but they're optional. These icons are displayed only for monsters (other creatures don't show them).
The other set is icons for all creatures (1-21). Numbers are always displayed here.
Second byte of the packet determines which set you're sending.
I've documented the packet structure in a gist.
See https://gist.github.com/Zbizu/476f86b647eb907495deacdfa8594906 for details.
Both groups have to be sent in same packet btw to avoid resetting them. Monsters can have 24 of these icons in total (3 monster, 21 creature), other creatures 21.
Missing clientVersion update in |
Well remembered, thank you, I will change. |
What does that dot do? |
end | ||
end, | ||
[36725] = function(p) | ||
p:setStamina(p:getStamina() + 60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains trailing whitespace
table.insert(potionConditions[id], condition) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains only whitespace
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains only whitespace
end | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains only whitespace
player:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
return true | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
line contains only whitespace
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) | ||
player:setStorageValue(itemID, os.time() + 24 * 60 * 60) | ||
item:remove(1) | ||
local potionConditions = potionConditions[itemID] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[luacheck] reported by reviewdog 🐶
shadowing upvalue 'potionConditions' on line 22
continue; | ||
} | ||
|
||
const ItemType& it = Item::items[item->getID()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cppcheck] reported by reviewdog 🐶
Local variable 'it' shadows outer variable
SonarCloud Quality Gate failed. 0 Bugs |
ItemParse has been refactored and decoupled in a own file to allow for better organization and avoid breakage in the compilation Fixed some bugs, such as fields in items.xml This commit is necessary for the pull request (12.72 protocol) to work correctly: #143 Co-authored-by @dudantas <eduardo.dantas@hotmail.com.br>
Description
Client support 12.72
Thanks to Rick (FakeShinoda) and Marcos for help with bytes
Type of change
Checklist