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

CreatureEvent If premium then 50% extra more experience, ml and skills rate and ++loot!

I tested on rev 3884, all lua its correct and dind't get extra exp with p.a
 
I have tested it with 2 accounts too, one premium, one free... same stages obiosly, and get same exp on premium acc that on free.

Check your script, and look if it same than your script... or need anything that you didn't put.
 
not its need an script? and need put in login ofther lines? (same like extra exp rate) \\\ I put your script on my ot and don't work :S fix it please >.<
 
I have tested it with 2 accounts too, one premium, one free... same stages obiosly, and get same exp on premium acc that on free.

Check your script, and look if it same than your script... or need anything that you didn't put.

not its need an script? and need put in login ofther lines? (same like extra exp rate) \\\ I put your script on my ot and don't work :S fix it please >.<

Im using tfs 0.4 rev 3777 and works great, remember to do a /reload creaturescripts and relog or just restart the OT.
 
So Kito2, can you post me our login.lua? and where you put the
function doPlayerSetSkills(cid, value)
for i = 0, 8 do
doPlayerSetRate(cid, i, value)
end
end

Check my 050-function.lua
function doPlayerSetSkills(cid, value)
for i = 0, 8 do
doPlayerSetRate(cid, i, value)
end
end


function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end

function doAddVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

function doRemoveVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
 
I dont really like the delete real loot and create new way
but without (probably)big source edit its only way
but wont it show 2 loot messages or something?
 
So Kito2, can you post me our login.lua? and where you put the


Check my 050-function.lua

The function is at 050-function.lua

I dont really like the delete real loot and create new way
but without (probably)big source edit its only way
but wont it show 2 loot messages or something?

I think, I haven't tested the loot part yet anyways.
 
Found a thing that could mess up all your extra rates, check that you have JUST ONE CONDITION using this function, or it wont work, for example if you have WOE and the rate of 20% extra exp, then it will mess up all your other rates.
 
Bug: All these scripts dropped a empty bag always!

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Loot Ring" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">
    <event type="kill" name="lootring" event="script"> <![CDATA[
local t = {
    item = 2179,
    slot = CONST_SLOT_RING,
    newRate = 5
}
 
local rate = getConfigInfo('rateLoot')
 
function getContentDescription(uid, comma)
    local ret, i, containers = '', 0, {}
    while i < getContainerSize(uid) do
        local v, s = getContainerItem(uid, i), ''
        local k = getItemInfo(v.itemid)
        if k.name ~= '' then
            if v.type > 1 and k.stackable and k.showCount then
                s = v.type .. ' ' .. getItemInfo(v.itemid).plural
            else
                local article = k.article
                s = (article == '' and '' or article .. ' ') .. k.name
            end
            ret = ret .. (i == 0 and not comma and '' or ', ') .. s
            if isContainer(v.uid) and getContainerSize(v.uid) > 0 then
                table.insert(containers, v.uid)
            end
        else
            ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
        end
        i = i + 1
    end
    for i = 1, #containers do
        ret = ret .. getContentDescription(containers[i], true)
    end
    return ret
end
 
local function send(cid, pos, corpseid, monster, party)
    local corpse = getTileItemById(pos, corpseid).uid
    local ret = isContainer(corpse) and getContentDescription(corpse)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))
    if party then
        for _, pid in ipairs(getPartyMembers(party)) do
            doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)
        end
    end
end
 
local function createLoot(i, ext)
    local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id
    local random = math.ceil(math.random(100000) / (ext and t.newRate or rate))
    local tmpItem
 
    if random < i.chance then
        tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)
    end
 
    if not tmpItem then
        return
    end
 
    if i.subType ~= -1 then
        doItemSetAttribute(tmpItem, 'subType', i.subType)
    end
 
    if i.actionId ~= -1 then
        doItemSetAttribute(tmpItem, 'aid', i.actionId)
    end
 
    if i.uniqueId ~= -1 then
        doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
    end
 
    if i.text ~= '' then
        doItemSetAttribute(tmpItem, 'text', i.text)
    end
 
    return tmpItem
end
 
local function createChildLoot(parent, i, ext)
    if #i == 0 then
        return true
    end
 
    local size, cap = 0, getContainerCap(parent)
    for k = 1, #i do
        if size == cap then
            break
        end
        local tmp = createLoot(i[k], ext)
        if tmp then
            if isContainer(tmp) then
                if createChildLoot(tmp, i[k].child, ext) then
                    doAddContainerItemEx(parent, tmp)
                    size = size + 1
                else
                    doRemoveItem(tmp)
                end
            else
                doAddContainerItemEx(parent, tmp)
                size = size + 1
            end
        end
    end
 
    return size > 0
end
 
local function dropLoot(pos, v, ext)
    local corpse = getTileItemById(pos, v.lookCorpse).uid
    if isContainer(corpse) then
        for i = 1, getContainerSize(corpse) do
            doRemoveItem(getContainerItem(corpse, 0).uid)
        end
        local size, cap = 0, getContainerCap(corpse)
        for i = 1, #v.loot do
            if size == cap then
                break
            end
            local tmp = createLoot(v.loot[i], ext)
            if tmp then
                if isContainer(tmp) then
                    if createChildLoot(tmp, v.loot[i].child, ext) then
                        doAddContainerItemEx(corpse, tmp)
                        size = size + 1
                    else
                        doRemoveItem(tmp)
                    end
                else
                    doAddContainerItemEx(corpse, tmp)
                    size = size + 1
                end
            end
        end
    end
end
 
function onKill(cid, target, lastHit)
    if lastHit and isMonster(target) then
        local v = getMonsterInfo(getCreatureName(target))
        if v.lookCorpse > 0 then
            local master = getCreatureMaster(target)
            if not master or master == target then
                addEvent(dropLoot, 0, getThingPos(target), v, getPlayerSlotItem(cid, t.slot).itemid == t.item)
            end
            addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
        end
    end
    return true
end
    ]]></event>
 <event type="login" name="Loot Ring" event="buffer"><![CDATA[
        registerCreatureEvent(cid, "lootring")
    ]]></event>
</mod>

Bug: All these scripts dropped a empty bag always!
HELP UPDATE for 0.4tfs
 
HOW I CAN DEGRADE MY FISHING SKILLS?
EXAMPLE:
doPlayerSetSkills(cid, 0.5)
IT NOT WORKS
I NEEd EDIT IN MY SOURCES ? WHAT?
PLEASE HELP ME
THANKS ;D
 
How do you know it doesn't work? If you put 0.5 then your skill will decrease in a 50%, just try this doPlayerSetSkills(cid, 0) and see how you wont make it raises.
 
I works really nice atleast for me, but its possible to add for example 20%+ loot rate, instead of a exact rate?
 
Guys, this script don't work on TFS 1.2, any solutions ? Thanks.
 
Back
Top