Skip to content

Commit

Permalink
Merge branch 'opentibiabr:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
paczielny authored Mar 17, 2024
2 parents d3934be + af7126a commit e4e468d
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 79 deletions.
8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/crowbar.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/machete.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/pick.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/rope.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/scythe.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/shovel.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/spoon.lua

This file was deleted.

7 changes: 4 additions & 3 deletions data-otservbr-global/npc/gnomadness.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ local function creatureSayCallback(npc, creature, type, message)
end
if hazard:setPlayerCurrentLevel(player, desiredLevel) then
npcHandler:say("Your hazard level has been set to " .. desiredLevel .. ". Good luck!", npc, creature)
if desiredLevel >= hazard.maxLevel and not player:kv():scoped("primal-ordeal"):get("received-prize") then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations you received the Noxious Ripptor mount.")
if desiredLevel >= 6 and not player:kv():scoped("primal-ordeal"):get("received-prize") then
player:addMount(202)
npcHandler:say("You've achived the maximum hazard level. As a reward, you've received the Noxious Ripptor mount and a primal bag.", npc, creature)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations you received the Noxious Ripptor mount.")
player:addAchievement("Ripp-Ripp Hooray!")
player:addItem(PRIMAL_BAG, 1)
player:kv():scoped("primal-ordeal"):set("received-prize", true)
npcHandler:say("You've achieved the necessary hazard level. As a reward, you've received the Noxious Ripptor mount and a primal bag.", npc, creature)
end
else
npcHandler:say("You can't set your hazard level higher than your maximum unlocked level.", npc, creature)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions data/scripts/lib/register_achievements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ ACHIEVEMENTS = {
[531] = { name = "First Achievement", grade = 1, points = 1, secret = true, description = "Congratulations to your very first achievement! ... Well, not really. But imagine, it is. Because at this point during your journey into Tibia's past, achievements have been introduced." },
[532] = { name = "Sharp Dressed", grade = 1, points = 2, description = "Just everyone will be crazy about you if you are wearing this formal dress. They will come running, promise!" },
[533] = { name = "Engine Driver", grade = 1, points = 3, description = "This glooth-driven locomotive will bring you to any party in the blink of an eye." },
[540] = { name = "Ripp-Ripp Hooray!", grade = 1, points = 3, description = "Don't get carried away by your success. Get carried away by your Ripptor." },
}

--[[
Expand Down
24 changes: 11 additions & 13 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3246,11 +3246,7 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr<Thing> &thing,
}
}
} else if (slotPosition & SLOTP_TWO_HAND) {
if (inventory[CONST_SLOT_LEFT] && inventory[CONST_SLOT_LEFT] != item) {
ret = RETURNVALUE_BOTHHANDSNEEDTOBEFREE;
} else {
ret = RETURNVALUE_NOERROR;
}
ret = RETURNVALUE_CANNOTBEDRESSED;
} else if (inventory[CONST_SLOT_LEFT]) {
std::shared_ptr<Item> leftItem = inventory[CONST_SLOT_LEFT];
WeaponType_t type = item->getWeaponType(), leftType = leftItem->getWeaponType();
Expand All @@ -3273,11 +3269,19 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr<Thing> &thing,
}

case CONST_SLOT_LEFT: {
if (slotPosition & SLOTP_LEFT) {
if (item->isQuiver()) {
ret = RETURNVALUE_CANNOTBEDRESSED;
} else if (slotPosition & SLOTP_LEFT) {
WeaponType_t type = item->getWeaponType();
if (type == WEAPON_NONE || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
ret = RETURNVALUE_CANNOTBEDRESSED;
} else if (inventory[CONST_SLOT_RIGHT] && (slotPosition & SLOTP_TWO_HAND)) {
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (slotPosition & SLOTP_TWO_HAND) {
if (inventory[CONST_SLOT_RIGHT]) {
WeaponType_t type = item->getWeaponType();
// Allow equip bow when quiver is in SLOT_RIGHT
if (type == WEAPON_DISTANCE && inventory[CONST_SLOT_RIGHT]->isQuiver()) {
ret = RETURNVALUE_NOERROR;
} else {
Expand All @@ -3286,12 +3290,6 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr<Thing> &thing,
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (slotPosition & SLOTP_TWO_HAND) {
if (inventory[CONST_SLOT_RIGHT] && inventory[CONST_SLOT_RIGHT] != item) {
ret = RETURNVALUE_BOTHHANDSNEEDTOBEFREE;
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (inventory[CONST_SLOT_RIGHT]) {
std::shared_ptr<Item> rightItem = inventory[CONST_SLOT_RIGHT];
WeaponType_t type = item->getWeaponType(), rightType = rightItem->getWeaponType();
Expand Down
2 changes: 1 addition & 1 deletion src/io/functions/iologindata_save_player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IOLoginDataSave : public IOLoginData {
static bool savePlayerTaskHuntingClass(std::shared_ptr<Player> player);
static bool savePlayerForgeHistory(std::shared_ptr<Player> player);
static bool savePlayerBosstiary(std::shared_ptr<Player> player);
static bool savePlayerStorage(std::shared_ptr<Player> palyer);
static bool savePlayerStorage(std::shared_ptr<Player> player);

protected:
using ItemBlockList = std::list<std::pair<int32_t, std::shared_ptr<Item>>>;
Expand Down
4 changes: 3 additions & 1 deletion src/items/functions/item/item_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ void ItemParse::createAndRegisterScript(ItemType &itemType, pugi::xml_node attri
auto stringKey = asLowerCaseString(subKeyAttribute.as_string());
if (stringKey == "slot") {
auto slotName = asLowerCaseString(subValueAttribute.as_string());
if (moveevent && slotName != "two-handed" && (moveevent->getEventType() == MOVE_EVENT_EQUIP || moveevent->getEventType() == MOVE_EVENT_DEEQUIP)) {
if (moveevent && (moveevent->getEventType() == MOVE_EVENT_EQUIP || moveevent->getEventType() == MOVE_EVENT_DEEQUIP)) {
if (slotName == "head") {
moveevent->setSlot(SLOTP_HEAD);
} else if (slotName == "necklace") {
Expand All @@ -1049,6 +1049,8 @@ void ItemParse::createAndRegisterScript(ItemType &itemType, pugi::xml_node attri
moveevent->setSlot(SLOTP_RING);
} else if (slotName == "ammo") {
moveevent->setSlot(SLOTP_AMMO);
} else if (slotName == "two-handed") {
moveevent->setSlot(SLOTP_TWO_HAND);
} else {
g_logger().warn("[{}] unknown slot type '{}'", __FUNCTION__, slotName);
}
Expand Down
10 changes: 5 additions & 5 deletions src/lua/creature/movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,18 +524,18 @@ uint32_t MoveEvent::EquipItem(const std::shared_ptr<MoveEvent> moveEvent, std::s
return 1;
}

const ItemType &it = Item::items[item->getID()];
if (it.transformEquipTo != 0) {
g_game().transformItem(item, it.transformEquipTo);
}

if (player->isItemAbilityEnabled(slot)) {
g_logger().debug("[{}] item ability is already enabled", __FUNCTION__);
return 1;
}

player->setItemAbility(slot, true);

const ItemType &it = Item::items[item->getID()];
if (it.transformEquipTo != 0) {
g_game().transformItem(item, it.transformEquipTo);
}

for (uint8_t slotid = 0; slotid < item->getImbuementSlot(); slotid++) {
player->updateImbuementTrackerStats();
ImbuementInfo imbuementInfo;
Expand Down

0 comments on commit e4e468d

Please sign in to comment.