Skip to content

Commit

Permalink
fix: remove bakragore icons talkaction (opentibiabr#2828)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored and s2leandro155 committed Sep 26, 2024
1 parent 43cd976 commit 3d1ed0c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 1 addition & 5 deletions data/scripts/talkactions/god/icons_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ function bakragoreIcon.onSay(player, words, param)
end

if param == "remove" then
for i = 1, 10 do
if player:hasCondition(CONDITION_BAKRAGORE, i) then
player:removeCondition(CONDITION_BAKRAGORE, i)
end
end
player:removeIconBakragore()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Removed all Bakragore icons.")
return true
end
Expand Down
14 changes: 14 additions & 0 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6216,6 +6216,20 @@ void Player::sendIconBakragore(const IconBakragore icon) {
}
}

void Player::removeBakragoreIcons() {
for (auto icon : magic_enum::enum_values<IconBakragore>()) {
if (hasCondition(CONDITION_BAKRAGORE, enumToValue(icon))) {
removeCondition(CONDITION_BAKRAGORE, CONDITIONID_DEFAULT, true);
}
}
}

void Player::removeBakragoreIcon(const IconBakragore icon) {
if (hasCondition(CONDITION_BAKRAGORE, enumToValue(icon))) {
removeCondition(CONDITION_BAKRAGORE, CONDITIONID_DEFAULT, true);
}
}

void Player::sendCyclopediaCharacterAchievements(uint16_t secretsUnlocked, std::vector<std::pair<Achievement, uint32_t>> achievementsUnlocked) {
if (client) {
client->sendCyclopediaCharacterAchievements(secretsUnlocked, achievementsUnlocked);
Expand Down
2 changes: 2 additions & 0 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,8 @@ class Player final : public Creature, public Cylinder, public Bankable {
void sendClosePrivate(uint16_t channelId);
void sendIcons();
void sendIconBakragore(const IconBakragore icon);
void removeBakragoreIcons();
void removeBakragoreIcon(const IconBakragore icon);
void sendClientCheck() const {
if (client) {
client->sendClientCheck();
Expand Down

0 comments on commit 3d1ed0c

Please sign in to comment.