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

Warzone Geode and Crystals

Indahouse

Member
Joined
May 13, 2015
Messages
79
Reaction score
13
Hello,

About: Warzone, Crystals used into Geode = Create Teleport to boss room

The stupid question of the day, i have look into RME and Scripts, i cannot find the system how it's working the Crystals, to put 30x crystals on geode and create a Teleport, there is no any action id or unique id, how it works ?

I want re create similar but just with another Item and not with the geode, can anyone explain me or telling me which script is, all warzone files the only one crystals stones has Action ID ( for give the crystals ) but nothing more
 
you provided no information at all... how will we know where to look if we don't know which server/datapack you are using...
 
Sorry Evil Puncker i forget,
We are on OtservBR TFS 1.3

The geode where add the 30x crystals when playing:
You see a hollow geode.
This geode is hollow, it seems somehow connected to the platform next to it.
Item ID: 30745
Client ID: 27510

Crystals Stones ( random in warzone 5 ):
You see a large harvestable crystals (Vol:8).
Item ID: 30738, Action ID: 57356
Client ID: 27503

In RME: nothing on Geode no Action ID no UID all is in 0, and i dont find the script how when using 30 crystals on this geode , they disappear and converts into Teleport. ( stalagmite also has 0 on all )
the script about actionID of crystals:
Lua:
local crystalDuration = 5 * 60 -- 5 minutes

local crystals = {
    -- Warzone IV
    [57350] = Storage.DangerousDepths.Crystals.WarzoneVI.MediumCrystal1,
    [57351] = Storage.DangerousDepths.Crystals.WarzoneVI.BigCrystal1,
    [57352] = Storage.DangerousDepths.Crystals.WarzoneVI.BigCrystal2,
    [57353] = Storage.DangerousDepths.Crystals.WarzoneVI.MediumCrystal2,
    [57354] = Storage.DangerousDepths.Crystals.WarzoneVI.SmallCrystal1,
    [57355] = Storage.DangerousDepths.Crystals.WarzoneVI.SmallCrystal2,

    -- Warzone V
    [57356] = Storage.DangerousDepths.Crystals.WarzoneV.BigCrystal1,
    [57357] = Storage.DangerousDepths.Crystals.WarzoneIV.MediumCrystal1,
    [57358] = Storage.DangerousDepths.Crystals.WarzoneV.BigCrystal2,
    [57359] = Storage.DangerousDepths.Crystals.WarzoneIV.MediumCrystal2,
    [57360] = Storage.DangerousDepths.Crystals.WarzoneV.SmallCrystal1,
    [57361] = Storage.DangerousDepths.Crystals.WarzoneV.SmallCrystal2,

    -- Warzone IV
    [57362] = Storage.DangerousDepths.Crystals.WarzoneIV.BigCrystal1,
    [57363] = Storage.DangerousDepths.Crystals.WarzoneIV.MediumCrystal1,
    [57364] = Storage.DangerousDepths.Crystals.WarzoneIV.BigCrystal2,
    [57365] = Storage.DangerousDepths.Crystals.WarzoneIV.MediumCrystal2,
    [57366] = Storage.DangerousDepths.Crystals.WarzoneIV.SmallCrystal1,
    [57367] = Storage.DangerousDepths.Crystals.WarzoneIV.SmallCrystal2,
}

local crystalsChance = {
    [30738] = 1, -- Large Crystal
    [30740] = 5, -- Medium Crystal
    [17017] = 5, -- Medium Crystal
    [32405] = 7, -- Small Crystal
}

local function createCrystal(crystalId, player)
    local crystalChance = crystalsChance[crystalId]
    if not crystalChance then
        return false
    end

    local chance = math.random(10)
    local itemId = chance <= crystalChance and 18554 or 31993

    local item = Game.createItem(itemId, 1)
    local ret = player:addItemEx(item)
    if ret ~= RETURNVALUE_NOERROR then
        player:sendCancelMessage(Game.getReturnMessage(ret))
        return false
    end

    return true
end

local dangerousDepthWarzoneCrystals = Action()
function dangerousDepthWarzoneCrystals.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local crystalTimer = crystals[item:getActionId()]
    if not crystalTimer or crystalTimer > os.time() then
        return true
    end

    local itemId = item:getId()
    local crystal = createCrystal(itemId, player)
    if crystal then
        player:setStorageValue(crystalTimer, os.time() + crystalDuration)
    end

    return true
end

for value = 57350, 57367 do
    dangerousDepthWarzoneCrystals:aid(value)
end
dangerousDepthWarzoneCrystals:register()
 
Last edited:
Back
Top