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

RevScripts โค โ„ฑ๐“‡๐‘’๐‘’ ๐’ฎ๐’ธ๐“‡๐’พ๐“…๐“‰๐’พ๐“ƒ๐‘” ๐’ฎ๐‘’๐“‡๐“‹๐’พ๐’ธ๐‘’ ๐’ฏโ„ฑ๐’ฎ ๐Ÿท.๐Ÿป+ โค

Sarah Wesker

ฦฦ–ั”gฮฑฮทั‚ Sัƒฮทั‚ฮฑx โค
Staff member
TFS Developer
Support Team
Joined
Mar 16, 2017
Messages
1,459
Solutions
163
Reaction score
2,152
Location
London
GitHub
MillhioreBT
YouTube
millhiorebt
โค ๐…๐ซ๐ž๐ž ๐’๐œ๐ซ๐ข๐ฉ๐ญ๐ข๐ง๐  ๐’๐ž๐ซ๐ฏ๐ข๐œ๐ž ๐Ÿ.๐Ÿ“+ โค

๐Ÿ“š (ใฃโ—”โ—กโ—”)ใฃ โ„๐“ƒ๐’ป๐‘œ๐“‡๐“‚๐’ถ๐“‰๐’พ๐‘œ๐“ƒ ๐Ÿ“š
โค โ„ฐ๐“ƒ๐‘”๐’พ๐“ƒ๐‘’: ๐’ฏโ„ฑ๐’ฎ ๐’ช๐’ป๐’พ๐’ธ๐’พ๐’ถ๐“
โค โ„ฐ๐“ƒ๐‘”๐’พ๐“ƒ๐‘’ ๐’ฑ๐‘’๐“‡๐“ˆ๐’พ๐‘œ๐“ƒ: ๐Ÿท.๐Ÿป+

โš™๐Ÿ”งโ„‹๐‘œ๐“Œ ๐“‰๐‘œ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰ ๐’ถ ๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰?
โค โ„ณ๐’ถ๐“€๐‘’ ๐“ˆ๐“Š๐“‡๐‘’ ๐“Ž๐‘œ๐“Š ๐“‚๐‘’๐‘’๐“‰ ๐“‰๐’ฝ๐‘’ ๐’ธ๐‘œ๐“‡๐“‡๐‘’๐’ธ๐“‰ ๐“‹๐‘’๐“‡๐“ˆ๐’พ๐‘œ๐“ƒ ๐’ถ๐“ƒ๐’น ๐‘’๐“ƒ๐‘”๐’พ๐“ƒ๐‘’.
โค ๐’ฏ๐“‡๐“Ž ๐“ƒ๐‘œ๐“‰ ๐“‰๐‘œ ๐“‚๐’ถ๐“€๐‘’ ๐“Ž๐‘œ๐“Š๐“‡ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰ ๐“‰๐‘œ๐‘œ ๐’ธ๐‘œ๐“‚๐“…๐“๐‘’๐“, ๐’ถ๐“ˆ ๐“‰๐’ฝ๐‘’ ๐“ˆ๐’พ๐“‚๐“…๐“๐‘’๐“ˆ๐“‰ ๐‘œ๐“ƒ๐‘’๐“ˆ ๐“Œ๐’พ๐“๐“ ๐’ท๐‘’ ๐“‰๐’ถ๐“€๐‘’๐“ƒ ๐’ธ๐’ถ๐“‡๐‘’ ๐‘œ๐’ป ๐’ป๐’พ๐“‡๐“ˆ๐“‰.
โค ๐’ด๐‘œ๐“Š ๐’ถ๐‘”๐“‡๐‘’๐‘’ ๐“ƒ๐‘œ๐“‰ ๐“‰๐‘œ ๐’ป๐’พ๐“๐‘’ ๐’ถ ๐‘”๐“‡๐’พ๐‘’๐“‹๐’ถ๐“ƒ๐’ธ๐‘’๐“ˆ ๐’พ๐’ป ๐“Ž๐‘œ๐“Š๐“‡ ๐’ถ๐“…๐“…๐“๐’พ๐’ธ๐’ถ๐“‰๐’พ๐‘œ๐“ƒ ๐’พ๐“ˆ ๐’ถ๐’ธ๐’ธ๐‘’๐“…๐“‰๐‘’๐’น ๐’ท๐“Š๐“‰ ๐“ƒ๐‘’๐“‹๐‘’๐“‡ ๐“‡๐‘’๐“ˆ๐‘œ๐“๐“‹๐‘’๐’น.
โค ๐’ด๐‘œ๐“Š ๐“‚๐“Š๐“ˆ๐“‰ ๐’ฝ๐’ถ๐“‹๐‘’ ๐’ถ ๐’ธ๐‘’๐“‡๐“‰๐’ถ๐’พ๐“ƒ ๐“‡๐‘’๐“…๐“Š๐“‰๐’ถ๐“‰๐’พ๐‘œ๐“ƒ ๐’พ๐“ƒ ๐“‰๐’ฝ๐‘’ ๐’ป๐‘œ๐“‡๐“Š๐“‚, โ„ ๐’น๐‘œ ๐“ƒ๐‘œ๐“‰ ๐’ถ๐’ธ๐’ธ๐‘’๐“…๐“‰ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰๐“ˆ ๐’ป๐‘œ๐“‡ ๐“ƒ๐‘’๐“Œ ๐‘œ๐“‡ ๐“ˆ๐“Š๐“ˆ๐“…๐’พ๐’ธ๐’พ๐‘œ๐“Š๐“ˆ ๐’ถ๐’ธ๐’ธ๐‘œ๐“Š๐“ƒ๐“‰๐“ˆ, ๐“‰๐“‡๐“Ž ๐“ƒ๐‘œ๐“‰ ๐“‰๐‘œ ๐“Š๐“ˆ๐‘’ โ„ฑ๐’œ๐’ฆโ„ฐ๐’ฎ.
โค โ„›๐‘’๐“‚๐‘’๐“‚๐’ท๐‘’๐“‡ ๐“‹๐‘’๐“‡๐“Ž ๐“Œ๐‘’๐“๐“ ๐“‰๐’ฝ๐’ถ๐“‰ ๐’พ๐“‰ ๐’พ๐“ˆ ๐’ป๐‘œ๐“‡ ๐’ช๐’ป๐’ป๐’พ๐’ธ๐’พ๐’ถ๐“ ๐’ฏโ„ฑ๐’ฎ ๐“ˆ๐‘œ ๐’น๐‘œ๐“ƒ'๐“‰ ๐’ท๐‘œ๐“‰๐’ฝ๐‘’๐“‡ ๐’ถ๐“ˆ๐“€๐’พ๐“ƒ๐‘” ๐’ป๐‘œ๐“‡ ๐“ˆ๐‘œ๐“‚๐‘’๐“‰๐’ฝ๐’พ๐“ƒ๐‘” ๐’ป๐‘œ๐“‡ ๐“Ž๐‘œ๐“Š๐“‡ ๐‘œ๐“‰๐’ฝ๐‘’๐“‡ ๐‘’๐“ƒ๐‘”๐’พ๐“ƒ๐‘’, ๐’ถ๐“ˆ โ„ ๐“Œ๐’พ๐“๐“ ๐’พ๐‘”๐“ƒ๐‘œ๐“‡๐‘’ ๐“ˆ๐’ถ๐’พ๐’น ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰.
โค ๐’ฏ๐’ฝ๐‘’ ๐’น๐‘’๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰๐’พ๐‘œ๐“ƒ ๐“‚๐“Š๐“ˆ๐“‰ ๐’ท๐‘’ ๐’พ๐“ƒ โ„ฐ๐“ƒ๐‘”๐“๐’พ๐“ˆ๐’ฝ ๐’ถ๐“ƒ๐’น ๐“Œ๐‘’๐“๐“ ๐‘’๐“๐“…๐“๐’ถ๐’พ๐“ƒ๐‘’๐’น ๐“Œ๐’พ๐“‰๐’ฝ๐‘œ๐“Š๐“‰ ๐“‰๐‘œ๐‘œ ๐“‚๐’ถ๐“ƒ๐“Ž ๐“Œ๐‘œ๐“‡๐’น๐“ˆ.

๐ŸŽ€โ„‹๐‘œ๐“Œ ๐’น๐‘œ โ„ ๐“€๐“ƒ๐‘œ๐“Œ ๐’พ๐’ป ๐“‚๐“Ž ๐’ถ๐“…๐“…๐“๐’พ๐’ธ๐’ถ๐“‰๐’พ๐‘œ๐“ƒ ๐“Œ๐’ถ๐“ˆ ๐’ถ๐’ธ๐’ธ๐‘’๐“…๐“‰๐‘’๐’น?๐ŸŽ€
โค โ„๐’ป ๐“Ž๐‘œ๐“Š๐“‡ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰ ๐’ฝ๐’ถ๐“ˆ ๐“‚๐“Ž ๐“๐’พ๐“€๐‘’, ๐’พ๐“‰ ๐“‚๐‘’๐’ถ๐“ƒ๐“ˆ ๐“‰๐’ฝ๐’ถ๐“‰ ๐’พ๐“‰ ๐“Œ๐’ถ๐“ˆ ๐’ถ๐’ธ๐’ธ๐‘’๐“…๐“‰๐‘’๐’น.
โค โ„๐’ป ๐“Ž๐‘œ๐“Š๐“‡ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰ ๐’พ๐“ˆ ๐’ถ๐’ธ๐’ธ๐‘’๐“…๐“‰๐‘’๐’น, ๐“Ž๐‘œ๐“Š ๐’ฟ๐“Š๐“ˆ๐“‰ ๐’ฝ๐’ถ๐“‹๐‘’ ๐“‰๐‘œ ๐“Œ๐’ถ๐’พ๐“‰ ๐’ป๐‘œ๐“‡ ๐“‚๐‘’ ๐“‰๐‘œ ๐’ถ๐“ƒ๐“ˆ๐“Œ๐‘’๐“‡ ๐“Ž๐‘œ๐“Š๐“‡ ๐“‡๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰.

๐’ฏ๐’ฝ๐’พ๐“ˆ ๐’พ๐“ˆ ๐“‚๐“Ž ๐‘œ๐“๐’น ๐’ป๐“‡๐‘’๐‘’ ๐“ˆ๐‘’๐“‡๐“‹๐’พ๐’ธ๐‘’๐“ˆ ๐“‰๐’ฝ๐“‡๐‘’๐’ถ๐’น ๐’พ๐’ป ๐“Ž๐‘œ๐“Š'๐’น ๐“๐’พ๐“€๐‘’ ๐“‰๐‘œ ๐’ธ๐’ฝ๐‘’๐’ธ๐“€ ๐’ท๐‘’๐’ป๐‘œ๐“‡๐‘’ ๐“Ž๐‘œ๐“Š ๐’ถ๐“ˆ๐“€ ๐’ป๐‘œ๐“‡ ๐“ˆ๐‘œ๐“‚๐‘’๐“‰๐’ฝ๐’พ๐“ƒ๐‘” ๐“‡๐‘’๐“…๐‘’๐’ถ๐“‰๐‘’๐’น.

๐Ÿ“Œ โ„›๐‘’๐“†๐“Š๐‘’๐“ˆ๐“‰ ๐‘’๐“๐’ถ๐“‚๐“…๐“๐‘’: ๐Ÿ“Œ

โ„ฐ๐“ƒ๐‘”๐’พ๐“ƒ๐‘’ ๐’ถ๐“ƒ๐’น ๐’ฑ๐‘’๐“‡๐“ˆ๐’พ๐‘œ๐“ƒ โœ…
๐’Ÿ๐‘’๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰๐’พ๐‘œ๐“ƒ ๐Ÿ“‘
...
 
There is a way to do a spell to "print" all the resistances that the player has, I believe the way is through the items they are using, can anyone help?
It's not the spell, but talkaction. Maybe you will find it useful:
 
Hello everyone, it's me again...

I haven't done free services in this thread for quite some time.


I don't want to attend to old messages, TFS has changed a little and I want to see new messages, I will only attend to those first 5 people who write something, but yes! The rules when commenting are still valid,
Don't ask for things too big, I'll be here

If you have any reference video for an event, I will also accept it.

853012044588646451.webp


Warning: Only TFS master or Canary master
 
Hello everyone, it's me again...

I haven't done free services in this thread for quite some time.


I don't want to attend to old messages, TFS has changed a little and I want to see new messages, I will only attend to those first 5 people who write something, but yes! The rules when commenting are still valid,
Don't ask for things too big, I'll be here

If you have any reference video for an event, I will also accept it.

853012044588646451.webp
I need item enchantment script where players can gain atk speed,atk damg,armor,mana,health.+etc using magical dust and it is gained via npc when you trade him those magic dusts
 
Czeล›ฤ‡ wszystkim, to znowu ja...

Od dล‚uลผszego czasu nie zamieszczaล‚em w tym wฤ…tku ลผadnych bezpล‚atnych usล‚ug.


Nie chcฤ™ zajmowaฤ‡ siฤ™ starymi wiadomoล›ciami, TFS trochฤ™ siฤ™ zmieniล‚o i chcฤ™ zobaczyฤ‡ nowe wiadomoล›ci, zajmฤ™ siฤ™ tylko tymi pierwszymi 5 osobami, ktรณre coล› napiszฤ…, ale tak! Zasady komentowania nadal obowiฤ…zujฤ…,
Nie proล› o zbyt duลผe rzeczy, bฤ™dฤ™ tutaj

Jeล›li dysponujesz materiaล‚em wideo, na ktรณrym moลผna byล‚o nawiฤ…zaฤ‡ do jakiegoล› wydarzenia, rรณwnieลผ go zaakceptujฤ™.

853012044588646451.webp


Ostrzeลผenie: Tylko master TFS lub master Canary

Czeล›ฤ‡ Sara! :) Od jakiegoล› czasu prรณbujฤ™ zapytaฤ‡, czy ktoล› mรณgล‚by zaktualizowaฤ‡ jeden ze skryptรณw manekina. Pomysล‚ polega na tym, aby manekin trenowaล‚ tarczฤ™. Zazwyczaj potrzeba 2-3 potworรณw, aby trenowaฤ‡ tarczฤ™. Nie mam pojฤ™cia, jak to zrobiฤ‡ z jednym manekinem

Wersja 1.4.2 TFS

oryginalny wฤ…tek z kodem: TFS 1.X+ - trening na kieszonkowym manekicie (https://otland.net/threads/pocket-dummy-training.289804/)
 
GI would like an upgrade system but that works like this, increasing weapon damage, Wanda or arrows... I use a magicboostpercent system, I would like this to be an attribute too. When using the enchanted stone on a given item, a modal opens in which I can select the attribute I want...I hope you understand, thank you in advance ๐Ÿ˜
 
I need item enchantment script where players can gain atk speed,atk damg,armor,mana,health.+etc using magical dust and it is gained via npc when you trade him those magic dusts
Well I made a script that complies with the first thing he asked for, a magical dust that adds statistics to the items, the NPC thing is something separate, but I'm sure you know how to make an NPC sell an item :D

I didn't see any additional description of the system, so I made it as minimalist as possible so that it meets your request.

It was a pleasure, I'll continue with the next one!

LUA:
local MAGIC_DUST_ID = 8302
local DUST_CHANCE = 0.5

local STATS_KEYWORD = "stats"
local STATS_SUBID = 1000

local attributes = {
    ITEM_ATTRIBUTE_ATTACK_SPEED,
    ITEM_ATTRIBUTE_ARMOR,
    ITEM_ATTRIBUTE_ATTACK,
    ITEM_ATTRIBUTE_DEFENSE,
    ITEM_ATTRIBUTE_EXTRADEFENSE
}

local stats = {
    CONDITION_PARAM_STAT_MAXHITPOINTS,
    CONDITION_PARAM_STAT_MAXMANAPOINTS
}

local statsNames = {
    "Max Hitpoints",
    "Max Mana Points"
}

local values = {
    1, 2, 3, 4, 5
}

local function addAttributes(item, type)
    local atkSpeed = item:getAttribute(type)
    if atkSpeed then
        atkSpeed = atkSpeed + values[math.random(1, #values)]
        item:setAttribute(type, atkSpeed)
    end
end

local function addStats(item, type)
    local keyword = string.format("%s%d", STATS_KEYWORD, type)
    local statValue = tonumber(item:getCustomAttribute(keyword)) or 0
    statValue = statValue + values[math.random(1, #values)]
    item:setCustomAttribute(keyword, statValue)
end

local function sendToPlayer(player, item, slot)
    for i = 1, #stats do
        local statValue = tonumber(item:getCustomAttribute(string.format("%s%d",
            STATS_KEYWORD, stats[i])))
        if statValue then
            local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
            condition:setParameter(stats[i], statValue)
            condition:setParameter(CONDITION_PARAM_SUBID, STATS_SUBID + (slot * 10) + i)
            condition:setParameter(CONDITION_PARAM_TICKS, -1)
            player:addCondition(condition, true)
        end
    end
end

local function removeStats(player, slot)
    for i = 1, #stats do
        player:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT, STATS_SUBID + (slot * 10) + i)
    end
end

local event = Event()

function event.onLook(player, thing, position, distance, description)
    if thing:isItem() then
        local foundStats = {}
        for i = 1, #stats do
            local statValue = tonumber(thing:getCustomAttribute(string.format("%s%d",
                STATS_KEYWORD, stats[i])))
            if statValue then
                table.insert(foundStats, string.format("%s: %d", statsNames[i], statValue))
            end
        end

        if #foundStats > 0 then
            description = description .. "\n" .. table.concat(foundStats, "\n")
        end
    end
    return description
end

event:register(6)

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not isClass(target, Item) then
        return true
    end

    if math.random() > DUST_CHANCE then
        player:sendCancelMessage("The magic dust has failed to enchant the item.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        item:remove(1)
        return true
    end

    local randomAttribute = attributes[math.random(1, #attributes)]
    addAttributes(target, randomAttribute)

    local randomStat = stats[math.random(1, #stats)]
    addStats(target, randomStat)

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The magic dust has enchanted the item.")
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)

    item:remove(1)
    return true
end

action:id(MAGIC_DUST_ID)
action:register()

local event = Event()

function event.onInventoryUpdate(player, item, slot, equip)
    if equip then
        sendToPlayer(player, item, slot)
    else
        removeStats(player, slot)
    end
end

event:register(6)
Post automatically merged:

Let's get creative! Feel free to make detailed requests and use your imagination. Take your time to describe exactly what kind of script you're looking for.


To keep things fair, please avoid asking me to fix scripts from other threads or custom scripts. Let's focus on creating something new together. If you need modifications to an existing script, it's best to reach out to the original creator.
 
Last edited:
Hello. I would like to ask you if is there a possibility to create a talkaction that could show every creature that drop searched item. E.g. "!droplist plate armor" would show every monster with %chance of drop, sorted from highest to lowest % chance or from lowest XP (weakest) to highest.

TFS 1.5 8.0 nekiro
 
Hello. I would like to ask you if is there a possibility to create a talkaction that could show every creature that drop searched item. E.g. "!droplist plate armor" would show every monster with %chance of drop, sorted from highest to lowest % chance or from lowest XP (weakest) to highest.

TFS 1.5 8.0 nekiro
Hello, my pleasure, here is your script, I didn't test it in nekiro 8.0, but it should work fine anyway


LUA:
--[[
    Script created by @MillhioreBT
    Request: https://otland.net/threads/free-scripting-service-tfs-1-5.281162/post-2763809
]]

local MONSTER_TYPES = nil
local DROPLIST_CACHE = {}

local function getItemByName(itemName)
    if not MONSTER_TYPES then
        MONSTER_TYPES = Game.getMonsterTypes()
    end

    local itemType = ItemType(itemName)
    if not itemType or itemType:getId() == 0 then
        return
    end

    local realName = itemType:getName()
    local dropInfo = DROPLIST_CACHE[realName]
    if dropInfo then
        return dropInfo
    end

    local serverId = itemType:getId()
    for name, mType in pairs(MONSTER_TYPES) do
        local loot = mType:getLoot()
        for _, drop in ipairs(loot) do
            if drop.itemId == serverId then
                if not DROPLIST_CACHE[realName] then
                    DROPLIST_CACHE[realName] = {}
                end

                local info = {
                    monster = name,
                    chance = drop.chance
                }

                table.insert(DROPLIST_CACHE[realName], info)
            end
        end
    end

    dropInfo = DROPLIST_CACHE[realName]
    if dropInfo then
        table.sort(dropInfo, function(a, b) return a.chance > b.chance end)
        return dropInfo
    end
end

local talkAction = TalkAction("!droplist")

function talkAction.onSay(player, words, param, type)
    local paramTrimmed = param:splitTrimmed(',')
    if #paramTrimmed == 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Usage: !droplist <item name>")
        return false
    end

    local itemName = paramTrimmed[1]
    local itemInfo = getItemByName(itemName)
    if not itemInfo then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item not found in droplist.")
        return false
    end

    local mw = ModalWindow(10000, "Droplist: " .. itemName, "Item: " .. itemName)
    for index, info in ipairs(itemInfo) do
        local monster = info.monster
        local chance = info.chance
        local percent = (chance / MAX_LOOTCHANCE) * 100
        mw:addChoice(index, string.format("%s - %.2f%%", monster, percent))

        if index >= 100 then
            break
        end
    end

    mw:setDefaultEnterButton("Close")
    mw:setDefaultEscapeButton("Close")
    mw:sendToPlayer(player)
    return false
end

talkAction:separator(" ")
talkAction:register()
 
Thank you very much! It is awesome!!
However, I faced small issues:
- script doesn't work if already used while standing in same spot - player need to change position to use it again (maybe it is clientside problem? I use basic otcv8).
So I have changed it to text in chat so it stays and players can read it or copy while standing in one spot.

LUA:
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Drop list of ".. itemName..":")
 --   local mw = ModalWindow(10000, "Droplist: " .. itemName, "Item: " .. itemName)
    for index, info in ipairs(itemInfo) do
        local monster = info.monster
        local chance = info.chance
        local percent = (chance / MAX_LOOTCHANCE) * 100
 --       mw:addChoice(index, string.format("%s - %.2f%%", monster, percent))
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "".. monster.." (".. percent.."%)")
       if index >= 100 then
           break
        end
    end

--    mw:setDefaultEnterButton("Close")
--   mw:setDefaultEscapeButton("Close")
--    mw:sendToPlayer(player)


- secondly it doesn't see all monsters, I don't see the pattern or cause yet (loot from 20-30% is missing completely)
Maybe cache table is limited to some extend?
Edit: it happens to part of monsters in subfolders, not in main monsters folder
 
Last edited:
Thank you very much! It is awesome!!
However, I faced small issues:
- script doesn't work if already used while standing in same spot - player need to change position to use it again (maybe it is clientside problem? I use basic otcv8).
So I have changed it to text in chat so it stays and players can read it or copy while standing in one spot.

LUA:
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Drop list of ".. itemName..":")
 --   local mw = ModalWindow(10000, "Droplist: " .. itemName, "Item: " .. itemName)
    for index, info in ipairs(itemInfo) do
        local monster = info.monster
        local chance = info.chance
        local percent = (chance / MAX_LOOTCHANCE) * 100
 --       mw:addChoice(index, string.format("%s - %.2f%%", monster, percent))
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "".. monster.." (".. percent.."%)")
       if index >= 100 then
           break
        end
    end

--    mw:setDefaultEnterButton("Close")
--   mw:setDefaultEscapeButton("Close")
--    mw:sendToPlayer(player)


- secondly it doesn't see all monsters, I don't see the pattern or cause yet (loot from 20-30% is missing completely)
Maybe cache table is limited to some extend?
Edit: it happens to part of monsters in subfolders, not in main monsters folder

It looks like it can only check monsters, that have actual spawn point on the map.
 
It looks like it can only check monsters, that have actual spawn point on the map.
Correct. They have just be on the spawn.xml list, even if they cannot spawn on the spot at server startup. The best workaround is to spawn them somewhere hidden on the map. Thanks!
 
Any chance you can look at this script and get it working to where it shows distance effect and shoot effects? TFS 1.5
LUA:
function onUseWeapon(cid, var)
    local target = variantToNumber(var)
    local lvl = getPlayerLevel(cid)
    local skillType = SKILL_DISTANCE
    local skill = getPlayerSkillLevel(cid, skillType)

    local dmgMax = (((1000 * 1) + (skill * 40)) * (1 + (skill / 100))) / 1.4
    local dmgMin = dmgMax / 1.5
    
    local playerTarget = getCreatureTarget(cid)
    local targetPos = getPlayerPosition(playerTarget)
    local fromPos = getPlayerPosition(cid)

    if(target ~= 0) then

        ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, 0)
    end
    return ret
end
 
Any chance you can look at this script and get it working to where it shows distance effect and shoot effects? TFS 1.5
LUA:
function onUseWeapon(cid, var)
    local target = variantToNumber(var)
    local lvl = getPlayerLevel(cid)
    local skillType = SKILL_DISTANCE
    local skill = getPlayerSkillLevel(cid, skillType)

    local dmgMax = (((1000 * 1) + (skill * 40)) * (1 + (skill / 100))) / 1.4
    local dmgMin = dmgMax / 1.5
   
    local playerTarget = getCreatureTarget(cid)
    local targetPos = getPlayerPosition(playerTarget)
    local fromPos = getPlayerPosition(cid)

    if(target ~= 0) then

        ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, 0)
    end
    return ret
end

for such a simple thing you can actually use chatgpt
Its 2025 KI TIME meeen
 
Back
Top