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

TalkAction /Newtype command for 10.10

Frostie

Mapper/basic scripter (NL)
Joined
Feb 14, 2012
Messages
447
Reaction score
425
Location
Holland
The command /newtype for 10.10 with all new monster looktypes.
100 % without bugs.
Code:
local function checkType(value)
    return not (
        value <= 1 or 
        value == 135 or 
        (value > 160 and value < 192) or 
        value == 411 or 
        value == 415 or 
        value == 424 or 
        value == 439 or 
        value == 440 or 
        (value > 438 and value < 441) or 
        (value > 466 and value < 470) or
        value == 474 or 
        value == 485 or 
        value == 501 or 
        value == 543 or
        value == 549 or
        value == 574 or
        value == 524 or
        value == 525 or
        value == 536 or
        (value > 517 and value < 521) or 
        value >574    )
end

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    local t, pid = string.explode(param, ","), cid
    if(t[2]) then
        pid = getPlayerByNameWildcard(t[2])
        if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
            return true
        end
    end

    local period, tmp = -1, tonumber(t[3])
    if(t[3] and tmp) then
        period = tmp
    end

    if(not isNumeric(t[1])) then
        if(getMonsterInfo(t[1])) then
            doSetMonsterOutfit(pid, t[1], period)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.")
        end

        return true
    end

    t[1] = tonumber(t[1])
    if(not checkType(t[1])) then
        local item = getItemInfo(t[1])
        if(item) then
            doSetItemOutfit(pid, t[1], period)
            return true
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.")
        return true
    end

    local tmp = getCreatureOutfit(pid)
    tmp.lookType = t[1]

    if(t[3]) then
        t[3] = tonumber(t[3])
        if(checkType(t[3])) then
            tmp.lookMount = t[3]
        end
    end

    doCreatureChangeOutfit(pid, tmp)
    return true
end
 
Last edited:
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/newtype.lua:onSay
data/talkactions/scripts/newtype.lua:32: attempt to call field 'explode' (a nil
value)
stack traceback:
        [C]: in function 'explode'
        data/talkactions/scripts/newtype.lua:32: in function <data/talkactions/s
cripts/newtype.lua:26>
 
Back
Top