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

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
Rep me if I helped you :)

Thanks to CyberM.

First we are going to add experience, ml and skills rate:

Goto to data/lib/050-function.lua

At the top add this:
Lua:
function doPlayerSetSkills(cid, value)
    for i = 0, 8 do
        doPlayerSetRate(cid, i, value)
    end
end

Now goto data/creaturescripts/login.lua

After:
Lua:
function onLogin(cid)

Add this:
Lua:
	if isPremium(cid) then
		doPlayerSetExperienceRate(cid, 1.5)
		doPlayerSetSkills(cid, 1.5)
		doPlayerSetMagicRate(cid, 1.5)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are premium, enjoy 50% extra experience, skills and magic level rates.")
	end

It should look like this:
Lua:
function onLogin(cid)
	if isPremium(cid) then
		doPlayerSetExperienceRate(cid, 1.5)
		doPlayerSetSkills(cid, 1.5)
		doPlayerSetMagicRate(cid, 1.5)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are premium, enjoy 50% extra experience, skills and magic level rates.")
	end

....

   return true
end

Where .... means the other parts of your script, and the return true and end are the closing tags of the login function.

PS: Change the (cid, 1.5) for the rate that you want, for example if you want 22 percent more, then put a 1.22 it should look like this (cid, 1.22).


Now we are going to add loot if it is premium:

Goto to your mods/ file and create a file called premiumloot.xml and add this inside:

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Premium Loot Rate" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">
	<event type="kill" name="plr" event="script"> <![CDATA[
local premRate = 7 -- loot rate for premium players
 
local rate = getConfigInfo('rateLoot') -- the normal rate, don't change
 
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 premRate 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, damage, flags)
	if isInArray({1,3}, flags) 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, isPremium(cid))
			end
			addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
		end
	end
	return true
end
	]]></event>
<event type="login" name="Premium Loot Rate" event="buffer"><![CDATA[
	registerCreatureEvent(cid, 'plr')
]]></event>
</mod>

Here you just have to modificate local premRate = 7 that seven for the new rate that you want.

Very simple, very nice, very effient.

PS: Tested on www.mtibia.cl using tfs 0.4 rev 3777 and works, if it doesn't work, then you are missing or doing something wrong.

Rep me if I helped you :)
 
Last edited:
Is work replacing this??
if isPremium(cid) then

for this
if isVIP(cid) then
or
if storage(x)(cid) then

PS: x = number
yeah, whichever is your custom VIP function
 
You can use also doPlayerSetMagicRate(cid, 1.5) to add magic rate... I would love if someone post a way of adding skill rates and loot rate.

Is work replacing this??
if isPremium(cid) then

for this
if isVIP(cid) then
or
if storage(x)(cid) then

PS: x = number

The isVIP(cid) you must check if you have that function.

The storage would be something like getPlayerStorageValue(cid, storage_to_check) ~= 1 or what ever you want.
 
Last edited by a moderator:
You can use also doPlayerSetMagicRate(cid, 1.5) to add magic rate... I would love if someone post a way of adding skill rates and loot rate.
:p both doPlayerSetMagicRate && doPlayerSetExperienceRate are customs function, which come from doPlayerSetRate :p :p take a look at your data/lib/050-function.lua :p
btw, skills:
Lua:
doPlayerSetRate(cid, SKILL_FIST, 1.00)
doPlayerSetRate(cid, SKILL_CLUB, 1.00)
doPlayerSetRate(cid, SKILL_SWORD, 1.00)
doPlayerSetRate(cid, SKILL_AXE, 1.00)
doPlayerSetRate(cid, SKILL_DISTANCE, 1.00)
doPlayerSetRate(cid, SKILL_SHIELD, 1.00)
doPlayerSetRate(cid, SKILL_FISHING, 1.00)
doPlayerSetRate(cid, SKILL__MAGLEVEL, 1.00)
doPlayerSetRate(cid, SKILL__LEVEL, 1.00)
 
@CyberM

So I could do a function with:

Lua:
function doPlayerSetSkills(cid, value)
        return doPlayerSetRate(cid, SKILL_FIST, value)
		return doPlayerSetRate(cid, SKILL_CLUB, value)
		return doPlayerSetRate(cid, SKILL_SWORD, value)
		return doPlayerSetRate(cid, SKILL_AXE, value)
		return doPlayerSetRate(cid, SKILL_DISTANCE, value)
		return doPlayerSetRate(cid, SKILL_SHIELD, value)
		return doPlayerSetRate(cid, SKILL_FISHING, value)
		return doPlayerSetRate(cid, SKILL__MAGLEVEL, value)
		return doPlayerSetRate(cid, SKILL__LEVEL, value)
end

I think it won't work cause there are lots of return, but how to do them all in one and make it works?
 
Lua:
function doPlayerSetSkills(cid, value)
    for i = 0, 8 do
        doPlayerSetRate(cid, i, value)
    end
end
 
Nop, Im planing to remove all my "vip/premium island" from my OT and just now give more rates to premium players, that's why I figured this out xD

PS: Could you make function to improve loot rate?
 
maybe you can take it from the cyko-collz loot ring that raises loot rate by x5:
XML:
<?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>
 
@CyberM

So I could do a function with:

Lua:
function doPlayerSetSkills(cid, skills, values)
if type(skills) == "table" then

end
		doPlayerSetRate(cid, SKILL_FIST, value)
		doPlayerSetRate(cid, SKILL_CLUB, value)
		doPlayerSetRate(cid, SKILL_SWORD, value)
		doPlayerSetRate(cid, SKILL_AXE, value)
		doPlayerSetRate(cid, SKILL_DISTANCE, value)
		doPlayerSetRate(cid, SKILL_SHIELD, value)
		doPlayerSetRate(cid, SKILL_FISHING, value)
		doPlayerSetRate(cid, SKILL__MAGLEVEL, value)
		doPlayerSetRate(cid, SKILL__LEVEL, value)
end

I think it won't work cause there are lots of return, but how to do them all in one and make it works?


This way i think is better:

Lua:
function doPlayerSetSkills(cid, value, skills)
local skills = skills or {
        SKILL_FIST,
	SKILL_CLUB,
	SKILL_SWORD,
	SKILL_AXE,
	SKILL_DISTANCE,
	SKILL_SHIELD,
	SKILL_FISHING,
	SKILL__MAGLEVEL,
	SKILL__LEVEL,
}

	if type(skills) == "table" and type(values) == "table" then
		for i = 1, #skills do
		doPlayerSetRate(cid, skills[i], value[i])
		end
	elseif type(skills) == "table" then
		for i = 1, #skills do
		doPlayerSetRate(cid, skills[i], value)
		end
	else
		doPlayerSetRate(cid, skills, value)
		return true
	end
return false
end


You can also do this:

Lua:
          doPlayerSetSkills(cid, {2, 3}, {SKILL_FIST, SKILL_CLUB,})
To the skill SKILL_FIST get value 2 and skill SKILL_CLUB get value 3

or

Lua:
          doPlayerSetSkills(cid, 5)
To all skill get value 5

or

Lua:
          doPlayerSetSkills(cid, 2, SKILL_FIST)
To skill SKILL_FIST get value 2
 
maybe you can take it from the cyko-collz loot ring that raises loot rate by x5:
XML:
<?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"> <=!=[=C=D=A=T=A=[
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"><=!=[=C=D=A=T=A=[
        registerCreatureEvent(cid, "lootring")
    ]=]=></event>
</mod>

I was seeing that script and is so big xD

It should have a function with all those lines and then you do a doPlayerSetLootRate(cid, 7) and that would be new rate, could that be possible?
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Premium Loot Rate" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">
	<event type="kill" name="plr" event="script"> <![CDATA[
local premRate = 7 -- loot rate for premium players

local rate = getConfigInfo('rateLoot') -- the normal rate, don't change

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 premRate 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, damage, flags)
	if isInArray({1,3}, flags) 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, isPremium(cid))
			end
			addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
		end
	end
	return true
end
	]]></event>
<event type="login" name="Premium Loot Rate" event="buffer"><![CDATA[
	registerCreatureEvent(cid, 'plr')
]]></event>
</mod>
 
Its possible configure this scripts to VIP? and exactly on this script http://otland.net/f163/best-vip-system-ever-action-movevent-globalevent-71638/

If anyone help me, I'll give rep++

@edit:

Maybe it should work?
if getPlayerVipDays(cid) >= 1 then
doPlayerSetExperienceRate(cid, 1.5)
doPlayerSetSkills(cid, 1.5)
doPlayerSetMagicRate(cid, 1.5)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are premium, enjoy 50% extra experience, skills and magic level rates.")
end

@edit2:

I tested it, and didn't work :/
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSetExperienceRate(cid, 1.5)
doPlayerSetSkills(cid, 1.5)
doPlayerSetMagicRate(cid, 1.5)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are VIP, enjoy 50% extra experience, skills and magic level rates.")
end

accountManager = "Account Manager"
managerCounter = 0

for i, player in ipairs(getOnlinePlayers()) do
if accountManager:lower() == player:lower() then
managerCounter = managerCounter + 1
end
end

if managerCounter >= 3 then
return false
end

But if I are Vip, when enter on one of Vip-Characters, It says: 09:38 You are VIP, enjoy 50% extra experience, skills and magic level rates.

To Kito2:

no se que es lo que le pasa al Script, pero detectarme me detecta los Vip days:
09:53 You are VIP, enjoy 50% extra experience, skills and magic level rates.

Pero pruebo matar un Rotworm y me da la misma Experiencia siendo VIP que no siendolo. Y los 2 chars tienen las mismas Stages.

@edit3:

This scripts didn't work... tested on 0.4 (I recive same Exp with Facc Account / Premium Account)

And on Login.lua
if isPremium(cid) then
doPlayerSetExperienceRate(cid, 1.5)
doPlayerSetSkills(cid, 1.5)
doPlayerSetMagicRate(cid, 1.5)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are VIP, enjoy 50% extra experience, skills and magic level rates.")
end
 
Last edited:
Yes it is possible, try it.

That's wear, I have it on my OT 0.4 (rev3777) and gives 15% extra experience.
 
Back
Top