• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Action] + [MoveEvent] + [TalkAction]: Scripts for the public

xD I'am very noobish at lua/php/xml.. Would be nice if you quick explained what each script does, over/under the title of script.. :D
 


Reward Players Online

talkactions.xml
Code:
<talkaction log="yes" words="/reward" access="5" event="script" value="reward.lua"/>

talkactions/scripts/reward.lua
Code:
function onSay(cid, words, param, channel)   
        local t = string.explode(param, ",")
        local gm = getCreatureName(cid)
        for _, cid in ipairs(getPlayersOnline()) do
                local accId = getPlayerAccount(cid)
                if(getNotationsCount(accId) < 1) then
                    doPlayerAddItem(cid, t[1], 1)
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)                
                end
        end
        return TRUE
end


I will update it when I have more time. This is all you get for now. Credits to the creators of the scripts! I am just sorting them in one thread.



what do this script???

btw. Thanks for releasing :peace:
 
Hello...
i've a question about "Experience Stage Item"
how can do, if i want to use only "Premium Account"
and, can u explain me the formule for "Aditional Stage"?

rate = 1.6, -- 4x More Experience

if my server have 3x of rate, when i use this item i get aditional 1.6x rates or 4x? and WHY!
 
i dont get it

I dont get this with scripts. for example what is the experience table for? cant you edit those settings in lua?
 
I need the script of POI when I put the demon horn in the coal bassin and click this will teleported to other position.

11kwpc5.jpg

I'm here and when I press the demon horn inside the coal bassin, this teleported me to here:

2mph2l4.jpg



@Down:Spam by? LOL! Only need script :)
 
Last edited:
@Jeinersito

If you current exp is 3x then you get 30 exp from a snake, but when you use this item the xp will raise by 160% of your current exp. So, killign a anske after using the item will give you 48 exp.
 

Experience Stage Item
Christmas_Token.gif


action.xml
Code:
<action itemid="6527" event="script" value="donator/exp.lua"/>

action/scripts/exp.lua
Code:
local config = {
	rate = 1.6, -- 4x More Experience
	time = 5, -- Hours of Exp Time
	storage = 20012
}
local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, config.storage) < 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
		addEvent(endExpRate, config.time * 3600 * 1000, cid)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
	end
	return TRUE
end

creaturescripts.xml
Code:
<event type="login" name="expRate" event="script" value="extraExpRate.lua"/>

creaturescripts/scripts/extraExpRate.lua
Code:
local config = {
	rate = 1.6, -- 4x More Experience
	storage = 20012
}
local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onLogin(cid)
	local str = getPlayerStorageValue(cid, config.storage)
	if(str >= 0 and (str - os.time()) > 0) then
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your extra exp rate will expire at: " .. os.date("%X", str))
		addEvent(endExpRate, (str - os.time()) * 1000, cid)
	else
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You do not have any extra experience time.")
		setPlayerStorageValue(cid, config.storage, -1)
	end
	return TRUE
end


The exp stages are bugueds, are infinites :S
 
talkactions.xml
Code:
<talkaction log="yes" words="/reward" access="5" event="script" value="reward.lua"/>
talkactions/scripts/reward.lua
Code:
function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
local gm = getCreatureName(cid)
for _, cid in ipairs(getPlayersOnline()) do
local accId = getPlayerAccount(cid)
if(getNotationsCount(accId) < 1) then
doPlayerAddItem(cid, t[1], 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
end
end
return TRUE
end
what this reward?
 
Back
Top