• 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!

POI Goshnar

Xarah

Member
Joined
Apr 18, 2018
Messages
42
Reaction score
8
Hello, I have a problem with the script. The script is not responding to the blood. I tried modifying the script, but nothing works. I would appreciate any suggestions. Thank you in advance for any guidance.

action lua:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.actionid ~= 2023 then
        return false
    end

    if not Tile(toPosition):getItemById(2016, 2) then
        return true
    end

    toPosition.z = toPosition.z + 1
    player:teleportTo(toPosition)
    toPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

xml:
Code:
<action actionid="2023" script="quests/pits of inferno/goshnar.lua" />
 
If you're unsure what's happening, the easiest and fastest way is to add prints into the script.
This will help you verify that what you expect to happen, is actually happening in reality.

The prints will appear in the console.
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print(target.actionid)
    if target.actionid ~= 2023 then
        print("target's actionId does not equal 2023.")
        return false
    end

    print(Tile(toPosition):getItemById(2016, 2))
    if not Tile(toPosition):getItemById(2016, 2) then
        print("Tile does not contain the itemId 2016, with subId of 2.")
        return true
    end

    toPosition.z = toPosition.z + 1
    player:teleportTo(toPosition)
    toPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end
 
Sorry for the delay. But probably you need to change (2016, 2) for (2016, 10) to match the blood.
Anyways, we did this script with @Xikini via discord for the same stone of POI.

LUA:
local fluidPool = 2016
    
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local standPosition = Position(toPosition.x, toPosition.y + 1, toPosition.z)
    if player:getPosition() ~= standPosition then
        return false
    end
    local bloodPool = Tile(item:getPosition()):getItemById(fluidPool, 10)
    if bloodPool then
        player:teleportTo(Position(toPosition.x, toPosition.y, toPosition.z + 1))
        player:say('Muahahahaha..', TALKTYPE_MONSTER_SAY, false, player)
        fromPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
        toPosition:sendMagicEffect(CONST_ME_MORTAREA)
    end
    return true
end

Regards!
 

Similar threads

Replies
3
Views
271
Xikini
X
Back
Top