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

🎃 Hallowen Tile 🎃

Sarah Wesker

ƐƖєgαηт Sуηтαx ❤
Staff member
TFS Developer
Support Team
Joined
Mar 16, 2017
Messages
1,402
Solutions
154
Reaction score
1,950
Location
London
GitHub
MillhioreBT
Twitch
millhiorebt
This is a simple revscript that dresses the player with a lookType of some random monster when he steps on a tile with a specific action id or failing that a specific position.

Available for TFS 1.x+ and Canary.

hallowen_random_outfit.lua
Lua:
local config = {
    actionId = 8000,
    positions = {}
}

local lookTypes = {
    318, 231, 152, 131, 223, 611, 235, 242, 97, 226, 99, 240, 277, 284, 11, 237,
 60, 53, 151, 26, 14, 206, 55, 137, 297, 244, 133, 8, 192, 304, 118, 264,
 228, 4, 306, 112, 129, 257, 346, 290, 254, 71, 52, 73, 90, 13, 311, 22, 276,
 106, 249, 225, 56, 282, 50, 76, 317, 227, 37, 21, 245, 101, 301, 67, 45, 261,
 98, 35, 108, 103, 320, 82, 285, 272, 250, 296, 49, 80, 93, 47, 63, 81, 61, 116,
 258, 234, 222, 5, 251, 34, 32, 298, 3, 59, 295, 243, 199, 111, 307, 253, 115,
 128, 74, 29, 305, 42, 44, 241, 66, 25, 312, 6, 139, 308, 200, 20, 68, 120, 315,
 134, 104, 15, 130, 64, 229, 316, 124, 18, 69, 2, 94, 219, 326, 10, 239, 291,
 27, 23, 12, 263, 286, 110, 95, 323, 209, 281, 197, 274, 125, 46, 122, 238, 113,
 208, 224, 260, 236, 48, 205, 230, 210, 283, 275, 70, 58, 100, 287, 7, 196, 87,
 247, 218, 194, 153, 193, 217, 215, 265, 221, 30, 300, 204, 19, 201, 28, 212,
 33, 262, 146, 117, 39, 220, 51, 43, 143, 123, 96, 41, 256, 77, 72, 149, 259,
 213, 36, 214, 114, 211, 321, 92, 83, 232, 38, 195, 31, 79, 65, 119, 233, 322,
 246, 78, 299, 313, 54, 109, 17, 62, 24, 203, 198, 202, 102, 271, 255, 216, 310,
 248, 105, 40, 16, 294, 155, 314, 57, 121, 293, 9, 280, 330
}

local hallowenTile = MoveEvent()

function hallowenTile.onStepIn(creature, item, pos, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local outfit = player:getOutfit()
    local lookType = lookTypes[math.random(#lookTypes)]
    outfit.lookType = lookType
    player:setOutfit(outfit)
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    return true
end

if config.actionId ~= 0 then
    hallowenTile:aid(config.actionId)
end

if #config.positions ~= 0 then
    hallowenTile:position(unpack(config.positions))
end

hallowenTile:register()

hout.gif
 
This is a simple revscript that dresses the player with a lookType of some random monster when he steps on a tile with a specific action id or failing that a specific position.

Available for TFS 1.x+ and Canary.

hallowen_random_outfit.lua
Lua:
local config = {
    actionId = 8000,
    positions = {}
}

local lookTypes = {
    318, 231, 152, 131, 223, 611, 235, 242, 97, 226, 99, 240, 277, 284, 11, 237,
 60, 53, 151, 26, 14, 206, 55, 137, 297, 244, 133, 8, 192, 304, 118, 264,
 228, 4, 306, 112, 129, 257, 346, 290, 254, 71, 52, 73, 90, 13, 311, 22, 276,
 106, 249, 225, 56, 282, 50, 76, 317, 227, 37, 21, 245, 101, 301, 67, 45, 261,
 98, 35, 108, 103, 320, 82, 285, 272, 250, 296, 49, 80, 93, 47, 63, 81, 61, 116,
 258, 234, 222, 5, 251, 34, 32, 298, 3, 59, 295, 243, 199, 111, 307, 253, 115,
 128, 74, 29, 305, 42, 44, 241, 66, 25, 312, 6, 139, 308, 200, 20, 68, 120, 315,
 134, 104, 15, 130, 64, 229, 316, 124, 18, 69, 2, 94, 219, 326, 10, 239, 291,
 27, 23, 12, 263, 286, 110, 95, 323, 209, 281, 197, 274, 125, 46, 122, 238, 113,
 208, 224, 260, 236, 48, 205, 230, 210, 283, 275, 70, 58, 100, 287, 7, 196, 87,
 247, 218, 194, 153, 193, 217, 215, 265, 221, 30, 300, 204, 19, 201, 28, 212,
 33, 262, 146, 117, 39, 220, 51, 43, 143, 123, 96, 41, 256, 77, 72, 149, 259,
 213, 36, 214, 114, 211, 321, 92, 83, 232, 38, 195, 31, 79, 65, 119, 233, 322,
 246, 78, 299, 313, 54, 109, 17, 62, 24, 203, 198, 202, 102, 271, 255, 216, 310,
 248, 105, 40, 16, 294, 155, 314, 57, 121, 293, 9, 280, 330
}

local hallowenTile = MoveEvent()

function hallowenTile.onStepIn(creature, item, pos, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local outfit = player:getOutfit()
    local lookType = lookTypes[math.random(#lookTypes)]
    outfit.lookType = lookType
    player:setOutfit(outfit)
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
    return true
end

if config.actionId ~= 0 then
    hallowenTile:aid(config.actionId)
end

if #config.positions ~= 0 then
    hallowenTile:position(unpack(config.positions))
end

hallowenTile:register()

View attachment 78600
This script works for Canary, thanks anyway ;)

Lua:
local halloweenTile = MoveEvent()

local lookTypes = {
    318, 231, 152, 131, 223, 611, 235, 242, 97, 226, 99, 240, 277, 284, 11, 237,
    60, 53, 151, 26, 14, 206, 55, 137, 297, 244, 133, 8, 192, 304, 118, 264,
    228, 4, 306, 112, 129, 257, 346, 290, 254, 71, 52, 73, 90, 13, 311, 22, 276,
    106, 249, 225, 56, 282, 50, 76, 317, 227, 37, 21, 245, 101, 301, 67, 45, 261,
    98, 35, 108, 103, 320, 82, 285, 272, 250, 296, 49, 80, 93, 47, 63, 81, 61, 116,
    258, 234, 222, 5, 251, 34, 32, 298, 3, 59, 295, 243, 199, 111, 307, 253, 115,
    128, 74, 29, 305, 42, 44, 241, 66, 25, 312, 6, 139, 308, 200, 20, 68, 120, 315,
    134, 104, 15, 130, 64, 229, 316, 124, 18, 69, 2, 94, 219, 326, 10, 239, 291,
    27, 23, 12, 263, 286, 110, 95, 323, 209, 281, 197, 274, 125, 46, 122, 238, 113,
    208, 224, 260, 236, 48, 205, 230, 210, 283, 275, 70, 58, 100, 287, 7, 196, 87,
    247, 218, 194, 153, 193, 217, 215, 265, 221, 30, 300, 204, 19, 201, 28, 212,
    33, 262, 146, 117, 39, 220, 51, 43, 143, 123, 96, 41, 256, 77, 72, 149, 259,
    213, 36, 214, 114, 211, 321, 92, 83, 232, 38, 195, 31, 79, 65, 119, 233, 322,
    246, 78, 299, 313, 54, 109, 17, 62, 24, 203, 198, 202, 102, 271, 255, 216, 310,
    248, 105, 40, 16, 294, 155, 314, 57, 121, 293, 9, 280, 330
}

function halloweenTile.onStepIn(creature, item, pos, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    player:teleportTo(fromPosition)
    player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)

    local lookType = lookTypes[math.random(#lookTypes)]

    local outfitCondition = Condition(CONDITION_OUTFIT)
    outfitCondition:setOutfit({ lookType = lookType })
    outfitCondition:setTicks(600 * 1000)
    player:addCondition(outfitCondition)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your outfit has been changed.")

    return true
end

halloweenTile:aid(8000)
halloweenTile:register()
client_LIFroKKdXb.gif
 
Last edited:
Back
Top