• 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,445
Solutions
160
Reaction score
2,076
Location
London
GitHub
MillhioreBT
Twitch
millhiorebt
โค ๐…๐ซ๐ž๐ž ๐’๐œ๐ซ๐ข๐ฉ๐ญ๐ข๐ง๐  ๐’๐ž๐ซ๐ฏ๐ข๐œ๐ž ๐Ÿ.๐Ÿ“+ โค

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

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

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

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

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

โ„ฐ๐“ƒ๐‘”๐’พ๐“ƒ๐‘’ ๐’ถ๐“ƒ๐’น ๐’ฑ๐‘’๐“‡๐“ˆ๐’พ๐‘œ๐“ƒ โœ…
๐’Ÿ๐‘’๐“ˆ๐’ธ๐“‡๐’พ๐“…๐“‰๐’พ๐‘œ๐“ƒ ๐Ÿ“‘
...
 
You can't remove the all field, if you don't want default properties leave the table empty.
View attachment 71839
example:
LUA:
all = {
        loot = {}
    },
THIS ERROR :c

Lua Script Error: [Scripts Interface]
C:\Users\Administrator\Desktop\forgottenserver-otclientv8\data\scripts\rareitem.
lua
...top\forgottenserver-otclientv8\data\scripts\rareitem.lua:55: attempt to index
local 'ec' (a nil value)
stack traceback:
[C]: in function '__newindex'
...top\forgottenserver-otclientv8\data\scripts\rareitem.lua:55: in main
chunk

Please help iam used tfs 1.3 otclientv8
 
Engine and Version: TFS 1.5 for Tibia 7.72.
Description:
I would love a script that would make it possible to drop items directly on the stairs while on it, like it is in 7.6 client.
In 7.72 client when you drop items while standing directly on the stairs it just immediately goes upstairs intead of landing ON the stairs.
To be more clear what I mean, I do not want players to be able to THROW items onto the stairs when they are beside it, only be possible when on the stairs. But players should still be able to remove the items which are on the stairs, doesn't matter from where.
(I've tried messing with the stair attributes to make it work like in tibia 7.6, it only works correctly if I remove the key attribute which makes it so you can't even walk up the stairs anymore).

First image is of Tibia 7.6 client which I tried to mimic to Tibia 7.72 version, which are the remaining two images.
 

Attachments

Last edited:
Engine and Version: TFS 1.5 for Tibia 7.72.
Description:
I would love a script that would make it possible to drop items directly on the stairs while on it, like it is in 7.6 client.
In 7.72 client when you drop items while standing directly on the stairs it just immediately goes upstairs intead of landing ON the stairs.
To be more clear what I mean, I do not want players to be able to THROW items onto the stairs when they are beside it, only be possible when on the stairs. But players should still be able to remove the items which are on the stairs, doesn't matter from where.
(I've tried messing with the stair attributes to make it work like in tibia 7.6, it only works correctly if I remove the key attribute which makes it so you can't even walk up the stairs anymore).

First image is of Tibia 7.6 client which I tried to mimic to Tibia 7.72 version, which are the remaining two images.
This wasnt a yurots bug? I dont think this is a โ€œ7.6โ€ thing
 
This wasnt a yurots bug? I dont think this is a โ€œ7.6โ€ thing
I tried on a different 7.6 server and you could do the same thing there.
I'm not gonna test all but I believe that was a 7.6 thing.
(depends on which trapdoor you're using).

I had to edit the 7.72 I'm currently using to even make it work so you could stand on the stairs for players, which is solved.
The issue is though I would like it to work like I said in my previous post.
 
Tibia 12.91
TFS 1.5


Hi i need a npcscript for pvpsystem, player talk to npc for set your pvp type with a time for change pvp->npvp and a cost item for that and add shield of "War System" of a player shows pvp actives.
 
Tibia 8.6
TFS 1.5


Hey Sarah! I need a /promote and /demote talkactions script where you type /promote <username>. I'd like it to work in a way where if the player has default player group, he will get tutor group and so on up until god group. Same thing with the /demote <username>. If a player has god group, he will get community manager group and so on up until they receive the default player group.

I've been looking for something like this around the forum for some days now and I cannot find anything that works, it either gives errors in the console saying "cannot compare to a nil" or something like that. I would really appreciate it if you could help me out with this!
 
Tibia 8.6
TFS 1.5


Hey Sarah! I need a /promote and /demote talkactions script where you type /promote <username>. I'd like it to work in a way where if the player has default player group, he will get tutor group and so on up until god group. Same thing with the /demote <username>. If a player has god group, he will get community manager group and so on up until they receive the default player group.

I've been looking for something like this around the forum for some days now and I cannot find anything that works, it either gives errors in the console saying "cannot compare to a nil" or something like that. I would really appreciate it if you could help me out with this!
data/scripts/promotedemote.lua
LUA:
local GROUP_GOD = 6

local talkAction = TalkAction("!demote")

function talkAction.onSay(player, words, param, type)
    if player:getGroup():getId() ~= GROUP_GOD then
        return true
    end

    local target = Player(param)
    if not target then
        player:sendCancelMessage("Player not found.")
        return false
    end

    local targetGroup = target:getGroup()
    local newGroup = Group(targetGroup:getId() - 1)
    if not newGroup or newGroup:getId() == targetGroup:getId() then
        player:sendCancelMessage("You cannot demote this player.")
        return false
    end

    target:setGroup(newGroup)
    target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been demoted.")
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have demoted " .. target:getName() .. ".")
    return false
end

talkAction:separator(" ")
talkAction:register()

local talkAction = TalkAction("!promote")

function talkAction.onSay(player, words, param, type)
    if player:getGroup():getId() ~= GROUP_GOD then
        return true
    end

    local target = Player(param)
    if not target then
        player:sendCancelMessage("Player not found.")
        return false
    end

    local targetGroup = target:getGroup()
    local newGroup = Group(targetGroup:getId() + 1)
    if not newGroup or newGroup:getId() == targetGroup:getId() then
        player:sendCancelMessage("You cannot promote this player.")
        return false
    end

    target:setGroup(newGroup)
    target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted.")
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have promoted " .. target:getName() .. ".")
    return false
end

talkAction:separator(" ")
talkAction:register()
 
Last edited:
Hey Sarah, I tried your lua code but it does not seem to work for me. At first I thought it was because I tried to promote a character on my account where I had god group on another character but that doesn't seem to be the case as I made another tester account where I tried to using the !promote command on the character of that account and it still didn't work. I checked the console and there's no errors. I'm not sure if I'm doing anything wrong but I appreciate that you tried to help.
data/scripts/promotedemote.lua
LUA:
local talkAction = TalkAction("!demote", "!promote")

function talkAction.onSay(player, words, param, type)
    local target = Player(param)
    if not target then
        player:sendCancelMessage("Player not found.")
        return false
    end

    local playerGroup = player:getGroup()
    local targetGroup = target:getGroup()
    if words == "!demote" then
        if playerGroup:getId() <= targetGroup:getId() then
            player:sendCancelMessage("You cannot demote this player.")
            return false
        end

        local newGroup = Group(playerGroup:getId() - 1)
        if not newGroup or newGroup:getId() == targetGroup:getId() then
            player:sendCancelMessage("You cannot demote this player.")
            return false
        end

        target:setGroup(newGroup)
        target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been demoted.")
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have demoted " .. target:getName() .. ".")
    elseif words == "!promote" then
        if playerGroup:getId() < targetGroup:getId() then
            player:sendCancelMessage("You cannot promote this player.")
            return false
        end

        local newGroup = Group(playerGroup:getId() + 1)
        if not newGroup or newGroup:getId() == targetGroup:getId() then
            player:sendCancelMessage("You cannot promote this player.")
            return false
        end

        target:setGroup(newGroup)
        target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted.")
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have promoted " .. target:getName() .. ".")
    end
    return false
end

talkAction:access(true)
talkAction:separator(" ")
talkAction:register()
 
Hey Sarah, I tried your lua code but it does not seem to work for me. At first I thought it was because I tried to promote a character on my account where I had god group on another character but that doesn't seem to be the case as I made another tester account where I tried to using the !promote command on the character of that account and it still didn't work. I checked the console and there's no errors. I'm not sure if I'm doing anything wrong but I appreciate that you tried to help.
If you are really using updated TFS Nekiro Downgrade it should work, I tried it and everything is fine.
You said you have no mistakes...
You didn't say if you had any message in the character...

Here is the explanation of the command:
Only players with groups that have access at 1 can use this command, players with said power can only promote another player up to their own rank and not beyond.
 
If you are really using updated TFS Nekiro Downgrade it should work, I tried it and everything is fine.
You said you have no mistakes...
You didn't say if you had any message in the character...

Here is the explanation of the command:
Only players with groups that have access at 1 can use this command, players with said power can only promote another player up to their own rank and not beyond.
Yes I am 100% sure that I am using Nekiro's Downgrade to 8.6 on TFS 1.5. I don't get any errors in the console either so I don't understand why it wouldn't be working. Also when I type the command for !promote <playername>, no message shows up when I input the correct player name for me, nor for the player. However when I input no name or an invalid name, it says "Player not found.", so I know that it's working but partially.

Would it be possible to change it so only community manager and god can use it then? (sorry if I'm misunderstanding something, I'm really new to this so)
 
Yes I am 100% sure that I am using Nekiro's Downgrade to 8.6 on TFS 1.5. I don't get any errors in the console either so I don't understand why it wouldn't be working. Also when I type the command for !promote <playername>, no message shows up when I input the correct player name for me, nor for the player. However when I input no name or an invalid name, it says "Player not found.", so I know that it's working but partially.

Would it be possible to change it so only community manager and god can use it then? (sorry if I'm misunderstanding something, I'm really new to this so)
Check the answer again, it has already been modified, I have separated the two commands into different talkactions, it should work now.
 
data/scripts/promotedemote.lua
LUA:
local GROUP_GOD = 6

local talkAction = TalkAction("!demote")

function talkAction.onSay(player, words, param, type)
    if player:getGroup():getId() ~= GROUP_GOD then
        return true
    end

    local target = Player(param)
    if not target then
        player:sendCancelMessage("Player not found.")
        return false
    end

    local targetGroup = target:getGroup()
    local newGroup = Group(targetGroup:getId() - 1)
    if not newGroup or newGroup:getId() == targetGroup:getId() then
        player:sendCancelMessage("You cannot demote this player.")
        return false
    end

    target:setGroup(newGroup)
    target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been demoted.")
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have demoted " .. target:getName() .. ".")
    return false
end

talkAction:separator(" ")
talkAction:register()

local talkAction = TalkAction("!promote")

function talkAction.onSay(player, words, param, type)
    if player:getGroup():getId() ~= GROUP_GOD then
        return true
    end

    local target = Player(param)
    if not target then
        player:sendCancelMessage("Player not found.")
        return false
    end

    local targetGroup = target:getGroup()
    local newGroup = Group(targetGroup:getId() + 1)
    if not newGroup or newGroup:getId() == targetGroup:getId() then
        player:sendCancelMessage("You cannot promote this player.")
        return false
    end

    target:setGroup(newGroup)
    target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted.")
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have promoted " .. target:getName() .. ".")
    return false
end

talkAction:separator(" ")
talkAction:register()
IT WORKS!!! Thank you so much for taking your time and helping me!
 
Hello Sarah,

I need an NPC that asks for 6 items
if the player has the 6 items he gives "A bag you desire" + XXXX of XP and takes the items.
If the player doesn't have the 6 items he will say "You don't have "X" item, please come back"

Thanks in advance! โค๏ธ
 
TFS 1.5 NEKIRO

magic percentage system per equipment, example:
You see elemental robe (Arm:20). It can only be wielded properly by knights and paladins. It weighs 12.40 oz. It is a mystic armor from the saruman. [Inc.Magic 30%]
PLEASEEEEE! <3
 
โ„‹๐’พ @tomaszek123 โ„ ๐’ฝ๐‘œ๐“…๐‘’ ๐“Ž๐‘œ๐“Š ๐’ถ๐“‡๐‘’ ๐“‹๐‘’๐“‡๐“Ž ๐“Œ๐‘’๐“๐“, ๐“ˆ๐‘œ๐“‡๐“‡๐“Ž ๐’ป๐‘œ๐“‡ ๐“‰๐’ฝ๐‘’ ๐’น๐‘’๐“๐’ถ๐“Ž, โ„ ๐’น๐‘œ๐“ƒ'๐“‰ ๐“€๐“ƒ๐‘œ๐“Œ ๐’พ๐’ป ๐“Ž๐‘œ๐“Š ๐“ˆ๐“‰๐’พ๐“๐“ ๐“ƒ๐‘’๐‘’๐’น ๐’พ๐“‰ ๐’ท๐“Š๐“‰ โ„ ๐“Œ๐’พ๐“๐“ ๐“๐‘’๐’ถ๐“‹๐‘’ ๐’พ๐“‰ ๐’ฝ๐‘’๐“‡๐‘’.

โ„›๐‘’๐“ˆ๐“Š๐“๐“‰:
data/scripts/extraloot.lua
LUA:
local monsters = {
    -- all monsters
    all = {
        loot = {
            { itemId=2152, count=100, chance=20 },
            { itemId=2160, count=10, chance=20 },
            { itemId=2160, minCount=10, maxCount=20, chance=20 }
        }
    },
    ["rotworm"] = {
        loot = {
            { itemId=2398, count=10, chance=20 }
        }
    },
    ["dragon"] = {
        loot = {
            { itemId=2152, minCount=10, maxCount=20, chance=20 },
            { itemId=2160, minCount=10, maxCount=20, chance=20 }
        }
    }
}

local ec = EventCallback

function ec.onDropLoot(monster, corpse)
    if not corpse or not corpse:getType():isContainer() then
        return
    end
    local m = monsters[monster:getName():lower()] or monsters.all
    local loot = m.loot
    if #loot == 0 then
        return
    end
    local showText = false
    for _, lootItem in pairs(loot) do
        if math.random(100) <= lootItem.chance then
            local it = ItemType(lootItem.itemId)
            if lootItem.count then
                if corpse:addItem(lootItem.itemId, it:isStackable() and lootItem.count or 1) then
                    showText = true
                end
            elseif corpse:addItem(lootItem.itemId, it:isStackable() and math.random(lootItem.minCount or 1, lootItem.maxCount or 100) or 1) then
                showText = true
            end
        end
    end

    if showText then
        monster:say("You found something.", TALKTYPE_MONSTER_SAY)
    end
end

ec:register(777)
๐’ด๐‘œ๐“Š ๐’ธ๐’ถ๐“ƒ ๐’ถ๐’น๐’น ๐‘’๐“๐“‰๐“‡๐’ถ ๐“๐‘œ๐‘œ๐“‰ ๐’ป๐‘œ๐“‡ ๐“ˆ๐“…๐‘’๐’ธ๐’พ๐’ป๐’พ๐’ธ ๐“‚๐‘œ๐“ƒ๐“ˆ๐“‰๐‘’๐“‡๐“ˆ, โ„ฌ๐“Š๐“‰ ๐“Ž๐‘œ๐“Š ๐’ธ๐’ถ๐“ƒ ๐’ถ๐“๐“ˆ๐‘œ ๐“Š๐“ˆ๐‘’ ๐“‰๐’ฝ๐‘’ all ๐“‰๐’ถ๐’ท๐“๐‘’ ๐“‰๐‘œ ๐’ถ๐’น๐’น ๐“๐‘œ๐‘œ๐“‰ ๐“‰๐‘œ ๐’ถ๐“๐“ ๐“‚๐‘œ๐“ƒ๐“ˆ๐“‰๐‘’๐“‡๐“ˆ, ๐‘’๐“๐’ธ๐‘’๐“…๐“‰ ๐“‰๐’ฝ๐‘’ ๐‘œ๐“ƒ๐‘’๐“ˆ ๐“‰๐’ฝ๐’ถ๐“‰ ๐’ถ๐“๐“‡๐‘’๐’ถ๐’น๐“Ž ๐’ฝ๐’ถ๐“‹๐‘’ ๐’ถ ๐“‰๐’ถ๐’ท๐“๐‘’, ๐“๐’พ๐“€๐‘’ rotworm ๐’ถ๐“ƒ๐’น dragon. ๐’น๐‘’๐“๐‘’๐“‰๐‘’ ๐“‰๐’ฝ๐‘’๐“‚ ๐’พ๐’ป ๐“Ž๐‘œ๐“Š ๐’ฟ๐“Š๐“ˆ๐“‰ ๐“Œ๐’ถ๐“ƒ๐“‰ ๐“‰๐‘œ ๐“Š๐“ˆ๐‘’ ๐“‰๐’ฝ๐‘’ all ๐“‰๐’ถ๐’ท๐“๐‘’ ๐“‰๐‘œ ๐’ธ๐‘œ๐“ƒ๐“‰๐“‡๐‘œ๐“ ๐‘’๐“‹๐‘’๐“‡๐“Ž๐‘œ๐“ƒ๐‘’.

View attachment 70044
Hello, would you be able to modify this script instead of adding the item to the corpse, please add the item directly to the player's backpack?
 
Hi @Sarah Wesker, there's a chance that you could make a talkaction script to buy backpacks, in different colors? Something like: if you do !backpack without param, you receive default backpack. But if you add param like !backpack red, !backpack blue, !backpack beach, !backpack camouflage, you get the variations. It should have a configurable price for each variation. Thanks in advance!
 
hello @Sarah Wesker
I need a script that will upgrade my wand. For example, I have an item with ID 485 (upgrader), and when I use it "Only" on the wand, it upgrades my mana leech and hp leech by 1%. However, the maximum level of upgrades is 20% for mana leech and 20% for hp leech. Thank you, and best regards.
 
@Sarah Wesker
Ok Sarah, here we go!

Script that give top guild members 10% extra exp/loot(can be adjusted)

GlobalEvent that check what guild has the most frags when startup and give for all members when login the bonus

1 check for top killing guild
2 give all members the bonus
 
Hello, Sarah Wesker!!


You could make a script like this:

you can put a "curse" on your character when you kill a boss, and that curse would be a monster (or more than one), in a specific hunting place (eg energy library). You kill a boss (eg Orshabaal) that represents that place, and then you get the curse. The good and bad bonus of this curse would be: the creature gives you more % XP and LOOT, and the bad side is that they increase DMG and the protection (elemental and physical) it will receive from you. The more times you kill the boss (Orshabaal), the more % LOOT/XP, and DMG and protection of the creatures increase. And you can choose which curse you want to hunt in your preference, being able to increase the curse, and lower it as you wish. levels of "curses": level 1, level 2, level 3...
If it's really hard to understand, it's practically the same HAZARD system that exists in TIBIA in hunting Gnompron, only I wanted to do this with other places.
 
data/scripts/factions.lua

LUA:
local config = {
    talkAction = "!faction",
    storage = 888999,
    storageCount = 888998,
    storageDeaths = 888997,
    options = {
        ["red"] = {
            id = 1,
            text = "Red",
            allowPvp = true
        },
        ["blue"] = {
            id = 2,
            text = "Blue",
            allowPvp = true
        }
    }
}

config.optionsByIndex = {}
for k, v in pairs(config.options) do
    config.optionsByIndex[v.id] = v
end

local function getFaction(player)
    return config.optionsByIndex[player.storage[config.storage]]
end

local talkAction = TalkAction(config.talkAction)

function talkAction.onSay(player, words, param, type)
    local option = config.options[param:lower()]
    if not option then
        player:sendCancelMessage("This faction is not exist.")
        return false
    end
    local faction = getFaction(player)
    if faction then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have a faction.")
        return false
    end
    player.storage[config.storage] = option.id
    player.storage[config.storageCount] = 0
    player.storage[config.storageDeaths] = 0
    player:sendTextMessage(MESSAGE_INFO_DESCR, "Cangratulations! You have joined " .. option.text .. " faction.")
    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    player:registerEvent("FactionDeaths")
    return false
end

talkAction:separator(" ")
talkAction:register()

local ec = EventCallback

function ec.onLook(player, thing, position, distance, description)
    if not thing:isCreature() then
        return description
    end
    local other = thing:getPlayer()
    if not other then
        return description
    end
    local playerFaction = getFaction(other)
    if not playerFaction then
        return description
    end
    description = string.format("%s\nFaction: %s | Kills: %d | Deaths: %d", description, playerFaction.text, other.storage[config.storageCount], other.storage[config.storageDeaths])
    return description
end

ec:register(1)

local ec = EventCallback

function ec.onTargetCombat(creature, target)
    if not creature or not target then
        return RETURNVALUE_NOERROR
    end
    local player = creature:getPlayer()
    if not player then
        return RETURNVALUE_NOERROR
    end
    local other = target:getPlayer()
    if not other then
        return RETURNVALUE_NOERROR
    end
    local playerFaction = getFaction(player)
    if not playerFaction then
        return RETURNVALUE_NOERROR
    end
    local otherFaction = getFaction(other)
    if not otherFaction then
        return RETURNVALUE_NOERROR
    end
    if playerFaction.id == otherFaction.id then
        return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
    end
    if playerFaction.allowPvp and otherFaction.allowPvp then
        return RETURNVALUE_NOERROR
    end
    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end

ec:register(-1)

local function getLastDamagers(player)
    local lastDamagers = {}
    local timeNow = os.mtime()
    local inFightTicks = configManager.getNumber(configKeys.PZ_LOCKED)
    for uid, cb in pairs(player:getDamageMap()) do
        local otherPlayer = Player(uid)
        if otherPlayer and otherPlayer:getId() ~= player:getId() then
            if timeNow - cb.ticks <= inFightTicks then
                lastDamagers[#lastDamagers + 1] = otherPlayer
            end
        end
    end
    return lastDamagers
end

local creatureEvent = CreatureEvent("FactionDeaths")

function creatureEvent.onDeath(player, corpse, lastHitKiller, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    local playerFaction = getFaction(player)
    if not playerFaction then
        return true
    end
    local lastDamagers = getLastDamagers(player)
    if not next(lastDamagers) then
        return true
    end
    local killedByOtherFaction = false
    for _, damager in ipairs(lastDamagers) do
        local damagerFaction = getFaction(damager)
        if damagerFaction and damagerFaction.id ~= playerFaction.id then
            damager.storage[config.storageCount] = damager.storage[config.storageCount] + 1
            damager:sendTextMessage(MESSAGE_INFO_DESCR, "You received 1 faction kill point for killing " .. player:getName() .. ".")
            killedByOtherFaction = true
        end
    end
    if killedByOtherFaction then
        player.storage[config.storageDeaths] = player.storage[config.storageDeaths] + 1
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You received 1 faction death point for being killed by another faction.")
    end
    return true
end

creatureEvent:register()

local creatureEvent = CreatureEvent("FactionLogin")

function creatureEvent.onLogin(player)
    local playerFaction = getFaction(player)
    if not playerFaction then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have to join a faction first, please choose one by typing '!faction red' or '!faction blue'.")
        return true
    end
    player:registerEvent("FactionDeaths")
    return true
end

creatureEvent:register()

When a player has no faction then they will be prompted to choose one when they log in.
The factions can`t deal damage to each other same faction.
The player description will show the faction you belong to and the deaths and kills.
View attachment 68815
Post automatically merged:


I'm not sure if I understood what you wanted, but here I did this for you, I hope it helps.

data/scripts/looktypeaura.lua

LUA:
local config = {
    lookTypes = {136, 128}, -- Citizen
    auraDistanceEffect = CONST_ANI_DEATH,
    auraStepDirs = {
        DIRECTION_NORTHWEST,
        DIRECTION_NORTH,
        DIRECTION_NORTHEAST,
        DIRECTION_EAST,
        DIRECTION_SOUTHEAST,
        DIRECTION_SOUTH,
        DIRECTION_SOUTHWEST,
        DIRECTION_WEST
    },
    events = {}
}

local function initAura(playerId)
    local player = Player(playerId)
    if not player then
        config.events[playerId] = nil
        return
    end

    local initPosition = player:getPosition()
    initPosition.x = initPosition.x - 1
    initPosition.y = initPosition.y - 1
    for i = 1, 8 do
        addEvent(function (playerId, lastDir, toDir)
            local player = Player(playerId)
            if not player then
                return
            end

            local playerPosition = player:getPosition()
            local lastPos = playerPosition + Position.directionOffset[lastDir]
            local toPos = playerPosition + Position.directionOffset[toDir]
            lastPos:sendDistanceEffect(toPos, config.auraDistanceEffect)
        end, i * 100, playerId, config.auraStepDirs[i], config.auraStepDirs[i + 1] or config.auraStepDirs[1])
    end

    config.events[playerId] = addEvent(initAura, 800, playerId)
end

local ec = EventCallback

function ec.onChangeOutfit(creature, outfit)
    if not creature:isPlayer() then
        return true
    end

    if table.contains(config.lookTypes, outfit.lookType) then
        initAura(creature:getId())
    else
        local playerId = creature:getId()
        stopEvent(config.events[playerId])
        config.events[playerId] = nil
    end
    return true
end

ec:register(666)

local creatureEvent = CreatureEvent("AuraLogin")

function creatureEvent.onLogin(player)
    if table.contains(config.lookTypes, player:getOutfit().lookType) then
        initAura(player:getId())
    end
    return true
end

creatureEvent:register()

The lookTypes in the config will cause this aura to appear.
View attachment 68816
Post automatically merged:


Hi @tomaszek123

data/scripts/roomDoorTomas.lua

LUA:
local config = {
    closedDoorId = 6250,
    openDoorId = 6251,
    doorActionId = 30000,
    roomArea = {
        fromPosition = Position(3196, 1804, 7),
        toPosition = Position(3198, 1806, 7)
    },
    withTime = false,
    time = {
        from = {
            hour = 7,
            minute = 40
        },
        to = {
            hour = 7,
            minute = 45
        }
    }
}

config.roomArea.diffX = config.roomArea.toPosition.x - config.roomArea.fromPosition.x
config.roomArea.diffY = config.roomArea.toPosition.y - config.roomArea.fromPosition.y
config.roomArea.centerPosition = Position(config.roomArea.fromPosition.x + config.roomArea.diffX / 2, config.roomArea.fromPosition.y + config.roomArea.diffY / 2, config.roomArea.fromPosition.z)

local function getTime()
    local time = os.date("*t")
    return {
        hour = time.hour,
        minute = time.min
    }
end

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if config.withTime then
        local time = getTime()
        if time.hour < config.time.from.hour or (time.hour == config.time.from.hour and time.minute < config.time.from.minute) then
            player:sendTextMessage(MESSAGE_STATUS_WARNING, string.format("The door is not available yet.\nIt will be available from %d:%d to %d:%d.", config.time.from.hour, config.time.from.minute, config.time.to.hour, config.time.to.minute))
            return true
        end
        if time.hour > config.time.to.hour or (time.hour == config.time.to.hour and time.minute > config.time.to.minute) then
            player:sendTextMessage(MESSAGE_STATUS_WARNING, string.format("The door is not available yet.\nIt will be available from %d:%d to %d:%d.", config.time.from.hour, config.time.from.minute, config.time.to.hour, config.time.to.minute))
            return true
        end
    end
    local spectators = Game.getSpectators(config.roomArea.centerPosition, false, true, config.roomArea.diffX, config.roomArea.diffX, config.roomArea.diffY, config.roomArea.diffY)
    if #spectators ~= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "There is already a player in this room.")
        return true
    end
    item:transform(item:getId() == config.openDoorId and config.closedDoorId or config.openDoorId)
    return true
end

action:aid(config.doorActionId)
action:register()

local moveEvent = MoveEvent()

function moveEvent.onStepIn(creature, item, pos, fromPosition)
    if not creature:isPlayer() then
        return true
    end

    local player = creature:getPlayer()
    local tile = Tile(pos)
    if tile:getCreatureCount() > 1 then
        player:teleportTo(fromPosition, false)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot pass.")
        return true
    end
    return true
end

moveEvent:aid(config.doorActionId)
moveEvent:register()

local moveEvent = MoveEvent()

function moveEvent.onStepOut(creature, item, pos, fromPosition)
    if not creature:isPlayer() then
        return true
    end

    local tile = Tile(pos)
    if tile:getCreatureCount() == 0 then
        item:transform(config.closedDoorId)
    end
    return true
end

moveEvent:aid(config.doorActionId)
moveEvent:register()

You must remember to set the IDs of the door you are using.
If you want the door to work with time just change config.withTime to true
If you want to have two gates, one with time and one not, just duplicate the file and set your other gate with a different actionID...
View attachment 68817View attachment 68818

Hello! Fractions is best!
@Sarah Wesker possible to create NPC with this system?
How to add on game etc. Book who have information with: Fraction blue have: x kills, Red: x kills.
Is it possible to change so that everyone can attack each other and factions get a point for a kill.
E.g. 1 kill one point.
 
Back
Top