• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved MAGIC WALL REMOVE WHEN DOWN STAIRS

Izaack

Member
Joined
Jun 18, 2012
Messages
80
Solutions
1
Reaction score
21
Location
México
Good evening, how are you, could someone help me solve this error that I have with the magic wall rune, when you go down a ladder I need it to be eliminated. I am using Nekiro tfs 1.5
.mw error.png
 
U can check in movement(onStepIn) event if you stepdown from stairs it return the magic wall id, if yes, then you can just simply use item:remove(), if not you have to dig in source
 
Thanks!

I figured it out before your response by adding:

C++:
// remove magic walls/wild growth
    if (id == ITEM_MAGICWALL_SAFE || id == ITEM_WILDGROWTH_SAFE || isBlocking()) {
        if (!creature->isInGhostMode()) {
            g_game.internalRemoveItem(this, 1);
        }

        return;
    }

At the beginning of this method in combat.cpp

C++:
void MagicField::onStepInField(Creature* creature)

The comment you referenced seems more suitable for a non-PVP server, mine is PVP, but I still appreciate your help.
 
Last edited:
Thanks!

I figured it out before your response by adding:

In

C++:
void MagicField::onStepInField(Creature* creature)

C++:
// remove magic walls/wild growth
    if (id == ITEM_MAGICWALL_SAFE || id == ITEM_WILDGROWTH_SAFE || isBlocking()) {
        if (!creature->isInGhostMode()) {
            g_game.internalRemoveItem(this, 1);
        }

        return;
    }

In combat.cpp

The comment you referenced seems more suitable for a non-PVP server, mine is PVP, but I still appreciate your help.
its works for all servers not just in non pvp, glad to know you solved it by yourself although
 
I will leave it here if someone doesn't need handling PVP events and doesn't want to change C++ sources:
LUA:
function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return false
    end
    if(position.z == fromPosition.z) then
        return false
    end
    position:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
    item:remove()
    return true
end

And changing movements.xml
XML:
<movevent event="StepIn" itemid="1497" script="magic_wall.lua" />

Sharing because I don't see floor conditions in previous solutions.
 
Thanks!

I figured it out before your response by adding:

In

C++:
void MagicField::onStepInField(Creature* creature)

C++:
// remove magic walls/wild growth
    if (id == ITEM_MAGICWALL_SAFE || id == ITEM_WILDGROWTH_SAFE || isBlocking()) {
        if (!creature->isInGhostMode()) {
            g_game.internalRemoveItem(this, 1);
        }

        return;
    }

In combat.cpp

The comment you referenced seems more suitable for a non-PVP server, mine is PVP, but I still appreciate your help.
Idk why he manged to remove this line from the original tfs but yeah this is absolutly the solution
 
Back
Top