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

TFS 1.3+ addon doll

Mateus Robeerto

Excellent OT User
Joined
Jun 5, 2016
Messages
1,337
Solutions
71
Reaction score
697
Location
ლ(ಠ益ಠლ)
Most of the scripts that were posted didn't work or were buggy and couldn't add the addons, etc. I took the old script that works and adapted it for TFS 1.x, and now it's working fine!

How do I use it? Just type !addon mage and have the addon doll item ready.
Lua:
local outfits = {
    [0] = {
        ["citizen"] = 136,
        ["hunter"] = 137,
        ["mage"] = 138,
        ["knight"] = 139,
        ["nobleman"] = 140,
        ["summoner"] = 141,
        ["warrior"] = 142,
        ["barbarian"] = 147,
        ["druid"] = 148,
        ["wizard"] = 149,
        ["oriental"] = 150,
        ["pirate"] = 155,
        ["assassin"] = 156,
        ["beggar"] = 157,
        ["shaman"] = 158,
        ["norsewoman"] = 252,
        ["nightmare"] = 269,
        ["jester"] = 270,
        ["brotherhood"] = 279,
        ["demonhunter"] = 288,
        ["yalaharian"] = 324
    },
    [1] = {
        ["citizen"] = 128,
        ["hunter"] = 129,
        ["mage"] = 130,
        ["knight"] = 131,
        ["nobleman"] = 132,
        ["summoner"] = 133,
        ["warrior"] = 134,
        ["barbarian"] = 143,
        ["druid"] = 144,
        ["wizard"] = 145,
        ["oriental"] = 146,
        ["pirate"] = 151,
        ["assassin"] = 152,
        ["beggar"] = 153,
        ["shaman"] = 154,
        ["norsewoman"] = 251,
        ["nightmare"] = 268,
        ["jester"] = 273,
        ["brotherhood"] = 278,
        ["demonhunter"] = 289,
        ["yalaharian"] = 325
    }
}

local AddonDoll = talkaction("!addon")

local msg = {
    success = "Full addon set successfully added!",
    invalidParam = "Command requires a valid parameter.",
    hasAddons = "You already have the addons for this outfit.",
    needDoll = "You do not have an addon doll.",
    invalidOutfit = "You must put a valid outfit name."
}

function AddonDoll.onSay(player, words, param, type)
    local param = string.lower(param)

    if (param == "") then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, msg.invalidParam)
    end

    if (player:getItemCount(9693) == 0) then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, msg.needDoll)
    end

    local outfit = outfits[player:getSex()][param]
    if not outfit then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, msg.invalidOutfit)
    end

    if (player:hasOutfit(outfit, 3)) then
        return player:sendTextMessage(MESSAGE_INFO_DESCR, msg.hasAddons)
    end

    player:removeItem(9693, 1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, msg.success)
    player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
    player:addOutfitAddon(outfit, 3)
    return true
end


AddonDoll:separator(" ")
AddonDoll:register()
 
Back
Top