diff --git a/data-canary/scripts/actions/other/cask_kegs.lua b/data-canary/scripts/actions/other/cask_kegs.lua deleted file mode 100644 index f437840e3fa..00000000000 --- a/data-canary/scripts/actions/other/cask_kegs.lua +++ /dev/null @@ -1,69 +0,0 @@ -local targetIdList = { - --health potions casks - [25879] = { itemId = 285, transform = 266 }, -- Health Potion -- - [25880] = { itemId = 283, transform = 236 }, -- Strong Health -- - [25881] = { itemId = 284, transform = 239 }, -- Great Health -- - [25882] = { itemId = 284, transform = 7643 }, -- Ultimate Health -- - [25883] = { itemId = 284, transform = 23375 }, -- Supreme Health -- - --mana potions casks - [25889] = { itemId = 285, transform = 268 }, -- Mana Potion -- - [25890] = { itemId = 283, transform = 237 }, -- Strong Mana -- - [25891] = { itemId = 284, transform = 238 }, -- Great Mana -- - [25892] = { itemId = 284, transform = 23373 }, -- Ultimate Mana -- - --spirit potions caks - [25899] = { itemId = 284, transform = 7642 }, -- Great Spirit -- - [25900] = { itemId = 284, transform = 23374 }, --Ultimate Spirit -- - - --health potions kegs - [25903] = { itemId = 285, transform = 266 }, -- Health Potion -- - [25904] = { itemId = 283, transform = 236 }, -- Strong Health -- - [25905] = { itemId = 284, transform = 239 }, -- Great Health -- - [25906] = { itemId = 284, transform = 7643 }, -- Ultimate Health -- - [25907] = { itemId = 284, transform = 23375 }, -- Supreme Health -- - - --mana potion kegs - [25908] = { itemId = 285, transform = 268 }, -- Mana Potion -- - [25909] = { itemId = 283, transform = 237 }, -- Strong Mana -- - [25910] = { itemId = 284, transform = 238 }, -- Great Mana -- - [25911] = { itemId = 284, transform = 23373 }, -- Ultimate Mana -- - - --spirit potions kegs - [25913] = { itemId = 284, transform = 7642 }, -- Great Spirit -- - [25914] = { itemId = 284, transform = 23374 }, --Ultimate Spirit -- -} - -local flasks = Action() - -function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not target or not target:getItem() then - return false - end - - local charges = target:getCharges() - local itemCount = item:getCount() - if itemCount > charges then - itemCount = charges - end - - local targetId = targetIdList[target:getId()] - if targetId and item:getId() == targetId.itemId and charges > 0 then - local potMath = item:getCount() - itemCount - local parent = item:getParent() - if not (parent:isContainer() and parent:addItem(item:getId(), potMath)) then - player:addItem(item:getId(), potMath, true) - end - - item:transform(targetId.transform, itemCount) - charges = charges - itemCount - target:transform(target:getId(), charges) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Remaining %s charges.", charges)) - if charges == 0 then - target:remove() - end - return true - end - return false -end - -flasks:id(283, 284, 285) -flasks:register() diff --git a/data-canary/scripts/actions/other/costume_bag.lua b/data-canary/scripts/actions/other/costume_bag.lua deleted file mode 100644 index e67b8817c3d..00000000000 --- a/data-canary/scripts/actions/other/costume_bag.lua +++ /dev/null @@ -1,45 +0,0 @@ -local setting = { - -- Common - [653] = { - "orc warrior", - "pirate cutthroat", - "dworc voodoomaster", - "dwarf guard", - "minotaur mage", - }, - -- Uncommon - [654] = { - "quara hydromancer", - "diabolic imp", - "banshee", - "frost giant", - "lich", - }, - -- Deluxe - [655] = { - "serpent spawn", - "demon", - "juggernaut", - "behemoth", - "ashmunrah", - }, -} - -local costumeBag = Action() - -function costumeBag.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local creatures = setting[item.itemid] - if not creatures then - return true - end - player:setMonsterOutfit(creatures[math.random(#creatures)], 5 * 60 * 10 * 1000) - item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - item:remove() - return true -end - -for index, value in pairs(setting) do - costumeBag:id(index) -end - -costumeBag:register() diff --git a/data-canary/scripts/actions/other/fireworks_rocket.lua b/data-canary/scripts/actions/other/fireworks_rocket.lua deleted file mode 100644 index a9bd16393e8..00000000000 --- a/data-canary/scripts/actions/other/fireworks_rocket.lua +++ /dev/null @@ -1,18 +0,0 @@ -local fireworksRocket = Action() - -function fireworksRocket.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if fromPosition.x ~= CONTAINER_POSITION then - fromPosition:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE)) - else - local position = player:getPosition() - position:sendMagicEffect(CONST_ME_HITBYFIRE) - position:sendMagicEffect(CONST_ME_EXPLOSIONAREA) - player:say("Ouch! Rather place it on the ground next time.", TALKTYPE_MONSTER_SAY) - player:addHealth(-10) - end - item:remove() - return true -end - -fireworksRocket:id(6576) -fireworksRocket:register() diff --git a/data-canary/scripts/actions/other/scroll_of_ascension.lua b/data-canary/scripts/actions/other/scroll_of_ascension.lua deleted file mode 100644 index 6a598484591..00000000000 --- a/data-canary/scripts/actions/other/scroll_of_ascension.lua +++ /dev/null @@ -1,17 +0,0 @@ -local scrollOfAscencion = Action() - -function scrollOfAscencion.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if math.random(10) > 1 then - player:setMonsterOutfit("Demon", 30 * 10 * 1000) - else - player:setMonsterOutfit("Ferumbras", 30 * 10 * 1000) - end - item:transform(22772) - item:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - item:decay() - player:say("Magical sparks whirl around the scroll as you read it and then your appearance is changing.", TALKTYPE_MONSTER_SAY) - return true -end - -scrollOfAscencion:id(22771) -scrollOfAscencion:register() diff --git a/data-canary/scripts/movements/snow.lua b/data-canary/scripts/movements/snow.lua deleted file mode 100644 index 26f2ce81390..00000000000 --- a/data-canary/scripts/movements/snow.lua +++ /dev/null @@ -1,19 +0,0 @@ -local snow = MoveEvent() -snow:type("stepout") - -function snow.onStepOut(creature, item, position, fromPosition) - if creature:isPlayer() and creature:isInGhostMode() then - return true - end - - if item.itemid == 799 then - item:transform(6594) - else - item:transform(item.itemid + 15) - end - item:decay() - return true -end - -snow:id(799, 6580, 6581, 6582, 6583, 6584, 6585, 6586, 6587, 6588, 6589, 6590, 6591, 6592, 6593) -snow:register() diff --git a/data-canary/scripts/movements/swimming.lua b/data-canary/scripts/movements/swimming.lua deleted file mode 100644 index 494a4433a21..00000000000 --- a/data-canary/scripts/movements/swimming.lua +++ /dev/null @@ -1,33 +0,0 @@ -local condition = Condition(CONDITION_OUTFIT) -condition:setOutfit({ lookType = 267 }) -condition:setTicks(-1) - -local swimming = MoveEvent() -swimming:type("stepin") - -function swimming.onStepIn(creature, item, position, fromPosition) - if not creature:isPlayer() then - return false - end - - creature:addCondition(condition) - return true -end - -swimming:id(629, 630, 631, 632, 633, 634, 4809, 4810, 4811, 4812, 4813, 4814) -swimming:register() - -local swimming = MoveEvent() -swimming:type("stepout") - -function swimming.onStepOut(creature, item, position, fromPosition) - if not creature:isPlayer() then - return false - end - - creature:removeCondition(CONDITION_OUTFIT) - return true -end - -swimming:id(629, 630, 631, 632, 633, 634, 4809, 4810, 4811, 4812, 4813, 4814) -swimming:register() diff --git a/data-otservbr-global/lib/others/vip_system.lua b/data-otservbr-global/lib/others/vip_system.lua index 6ca6de7d204..5a393157c8c 100644 --- a/data-otservbr-global/lib/others/vip_system.lua +++ b/data-otservbr-global/lib/others/vip_system.lua @@ -3,7 +3,7 @@ local config = { activationMessageType = MESSAGE_EVENT_ADVANCE, expirationMessage = "Your VIP days ran out.", - expirationMessageType = MESSAGE_ADMINISTRADOR, + expirationMessageType = MESSAGE_ADMINISTRATOR, outfits = {}, mounts = {}, diff --git a/data-otservbr-global/scripts/actions/other/cask_kegs.lua b/data-otservbr-global/scripts/actions/other/cask_kegs.lua deleted file mode 100644 index 872d30d613c..00000000000 --- a/data-otservbr-global/scripts/actions/other/cask_kegs.lua +++ /dev/null @@ -1,76 +0,0 @@ -local targetIdList = { - --health potions casks - [25879] = { itemId = 285, transform = 266, house = true }, -- Health Potion -- - [25880] = { itemId = 283, transform = 236, house = true }, -- Strong Health -- - [25881] = { itemId = 284, transform = 239, house = true }, -- Great Health -- - [25882] = { itemId = 284, transform = 7643, house = true }, -- Ultimate Health -- - [25883] = { itemId = 284, transform = 23375, house = true }, -- Supreme Health -- - --mana potions casks - [25889] = { itemId = 285, transform = 268, house = true }, -- Mana Potion -- - [25890] = { itemId = 283, transform = 237, house = true }, -- Strong Mana -- - [25891] = { itemId = 284, transform = 238, house = true }, -- Great Mana -- - [25892] = { itemId = 284, transform = 23373, house = true }, -- Ultimate Mana -- - --spirit potions caks - [25899] = { itemId = 284, transform = 7642, house = true }, -- Great Spirit -- - [25900] = { itemId = 284, transform = 23374, house = true }, --Ultimate Spirit -- - - --health potions kegs - [25903] = { itemId = 285, transform = 266 }, -- Health Potion -- - [25904] = { itemId = 283, transform = 236 }, -- Strong Health -- - [25905] = { itemId = 284, transform = 239 }, -- Great Health -- - [25906] = { itemId = 284, transform = 7643 }, -- Ultimate Health -- - [25907] = { itemId = 284, transform = 23375 }, -- Supreme Health -- - - --mana potion kegs - [25908] = { itemId = 285, transform = 268 }, -- Mana Potion -- - [25909] = { itemId = 283, transform = 237 }, -- Strong Mana -- - [25910] = { itemId = 284, transform = 238 }, -- Great Mana -- - [25911] = { itemId = 284, transform = 23373 }, -- Ultimate Mana -- - - --spirit potions kegs - [25913] = { itemId = 284, transform = 7642 }, -- Great Spirit -- - [25914] = { itemId = 284, transform = 23374 }, --Ultimate Spirit -- -} - -local flasks = Action() - -function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if not target then - return false - end - - local charges = target:getCharges() - local itemCount = item:getCount() - local recharged = itemCount - - if recharged > charges then - recharged = charges - end - - local targetId = targetIdList[target:getId()] - if targetId and targetId.itemId == item:getId() and charges > 0 then - -- Check is cask item is in house - if targetId.house and not player:getTile():getHouse() then - return false - end - - charges = charges - recharged - target:transform(target:getId(), charges) - if charges == 0 then - toPosition:sendMagicEffect(CONST_ME_POFF) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("No more charges left. Your keg has run dry.", charges)) - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Remaining %s charges.", charges)) - end - - player:addItem(targetId.transform, recharged) - if itemCount >= recharged then - item:transform(targetId.itemId, itemCount - recharged) - end - return true - end - return false -end - -flasks:id(283, 284, 285) -flasks:register() diff --git a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/scroll_of_ascension.lua b/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/scroll_of_ascension.lua deleted file mode 100644 index 7eccfa18edb..00000000000 --- a/data-otservbr-global/scripts/actions/quests/ferumbras_ascendant/scroll_of_ascension.lua +++ /dev/null @@ -1,18 +0,0 @@ -local ferumbrasAscendantScroll = Action() -function ferumbrasAscendantScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local outfit = { lookType = 35 } - if item.itemid == 22771 then - doSetCreatureOutfit(player, outfit, 30 * 1000) - item:transform(22772) - item:decay() - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Magical sparks whirl around the scroll as you read and then your appearance is changing.") - return true - elseif item.itemid == 22772 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are tired of the last scroll reading, rest your eyes for a moment.") - end - return true -end - -ferumbrasAscendantScroll:id(22771, 22772) -ferumbrasAscendantScroll:register() diff --git a/data/global.lua b/data/global.lua index d545ced7dd7..9ea4fd128a9 100644 --- a/data/global.lua +++ b/data/global.lua @@ -77,6 +77,7 @@ SCARLETT_MAY_DIE = 0 ropeSpots = { 386, 421, 386, 7762, 12202, 12936, 14238, 17238, 23363, 21965, 21966, 21967, 21968 } specialRopeSpots = { 12935 } +swimmingTiles = { 629, 630, 631, 632, 633, 634, 4809, 4810, 4811, 4812, 4813, 4814 } -- Global tables for systems if not _G.GlobalBosses then diff --git a/data/libs/functions/creature.lua b/data/libs/functions/creature.lua index 29e0303ca7e..be95a45144c 100644 --- a/data/libs/functions/creature.lua +++ b/data/libs/functions/creature.lua @@ -78,10 +78,6 @@ function Creature:setMonsterOutfit(monster, time) return false end - if self:isPlayer() and not (self:hasFlag(PlayerFlag_CanIllusionAll) or monsterType:isIllusionable()) then - return false - end - local condition = Condition(CONDITION_OUTFIT) condition:setOutfit(monsterType:getOutfit()) condition:setTicks(time) diff --git a/data/modules/scripts/gamestore/init.lua b/data/modules/scripts/gamestore/init.lua index e12a96ffa7f..4fa9daea28b 100644 --- a/data/modules/scripts/gamestore/init.lua +++ b/data/modules/scripts/gamestore/init.lua @@ -1631,20 +1631,22 @@ function GameStore.processHouseRelatedPurchase(player, offer) local inbox = player:getStoreInbox() if inbox then for _, itemId in ipairs(itemIds) do - local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1) - if decoKit then - decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a <" .. ItemType(itemId):getName() .. ">.") - decoKit:setCustomAttribute("unWrapId", itemId) - if isCaskItem(itemId) then - decoKit:setAttribute(ITEM_ATTRIBUTE_DATE, offer.count) - end + for i = 1, offer.count do + local decoKit = inbox:addItem(ITEM_DECORATION_KIT, 1) + if decoKit then + decoKit:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "You bought this item in the Store.\nUnwrap it in your own house to create a <" .. ItemType(itemId):getName() .. ">.") + decoKit:setCustomAttribute("unWrapId", itemId) + if isCaskItem(itemId) then + decoKit:setAttribute(ITEM_ATTRIBUTE_DATE, offer.count) + end - if offer.movable ~= true then - decoKit:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) + if offer.movable ~= true then + decoKit:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime()) + end end end + player:sendUpdateContainer(inbox) end - player:sendUpdateContainer(inbox) end end diff --git a/data-otservbr-global/scripts/actions/other/costume_bags.lua b/data/scripts/actions/items/costume_bags.lua similarity index 63% rename from data-otservbr-global/scripts/actions/other/costume_bags.lua rename to data/scripts/actions/items/costume_bags.lua index 4a159a1db3a..8dfe91ac3b9 100644 --- a/data-otservbr-global/scripts/actions/other/costume_bags.lua +++ b/data/scripts/actions/items/costume_bags.lua @@ -1,24 +1,27 @@ local config = { - [653] = { "orc warrior", "pirate cutthroat", "dworc voodoomaster", "dwarf guard", "minotaur mage", "ogre shaman", "ogre brute", "rat" }, -- common - [655] = { "serpent spawn", "demon", "juggernaut", "behemoth", "ashmunrah", "vexclaw", "grimeleech", "hellflayer", "black sheep" }, -- uncommon - [654] = { "quara hydromancer", "diabolic imp", "banshee", "frost giant", "lich", "vexclaw", "grimeleech", "hellflayer", "ogre shaman", "ogre brute", "pig" }, -- deluxe - [24949] = { "old beholder", "old bug", "old wolf", "old giant spider" }, -- old + [653] = { "orc warrior", "pirate cutthroat", "dworc voodoomaster", "dwarf guard", "minotaur mage", "ogre shaman", "ogre brute", "rat" }, + [654] = { "quara hydromancer", "diabolic imp", "banshee", "frost giant", "lich", "vexclaw", "grimeleech", "hellflayer", "ogre shaman", "ogre brute", "pig" }, + [655] = { "serpent spawn", "demon", "juggernaut", "behemoth", "ashmunrah", "vexclaw", "grimeleech", "hellflayer", "black sheep" }, + [24949] = { "old beholder", "old bug", "old wolf", "old giant spider" }, } local costumeBags = Action() function costumeBags.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local monsterNames = config[item.itemid] - if not monsterNames then + local creatures = config[item.itemid] + if not creatures then return true end - player:sendTextMessage(MESSAGE_STATUS, "You will stay 5 minutes transformed in a monster!") - doSetMonsterOutfit(player, monsterNames[math.random(#monsterNames)], 300 * 1000) + + player:setMonsterOutfit(creatures[math.random(#creatures)], 5 * 60 * 10 * 1000) player:addAchievementProgress("Masquerader", 100) - item:getPosition():sendMagicEffect(36) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) item:remove() return true end -costumeBags:id(653, 655, 654, 24949) +for k, v in pairs(config) do + costumeBags:id(k) +end + costumeBags:register() diff --git a/data-otservbr-global/scripts/actions/other/fireworks_rocket.lua b/data/scripts/actions/items/fireworks_rocket.lua similarity index 76% rename from data-otservbr-global/scripts/actions/other/fireworks_rocket.lua rename to data/scripts/actions/items/fireworks_rocket.lua index 2003fe96fc8..3a259e6d0cf 100644 --- a/data-otservbr-global/scripts/actions/other/fireworks_rocket.lua +++ b/data/scripts/actions/items/fireworks_rocket.lua @@ -4,12 +4,13 @@ function fireworksRocket.onUse(player, item, fromPosition, target, toPosition, i if fromPosition.x ~= CONTAINER_POSITION then fromPosition:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE)) else - local position = player:getPosition() - position:sendMagicEffect(CONST_ME_HITBYFIRE) - position:sendMagicEffect(CONST_ME_EXPLOSIONAREA) + player:getPosition():sendMagicEffect(CONST_ME_FIREAREA) + player:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE) player:say("Ouch! Rather place it on the ground next time.", TALKTYPE_MONSTER_SAY) + player:addAchievementProgress("Rocket in Pocket", 3) player:addHealth(-10, COMBAT_PHYSICALDAMAGE) end + player:addAchievementProgress("Fireworks in the Sky", 250) item:remove() return true diff --git a/data/scripts/actions/items/scroll_of_ascension.lua b/data/scripts/actions/items/scroll_of_ascension.lua new file mode 100644 index 00000000000..b763460c09b --- /dev/null +++ b/data/scripts/actions/items/scroll_of_ascension.lua @@ -0,0 +1,27 @@ +local scrollOfAscension = Action() + +function scrollOfAscension.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("scroll-of-ascension") then + return true + end + + local playerTile = Tile(player:getPosition()) + if playerTile and playerTile:getGround() and table.contains(swimmingTiles, playerTile:getGround():getId()) then + player:say("The scroll could get wet, step out of the water first.", TALKTYPE_MONSTER_SAY) + return true + end + + if math.random(10) > 1 then + player:setMonsterOutfit("Demon", 30 * 10 * 1000) + else + player:setMonsterOutfit("Ferumbras", 30 * 10 * 1000) + end + + player:setExhaustion("scroll-of-ascension", 60 * 60) + player:say("Magical sparks whirl around the scroll as you read it and then your appearance is changing.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + return true +end + +scrollOfAscension:id(22771) +scrollOfAscension:register() diff --git a/data/scripts/actions/objects/cask_and_kegs.lua b/data/scripts/actions/objects/cask_and_kegs.lua new file mode 100644 index 00000000000..1180257ed18 --- /dev/null +++ b/data/scripts/actions/objects/cask_and_kegs.lua @@ -0,0 +1,61 @@ +local targetIdList = { + [25879] = { itemId = 285, transform = 266 }, + [25880] = { itemId = 283, transform = 236 }, + [25881] = { itemId = 284, transform = 239 }, + [25882] = { itemId = 284, transform = 7643 }, + [25883] = { itemId = 284, transform = 23375 }, + [25889] = { itemId = 285, transform = 268 }, + [25890] = { itemId = 283, transform = 237 }, + [25891] = { itemId = 284, transform = 238 }, + [25892] = { itemId = 284, transform = 23373 }, + [25899] = { itemId = 284, transform = 7642 }, + [25900] = { itemId = 284, transform = 23374 }, + [25903] = { itemId = 285, transform = 266 }, + [25904] = { itemId = 283, transform = 236 }, + [25905] = { itemId = 284, transform = 239 }, + [25906] = { itemId = 284, transform = 7643 }, + [25907] = { itemId = 284, transform = 23375 }, + [25908] = { itemId = 285, transform = 268 }, + [25909] = { itemId = 283, transform = 237 }, + [25910] = { itemId = 284, transform = 238 }, + [25911] = { itemId = 284, transform = 23373 }, + [25913] = { itemId = 284, transform = 7642 }, + [25914] = { itemId = 284, transform = 23374 }, +} + +local flasks = Action() + +function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if not target or not target:getItem() then + return false + end + + local charges = target:getCharges() + local itemCount = item:getCount() + if itemCount > charges then + itemCount = charges + end + + local targetId = targetIdList[target:getId()] + if targetId and item:getId() == targetId.itemId and charges > 0 then + local potMath = item:getCount() - itemCount + local parent = item:getParent() + if not (parent:isContainer() and parent:addItem(item:getId(), potMath)) then + player:addItem(item:getId(), potMath, true) + end + + item:transform(targetId.transform, itemCount) + charges = charges - itemCount + target:transform(target:getId(), charges) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Remaining %s charges.", charges)) + + if charges == 0 then + target:remove() + end + return true + end + return false +end + +flasks:id(283, 284, 285) +flasks:register() diff --git a/data/scripts/creaturescripts/player/name_lock.lua b/data/scripts/creaturescripts/player/name_lock.lua index 322e8d135b8..cb2af81de3f 100644 --- a/data/scripts/creaturescripts/player/name_lock.lua +++ b/data/scripts/creaturescripts/player/name_lock.lua @@ -6,7 +6,7 @@ function CheckNamelock(player) player:setMoveLocked(true) player:teleportTo(player:getTown():getTemplePosition()) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Your name has been locked for the following reason: " .. namelockReason .. ".") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Your name has been locked for the following reason: " .. namelockReason .. ".") player:openStore("extras") addPlayerEvent(sendRequestPurchaseData, 50, player, 65002, GameStore.ClientOfferTypes.CLIENT_STORE_OFFER_NAMECHANGE) addPlayerEvent(CheckNamelock, 30000, player) diff --git a/data-otservbr-global/scripts/movements/others/snow.lua b/data/scripts/movements/snow.lua similarity index 89% rename from data-otservbr-global/scripts/movements/others/snow.lua rename to data/scripts/movements/snow.lua index 72a70293f84..d4801dcb25b 100644 --- a/data-otservbr-global/scripts/movements/others/snow.lua +++ b/data/scripts/movements/snow.lua @@ -11,6 +11,8 @@ function snow.onStepOut(creature, item, position, fromPosition) else item:transform(item.itemid + 15) end + + player:addAchievementProgress("Snowbunny", 10000) item:decay() return true end diff --git a/data-otservbr-global/scripts/movements/others/swimming.lua b/data/scripts/movements/swimming.lua similarity index 70% rename from data-otservbr-global/scripts/movements/others/swimming.lua rename to data/scripts/movements/swimming.lua index eee6858a1ce..d34d5036510 100644 --- a/data-otservbr-global/scripts/movements/others/swimming.lua +++ b/data/scripts/movements/swimming.lua @@ -18,31 +18,35 @@ local conditions = { local swimming = MoveEvent() function swimming.onStepIn(creature, item, position, fromPosition) - if not creature:isPlayer() then + local player = creature:getPlayer() + if not player then return false end + for i = 1, #conditions do - creature:removeCondition(conditions[i]) + player:removeCondition(conditions[i]) end - creature:addCondition(condition) + + player:addCondition(condition) return true end swimming:type("stepin") -swimming:id(629, 630, 631, 632, 633, 634) +swimming:id(unpack(swimmingTiles)) swimming:register() swimming = MoveEvent() function swimming.onStepOut(creature, item, position, fromPosition) - if not creature:isPlayer() then + local player = creature:getPlayer() + if not player then return false end - creature:removeCondition(CONDITION_OUTFIT) + player:removeCondition(CONDITION_OUTFIT) return true end swimming:type("stepout") -swimming:id(629, 630, 631, 632, 633, 634) +swimming:id(unpack(swimmingTiles)) swimming:register() diff --git a/data/scripts/talkactions/gm/ban.lua b/data/scripts/talkactions/gm/ban.lua index 8b46394a3e2..0ab07040333 100644 --- a/data/scripts/talkactions/gm/ban.lua +++ b/data/scripts/talkactions/gm/ban.lua @@ -37,11 +37,11 @@ function ban.onSay(player, words, param) local target = Player(name) if target then local text = target:getName() .. " has been banned" - player:sendTextMessage(MESSAGE_ADMINISTRADOR, text) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, text) Webhook.sendMessage("Player Banned", text .. " reason: " .. reason .. ". (by: " .. player:getName() .. ")", WEBHOOK_COLOR_YELLOW, announcementChannels["serverAnnouncements"]) target:remove() else - player:sendTextMessage(MESSAGE_ADMINISTRADOR, name .. " has been banned.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, name .. " has been banned.") end end diff --git a/data/scripts/talkactions/gm/broadcast.lua b/data/scripts/talkactions/gm/broadcast.lua index 021f218ebe3..dffbe1bb0e9 100644 --- a/data/scripts/talkactions/gm/broadcast.lua +++ b/data/scripts/talkactions/gm/broadcast.lua @@ -5,7 +5,7 @@ function Broadcast(text, filter) if filter and not filter(targetPlayer) then goto continue end - targetPlayer:sendTextMessage(MESSAGE_ADMINISTRADOR, text) + targetPlayer:sendTextMessage(MESSAGE_ADMINISTRATOR, text) ::continue:: end end diff --git a/data/scripts/talkactions/gm/clean.lua b/data/scripts/talkactions/gm/clean.lua index 6fe5f3cddfa..18ab149e216 100644 --- a/data/scripts/talkactions/gm/clean.lua +++ b/data/scripts/talkactions/gm/clean.lua @@ -6,7 +6,7 @@ function clean.onSay(player, words, param) local itemCount = cleanMap() if itemCount ~= 0 then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Cleaned " .. itemCount .. " item" .. (itemCount > 1 and "s" or "") .. " from the map.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Cleaned " .. itemCount .. " item" .. (itemCount > 1 and "s" or "") .. " from the map.") end return true end diff --git a/data/scripts/talkactions/gm/mc_check.lua b/data/scripts/talkactions/gm/mc_check.lua index c93661053e4..1815b7fdc9d 100644 --- a/data/scripts/talkactions/gm/mc_check.lua +++ b/data/scripts/talkactions/gm/mc_check.lua @@ -4,7 +4,7 @@ function mcCheck.onSay(player, words, param) -- create log logCommand(player, words, param) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Multiclient Check List:") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Multiclient Check List:") local ipList = {} local players = Game.getPlayers() for i = 1, #players do @@ -29,7 +29,7 @@ function mcCheck.onSay(player, words, param) tmpPlayer = list[i] message = ("%s, %s [%d]"):format(message, tmpPlayer:getName(), tmpPlayer:getLevel()) end - player:sendTextMessage(MESSAGE_ADMINISTRADOR, message .. ".") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, message .. ".") end end return true diff --git a/data/scripts/talkactions/gm/namelock.lua b/data/scripts/talkactions/gm/namelock.lua index 1b204759e02..27e41710096 100644 --- a/data/scripts/talkactions/gm/namelock.lua +++ b/data/scripts/talkactions/gm/namelock.lua @@ -33,7 +33,7 @@ function namelock.onSay(player, words, param) target:kv():set("namelock", reason) local text = target:getName() .. " has been namelocked" logger.info(text .. ", reason: " .. reason) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, text) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, text) Webhook.sendMessage("Player Namelocked", text .. " reason: " .. reason .. ".", WEBHOOK_COLOR_YELLOW, announcementChannels["serverAnnouncements"]) if online then CheckNamelock(target) diff --git a/data/scripts/talkactions/gm/unban.lua b/data/scripts/talkactions/gm/unban.lua index 264335eeec7..3d1caba8b77 100644 --- a/data/scripts/talkactions/gm/unban.lua +++ b/data/scripts/talkactions/gm/unban.lua @@ -18,7 +18,7 @@ function unban.onSay(player, words, param) db.asyncQuery("DELETE FROM `ip_bans` WHERE `ip` = " .. Result.getNumber(resultId, "lastip")) Result.free(resultId) local text = param .. " has been unbanned." - player:sendTextMessage(MESSAGE_ADMINISTRADOR, text) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, text) Webhook.sendMessage("Player Unbanned", text .. " (by: " .. player:getName() .. ")", WEBHOOK_COLOR_YELLOW, announcementChannels["serverAnnouncements"]) return true end diff --git a/data/scripts/talkactions/god/add_bosstiary_kills.lua b/data/scripts/talkactions/god/add_bosstiary_kills.lua index 4e5aecdfbd4..a6463c26162 100644 --- a/data/scripts/talkactions/god/add_bosstiary_kills.lua +++ b/data/scripts/talkactions/god/add_bosstiary_kills.lua @@ -24,9 +24,9 @@ function talkaction.onSay(player, words, param) local message = "Added received kills: " .. kills .. ", for boss: " .. monsterName if target == player then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, message .. " to yourself.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, message .. " to yourself.") else - player:sendTextMessage(MESSAGE_ADMINISTRADOR, message .. " to player: " .. targetName) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, message .. " to player: " .. targetName) target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received kills: " .. kills .. ", to boss: " .. monsterName) end target:addBosstiaryKill(monsterName, kills) diff --git a/data/scripts/talkactions/god/add_mount.lua b/data/scripts/talkactions/god/add_mount.lua index 813f46f38a9..b8b2f00dda1 100644 --- a/data/scripts/talkactions/god/add_mount.lua +++ b/data/scripts/talkactions/god/add_mount.lua @@ -22,8 +22,8 @@ function addOutfit.onSay(player, words, param) if target then local mount = tonumber(split[2]) target:addMount(mount) - target:sendTextMessage(MESSAGE_ADMINISTRADOR, "" .. player:getName() .. " has been added a new mount for you.") - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "You have sucessfull added mount " .. mount .. " to the player " .. target:getName() .. ".") + target:sendTextMessage(MESSAGE_ADMINISTRATOR, "" .. player:getName() .. " has been added a new mount for you.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "You have sucessfull added mount " .. mount .. " to the player " .. target:getName() .. ".") if printConsole then logger.info("[addOutfit.onSay] - Player: {} has been added mount: {} to the player: {}", player:getName(), lookType, target:getName()) end diff --git a/data/scripts/talkactions/god/add_outfit.lua b/data/scripts/talkactions/god/add_outfit.lua index 825aaf84c7e..a27fb4f8a18 100644 --- a/data/scripts/talkactions/god/add_outfit.lua +++ b/data/scripts/talkactions/god/add_outfit.lua @@ -24,8 +24,8 @@ function addOutfit.onSay(player, words, param) if target then local lookType = tonumber(split[2]) target:addOutfit(lookType) - target:sendTextMessage(MESSAGE_ADMINISTRADOR, "" .. player:getName() .. " has been added a new outfit for you.") - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "You have sucessfull added looktype " .. lookType .. " to the player " .. target:getName() .. ".") + target:sendTextMessage(MESSAGE_ADMINISTRATOR, "" .. player:getName() .. " has been added a new outfit for you.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "You have sucessfull added looktype " .. lookType .. " to the player " .. target:getName() .. ".") if printConsole then logger.info("[addOutfit.onSay] - Player: {} has been added looktype: {} to the player: {}", player:getName(), lookType, target:getName()) end diff --git a/data/scripts/talkactions/god/close_server.lua b/data/scripts/talkactions/god/close_server.lua index 930cde5be79..ad8cfadef2c 100644 --- a/data/scripts/talkactions/god/close_server.lua +++ b/data/scripts/talkactions/god/close_server.lua @@ -19,10 +19,10 @@ function closeServer.onSay(player, words, param) end elseif param == "maintainance" then Game.setGameState(GAME_STATE_MAINTAIN) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server is set to maintenance mode.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Server is set to maintenance mode.") else Game.setGameState(GAME_STATE_CLOSED) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server is now closed.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Server is now closed.") Webhook.sendMessage(":yellow_square: Server was closed by: **" .. player:getName() .. "**", announcementChannels["serverAnnouncements"]) end return true diff --git a/data/scripts/talkactions/god/ip_ban.lua b/data/scripts/talkactions/god/ip_ban.lua index 9826d726c87..09269de446f 100644 --- a/data/scripts/talkactions/god/ip_ban.lua +++ b/data/scripts/talkactions/god/ip_ban.lua @@ -32,14 +32,14 @@ function ipBan.onSay(player, words, param) resultId = db.storeQuery("SELECT 1 FROM `ip_bans` WHERE `ip` = " .. targetIp) if resultId ~= false then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, targetName .. " is already IP banned.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, targetName .. " is already IP banned.") Result.free(resultId) return true end local timeNow = os.time() db.query("INSERT INTO `ip_bans` (`ip`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (" .. targetIp .. ", '', " .. timeNow .. ", " .. timeNow + (ipBanDays * 86400) .. ", " .. player:getGuid() .. ")") - player:sendTextMessage(MESSAGE_ADMINISTRADOR, targetName .. " has been IP banned.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, targetName .. " has been IP banned.") return true end diff --git a/data/scripts/talkactions/god/open_server.lua b/data/scripts/talkactions/god/open_server.lua index 84f0b4afe49..83ac47878a1 100644 --- a/data/scripts/talkactions/god/open_server.lua +++ b/data/scripts/talkactions/god/open_server.lua @@ -5,7 +5,7 @@ function openServer.onSay(player, words, param) logCommand(player, words, param) Game.setGameState(GAME_STATE_NORMAL) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server is now open.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Server is now open.") Webhook.sendMessage(":green_circle: Server was opened by: **" .. player:getName() .. "**", announcementChannels["serverAnnouncements"]) return true end diff --git a/data/scripts/talkactions/god/raids.lua b/data/scripts/talkactions/god/raids.lua index 15f21801293..b9b4b909668 100644 --- a/data/scripts/talkactions/god/raids.lua +++ b/data/scripts/talkactions/god/raids.lua @@ -12,18 +12,18 @@ function startRaid.onSay(player, words, param) if Raid.registry[param] then local raid = Raid.registry[param] if raid:tryStart(true) then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Raid " .. param .. " started.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Raid " .. param .. " started.") else - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Raid " .. param .. " could not be started.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Raid " .. param .. " could not be started.") end return true end local returnValue = Game.startRaid(param) if returnValue ~= RETURNVALUE_NOERROR then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, Game.getReturnMessage(returnValue)) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, Game.getReturnMessage(returnValue)) else - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Raid started.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Raid started.") end return true end diff --git a/data/scripts/talkactions/god/reload.lua b/data/scripts/talkactions/god/reload.lua index 5b294305cf3..cf7d7e972ae 100644 --- a/data/scripts/talkactions/god/reload.lua +++ b/data/scripts/talkactions/god/reload.lua @@ -57,7 +57,7 @@ function reload.onSay(player, words, param) logger.info("Reloaded {}", param:lower()) player:sendTextMessage(MESSAGE_LOOK, string.format("Reloaded %s.", param:lower())) - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server is saved. Now will reload configs!") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Server is saved. Now will reload configs!") elseif not reloadType then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Reload type not found.") logger.warn("[reload.onSay] - Reload type '{}' not found", param) diff --git a/data/scripts/talkactions/god/save.lua b/data/scripts/talkactions/god/save.lua index 444f6ea20d2..845df50d9b4 100644 --- a/data/scripts/talkactions/god/save.lua +++ b/data/scripts/talkactions/god/save.lua @@ -16,7 +16,7 @@ function save.onSay(player, words, param) else saveServer() SaveHirelings() - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Server has been saved.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Server has been saved.") end return true end diff --git a/data/scripts/talkactions/god/start_raid.lua b/data/scripts/talkactions/god/start_raid.lua index b43e77c061a..cbd3fe24a79 100644 --- a/data/scripts/talkactions/god/start_raid.lua +++ b/data/scripts/talkactions/god/start_raid.lua @@ -11,9 +11,9 @@ function startRaid.onSay(player, words, param) local returnValue = Game.startRaid(param) if returnValue ~= RETURNVALUE_NOERROR then - player:sendTextMessage(MESSAGE_ADMINISTRADOR, Game.getReturnMessage(returnValue)) + player:sendTextMessage(MESSAGE_ADMINISTRATOR, Game.getReturnMessage(returnValue)) else - player:sendTextMessage(MESSAGE_ADMINISTRADOR, "Raid started.") + player:sendTextMessage(MESSAGE_ADMINISTRATOR, "Raid started.") end return true end diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 7cf6b6bcaf3..28986292029 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -2190,7 +2190,7 @@ void Player::onThink(uint32_t interval) { } else if (client && idleTime == 60000 * kickAfterMinutes) { std::ostringstream ss; ss << "There was no variation in your behaviour for " << kickAfterMinutes << " minutes. You will be disconnected in one minute if there is no change in your actions until then."; - client->sendTextMessage(TextMessage(MESSAGE_ADMINISTRADOR, ss.str())); + client->sendTextMessage(TextMessage(MESSAGE_ADMINISTRATOR, ss.str())); } } diff --git a/src/lua/functions/core/game/lua_enums.cpp b/src/lua/functions/core/game/lua_enums.cpp index 66b7cf1feec..2e3813e0769 100644 --- a/src/lua/functions/core/game/lua_enums.cpp +++ b/src/lua/functions/core/game/lua_enums.cpp @@ -742,7 +742,7 @@ void LuaEnums::initGameStateEnums(lua_State* L) { void LuaEnums::initMessageEnums(lua_State* L) { registerEnum(L, MESSAGE_GAMEMASTER_CONSOLE); registerEnum(L, MESSAGE_LOGIN); - registerEnum(L, MESSAGE_ADMINISTRADOR); + registerEnum(L, MESSAGE_ADMINISTRATOR); registerEnum(L, MESSAGE_EVENT_ADVANCE); registerEnum(L, MESSAGE_GAME_HIGHLIGHT); registerEnum(L, MESSAGE_FAILURE); diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 566f39c7e71..76795ced009 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4062,7 +4062,7 @@ void ProtocolGame::sendPremiumTrigger() { void ProtocolGame::sendTextMessage(const TextMessage &message) { if (message.type == MESSAGE_NONE) { g_logger().error("[ProtocolGame::sendTextMessage] - Message type is wrong, missing or invalid for player with name {}, on position {}", player->getName(), player->getPosition().toString()); - player->sendTextMessage(MESSAGE_ADMINISTRADOR, "There was a problem requesting your message, please contact the administrator"); + player->sendTextMessage(MESSAGE_ADMINISTRATOR, "There was a problem requesting your message, please contact the administrator"); return; } diff --git a/src/utils/utils_definitions.hpp b/src/utils/utils_definitions.hpp index 59f0049ad9c..af2c40ba533 100644 --- a/src/utils/utils_definitions.hpp +++ b/src/utils/utils_definitions.hpp @@ -340,7 +340,7 @@ enum MessageClasses : uint8_t { /* Red message in the console*/ /* TALKTYPE_BROADCAST */ MESSAGE_LOGIN = 17, /* White message at the bottom of the game window and in the console*/ - MESSAGE_ADMINISTRADOR = 18, /* Red message in game window and in the console*/ + MESSAGE_ADMINISTRATOR = 18, /* Red message in game window and in the console*/ MESSAGE_EVENT_ADVANCE = 19, /* White message in game window and in the console*/ MESSAGE_GAME_HIGHLIGHT = 20, /* Red message in game window and in the console*/ MESSAGE_FAILURE = 21, /* White message at the bottom of the game window"*/