diff --git a/README.md b/README.md index a3829e427..1b36e797f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ You are welcome to submit a pull request though. If you are looking for other protocols, switch the branch at the top. -This downgrade is up to May 11, 2021, commit: https://github.com/otland/forgottenserver/commit/809090df12cf78ed23211e7347d28489d028f96f +This downgrade is up to June 4th, 2021, commit: https://github.com/otland/forgottenserver/commit/ace6ff683488d60722904731131ed7cfb20abd82 ## How to compile [Wiki](https://github.com/otland/forgottenserver/wiki/Compiling) diff --git a/data/lib/core/player.lua b/data/lib/core/player.lua index ecb4e3925..614353dda 100644 --- a/data/lib/core/player.lua +++ b/data/lib/core/player.lua @@ -285,10 +285,10 @@ function Player.addSkill(self, skillId, value, round) return self:addSkillTries(skillId, self:getVocation():getRequiredSkillTries(skillId, self:getSkillLevel(skillId) + value) - self:getSkillTries(skillId)) end -function Player.getWeaponType() +function Player.getWeaponType(self) local weapon = self:getSlotItem(CONST_SLOT_LEFT) if weapon then - return ItemType(weapon:getId()):getWeaponType() + return weapon:getType():getWeaponType() end return WEAPON_NONE end diff --git a/data/scripts/actions/others/doors.lua b/data/scripts/actions/others/doors.lua index d4c6e4081..b9cfecae2 100644 --- a/data/scripts/actions/others/doors.lua +++ b/data/scripts/actions/others/doors.lua @@ -101,7 +101,7 @@ function door.onUse(player, item, fromPosition, target, toPosition, isHotkey) target:transform(transformTo) return true elseif table.contains(lockedDoors, itemId) then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is locked.") + player:sendTextMessage(MESSAGE_INFO_DESCR, "It is locked.") return true elseif table.contains(openDoors, itemId) or table.contains(openExtraDoors, itemId) or table.contains(openHouseDoors, itemId) then local creaturePositionTable = {} diff --git a/data/scripts/lib/register_monster_type.lua b/data/scripts/lib/register_monster_type.lua index 08f15ef34..269f8a9f7 100644 --- a/data/scripts/lib/register_monster_type.lua +++ b/data/scripts/lib/register_monster_type.lua @@ -262,7 +262,7 @@ registerMonsterType.attacks = function(mtype, mask) if attack.condition.type then spell:setConditionType(attack.condition.type) end - local startDamnage = 0 + local startDamage = 0 if attack.condition.startDamage then startDamage = attack.condition.startDamage end @@ -382,7 +382,7 @@ registerMonsterType.defenses = function(mtype, mask) if defense.condition.type then spell:setConditionType(defense.condition.type) end - local startDamnage = 0 + local startDamage = 0 if defense.condition.startDamage then startDamage = defense.condition.startDamage end diff --git a/data/spells/scripts/support/find_person.lua b/data/spells/scripts/support/find_person.lua index 3a11f7db9..1c539386c 100644 --- a/data/spells/scripts/support/find_person.lua +++ b/data/spells/scripts/support/find_person.lua @@ -62,7 +62,7 @@ function onCastSpell(creature, variant) end local level = positionDifference.z > 0 and LEVEL_HIGHER or positionDifference.z < 0 and LEVEL_LOWER or LEVEL_SAME - local distance = maxPositionDifference < 5 and DISTANCE_BESIDE or maxPositionDifference < 101 and DISTANCE_CLOSE or maxPositionDifference < 275 and DISTANCE_FAR or DISTANCE_VERYFAR + local distance = maxPositionDifference < 5 and DISTANCE_BESIDE or maxPositionDifference < 101 and DISTANCE_CLOSE or maxPositionDifference < 250 and DISTANCE_FAR or DISTANCE_VERYFAR local message = messages[distance][level] or messages[distance] if distance ~= DISTANCE_BESIDE then message = message .. " " .. directions[direction] diff --git a/src/iologindata.cpp b/src/iologindata.cpp index a6a56a45c..c9fde49ce 100644 --- a/src/iologindata.cpp +++ b/src/iologindata.cpp @@ -44,13 +44,6 @@ Account IOLoginData::loadAccount(uint32_t accno) return account; } -bool IOLoginData::saveAccount(const Account& acc) -{ - std::ostringstream query; - query << "UPDATE `accounts` SET `premium_ends_at` = " << acc.premiumEndsAt << " WHERE `id` = " << acc.id; - return Database::getInstance().executeQuery(query.str()); -} - std::string decodeSecret(const std::string& secret) { // simple base32 decoding diff --git a/src/iologindata.h b/src/iologindata.h index d47dd7dc5..3169d296f 100644 --- a/src/iologindata.h +++ b/src/iologindata.h @@ -30,7 +30,6 @@ class IOLoginData { public: static Account loadAccount(uint32_t accno); - static bool saveAccount(const Account& acc); static bool loginserverAuthentication(const std::string& name, const std::string& password, Account& account); static uint32_t gameworldAuthentication(const std::string& accountName, const std::string& password, std::string& characterName); diff --git a/src/monster.cpp b/src/monster.cpp index cd9ae4459..905b427c5 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -2001,3 +2001,13 @@ void Monster::getPathSearchParams(const Creature* creature, FindPathParams& fpp) fpp.fullPathSearch = !canUseAttack(getPosition(), creature); } } + +bool Monster::canPushItems() const +{ + Monster* master = this->master ? this->master->getMonster() : nullptr; + if (master) { + return master->mType->info.canPushItems; + } + + return mType->info.canPushItems; +} diff --git a/src/monster.h b/src/monster.h index f1b8b5b43..09b42e870 100644 --- a/src/monster.h +++ b/src/monster.h @@ -104,9 +104,7 @@ class Monster final : public Creature return mType->info.isAttackable; } - bool canPushItems() const { - return mType->info.canPushItems; - } + bool canPushItems() const; bool canPushCreatures() const { return mType->info.canPushCreatures; } diff --git a/src/spells.cpp b/src/spells.cpp index 435764ba8..11a04382d 100644 --- a/src/spells.cpp +++ b/src/spells.cpp @@ -264,16 +264,6 @@ InstantSpell* Spells::getInstantSpell(const std::string& words) return nullptr; } -InstantSpell* Spells::getInstantSpellById(uint32_t spellId) -{ - for (auto& it : instants) { - if (it.second.getId() == spellId) { - return &it.second; - } - } - return nullptr; -} - InstantSpell* Spells::getInstantSpellByName(const std::string& name) { for (auto& it : instants) { diff --git a/src/spells.h b/src/spells.h index 99fe30f79..087dea56b 100644 --- a/src/spells.h +++ b/src/spells.h @@ -51,8 +51,6 @@ class Spells final : public BaseEvents InstantSpell* getInstantSpell(const std::string& words); InstantSpell* getInstantSpellByName(const std::string& name); - InstantSpell* getInstantSpellById(uint32_t spellId); - TalkActionResult_t playerSaySpell(Player* player, std::string& words); static Position getCasterPosition(Creature* creature, Direction dir); diff --git a/src/teleport.h b/src/teleport.h index 6c8a478f6..d0b539492 100644 --- a/src/teleport.h +++ b/src/teleport.h @@ -41,8 +41,8 @@ class Teleport final : public Item, public Cylinder const Position& getDestPos() const { return destPos; } - void setDestPos(Position pos) { - destPos = std::move(pos); + void setDestPos(const Position& pos) { + destPos = pos; } bool checkInfinityLoop(Tile* destTile);