• 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 Chest or anything else that gives you mounts as reward.

madnesstein

New Member
Joined
Nov 27, 2008
Messages
23
Reaction score
1
Hello, this is a little script to get a mount adding an action id to certain item...

Create a lua named mounts and paste this:
Lua:
--Madnesstein.-
local config = {

        [7000] = {                                     --Action ID
                name = "Widow Queen", 		-- Mount Name            
                mounts = 1,                -- Mount ID
                cost = 0,                   -- Cost (optional)
                items = {{5879,50}},        -- Items that you need to get the mount (item/amount)
        },
        [7001] = {
                name = "xxxxxx", 		-- Mount Name            
                mounts = x,                -- Mount ID
                cost = x,                   -- Cost (optional)
                items = {{xxxx,xx}},        -- Items that you need to get the mount (item/amount)
        },



} -------- Configuration End -------
local storage = 21000
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local mount, removeItems, removeMoney = config[item.actionid], 0, 0
         if getPlayerStorageValue(cid, storage + item.actionid) ~= 1 then
                if getPlayerMoney(cid) >= mount.cost then
                        removeMoney = 1
                end
                if #mount.items > 0 then
                        for i = 1, #mount.items do
                                if getPlayerItemCount(cid, mount.items[i][1]) >= mount.items[i][2] then
                                        removeItems = removeItems+1
                                end
                        end
                end
                if removeMoney == 1 and removeItems == #mount.items then
                        for i = 1, #mount.items do
                                doPlayerRemoveItem(cid, mount.items[i][1], mount.items[i][2])
                        end
                        doPlayerRemoveMoney(cid, mount.cost)
                        doPlayerAddMount(cid, mount.mounts)
                        setPlayerStorageValue(cid, storage + item.actionid, 1)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ahora podes usar el mount "..mount.name..".")
                else
                        if mount.cost ~= 0 then
                                msg = "Necesitas "..mount.cost.." gp y "
                        else
                                msg = "Necesitas "
                        end
                        if #mount.items > 0 then
                                for i = 1, #mount.items do
                                        msg = ""..msg..""..mount.items[i][2].."x "..getItemNameById(mount.items[i][1]).." "
                                end
                        end
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..msg.."para el mount "..mount.name..".")
                end
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ya tienes el mount "..mount.name..".")
        end
        return TRUE
end

In your actions.lua add this:
XML:
	<action actionid="7000-7001" event="script" value="other/mounts.lua"/>

You have to add the rest of the mounts, in this example to get the mount you need 50 spider silks...
To make it works just add the action id to some item and when you use it will take the items and gives you the mount or will send respective indications...

Tested on last Mystic Spirits...

Enjoy =) Sorry for my english >.<

Based on: http://otland.net/f81/addon-system-45899/
Edited by me :p
 
Last edited:
[18/08/2011 09:39:47] Warning: [Event::checkScript] Can not load script. /scripts/other/mounts.lua
[18/08/2011 09:39:47] data/actions/scripts/other/mounts.lua:8: unexpected symbol near ','
 
[18/08/2011 09:39:47] Warning: [Event::checkScript] Can not load script. /scripts/other/mounts.lua
[18/08/2011 09:39:47] data/actions/scripts/other/mounts.lua:8: unexpected symbol near ','

You screwed something in table.
 
Back
Top