diff --git a/data/scripts/runes/magic_wall.lua b/data/scripts/runes/magic_wall.lua index b411fddd..5d0fdc55 100644 --- a/data/scripts/runes/magic_wall.lua +++ b/data/scripts/runes/magic_wall.lua @@ -1,16 +1,29 @@ function onCreateMagicWall(creature, position) local tile = Tile(position) - if tile and tile:getTopCreature() and not tile:getTopCreature():isPlayer() then + if not tile then return false end + + if tile:hasFlag(TILESTATE_FLOORCHANGE) then + return false + end + + if tile:getTopCreature() and not tile:getTopCreature():isPlayer() then + return false + end + local magicWall if Game.getWorldType() == WORLD_TYPE_NO_PVP then magicWall = ITEM_MAGICWALL_SAFE else magicWall = ITEM_MAGICWALL end + local item = Game.createItem(magicWall, 1, position) - item:setDuration(16, 24) + if item then + item:setDuration(16, 24) + item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, string.format("Casted by: %s", creature:getName())) + end end local combat = Combat() diff --git a/data/scripts/runes/wild_growth.lua b/data/scripts/runes/wild_growth.lua index 08feb66a..09b0edf7 100644 --- a/data/scripts/runes/wild_growth.lua +++ b/data/scripts/runes/wild_growth.lua @@ -1,16 +1,29 @@ function onCreateWildGrowth(creature, position) local tile = Tile(position) - if tile and tile:getTopCreature() and not tile:getTopCreature():isPlayer() then + if not tile then return false end + + if tile:hasFlag(TILESTATE_FLOORCHANGE) then + return false + end + + if tile:getTopCreature() and not tile:getTopCreature():isPlayer() then + return false + end + local wildGrowth if Game.getWorldType() == WORLD_TYPE_NO_PVP then wildGrowth = ITEM_WILDGROWTH_SAFE else wildGrowth = ITEM_WILDGROWTH end + local item = Game.createItem(wildGrowth, 1, position) - item:setDuration(30, 60) + if item then + item:setDuration(30) + item:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, string.format("Casted by: %s", creature:getName())) + end end local combat = Combat() diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index af37fc74..dfe90d03 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -1990,8 +1990,16 @@ void AreaCombat::getList(const Position ¢erPos, const Position &targetPos, s for (uint32_t y = 0; y < rows; ++y) { for (uint32_t x = 0; x < cols; ++x) { - if (area->getValue(y, x) != 0 && g_game().isSightClear(casterPos, tmpPos, true)) { - list.emplace_back(g_game().map.getOrCreateTile(tmpPos)); + if (area->getValue(y, x) != 0) { + std::shared_ptr tile = g_game().map.getTile(tmpPos); + if (tile && tile->hasFlag(TILESTATE_FLOORCHANGE)) { + ++tmpPos.x; + continue; + } + + if (g_game().isSightClear(casterPos, tmpPos, true)) { + list.emplace_back(g_game().map.getOrCreateTile(tmpPos)); + } } ++tmpPos.x; }