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

MoveEvent [Movement] Disco! [Fun Script]

Roman

New Member
Joined
Jun 6, 2008
Messages
16
Reaction score
0
Hello, today ive worked on another script that popped into my mind, I wanted to experiment with this function:
PHP:
doSetCreatureLight(cid, intensity, colour, time)
I learned how to use it and came up with the following:
Intensity can be set to 1-100 but I think it only works with 1-10.
Colours are the following:
PHP:
-- ***Basic colours
-- BLUE        = 5
-- RED         = 180
-- YELLOW      = 210

-- ***More colours
-- CRYSTAL     = 65
-- BROWN       = 78
-- PLATINUM    = 89
-- PURPLE      = 147
-- ORANGE      = 198
-- PINK        = 203  <- low noticability

-- ***Even more colours focused around different tints
-- DARKRED     = 36
-- DARKBLUE    = 2
-- DARKGREEN   = 6
-- LIGHTGREEN  = 30
-- LIGHTBLUE   = 35
-- LIMEGREEN   = 174 <- most recognizable as yellow

-- ***Normal lights
-- LIGHTGREY   = 172 <- normal light
-- WHITE_EXP   = 215 <- normal light
-- SKYBLUE     = 179 <- normal light
-- GREY        = 129 <- normal light

-- ***No category
-- BLACK       = 1 <- dark dark blue
-- NONE        = 255  <- weird mix of pink red and purple

This is from global.lua but sorted, the script will randomize everything between 1-255 for light and text. This is only FYI.
Came up with this script to use this LUA function:

Most of the features of my script are shown here, its just a fun script because I noticed server have "Game rooms" that are completely boring, sure the lottery is interesting, but no it isint, this makes it a bit more fun and you get rewards too!
Here is the full list of features:

  • Nice random light effects give you a crazy effect and feel xD
  • Floating text that randomizes with colour
  • Utani Gran Hur spell is set so the character can go crazy
  • Musical notes effects, also randomize
  • Ability to change light intensity
  • Some messages to player like "Start the disco!"
  • You can set rewards, choose gold, platinum or crystal, set the chance, set the min and max too
  • Max time allowed in disco room until you cannot earn anymore money
  • Easy customization
  • Cool and fun thing for whatever your type of server is :p

Shall we get started?

Step 1
In your map editor, set up a similar room, it can be anything, 3x3, 6x6, anything you want. Now put down some tiles in the room and change their action ID's to 9777 - mine script revolves around this.

Step 2
Create some sort of sign or notice that the light ambiance should be set to 0-25% in Tibia Options.

Step 3
Since there is a limit on how long you can stay in each room, set up more rooms if needed and simply change action ids, then change action ids in the script and movements.xml

Step 4
In movements.xml
PHP:
<movevent event="StepIn" actionid="9777" script="fireinthedisco.lua" />

Step 5
In fireinthedisco.lua
PHP:
-- Disco made by Roman
-- Roman - ******
-- Simple condition setup - gives players utani gran hur effect
-----------------------------------------------------------------------------------------------------------------------------
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 500*3) -- set the value to the same as bottoms value of lightTicks * 5
setConditionFormula(condition, 0.70, 300, 0.70, 300)
setCombatCondition(combat, condition)
-----------------------------------------------------------------------------------------------------------------------------
function onStepIn(cid, item, pos)
-- Basic Configurations
-----------------------------------------------------------------------------------------------------------------------------
local lightLevel = 8 -- 1-10 (could be very wrong :p)
local lightTicks = 500 -- set how long each light should stay on for, leave as it is if you dont know
local moneyChance = 15 -- set a value and it will look like this: (1 in 10) for example, if you set 20 then it will be (1 in 20) chance
local rewardType = 1 -- set to 1 for gold, 2 for platinum, or 3 for crystal NOTE: not recommended to set crystal coins, you can set to some other differnent coin like token and trade with NPC for prizes
local minMoney = 1 -- min amount of coins to get
local maxMoney = 90 -- max amount of coins to get
local maxTime = 1*60*1000 -- max time allowed in disco until kick - change "1" to different values to set different minutes
-----------------------------------------------------------------------------------------------------------------------------
local gold_ID = 2148 -- gold coin ID
local plat_ID = 2152 -- platinum coin ID
local crystal_ID = 2160 -- crystal coin ID
-----------------------------------------------------------------------------------------------------------------------------
-- Roman - ******
local reward = 2148 -- no touchie!
local lighttextColours = {"5", "180", "210", "65", "78", "89", "147", "198", "203", "36", "2", "6", "30", "35", "174", "1", "255"} -- ignore for now
local lighttextRND = math.random(1, 254)
local effectRND = math.random(21,24)
local moneychanceRND = math.random(1,moneyChance)
local moneyRND = math.random(minMoney,maxMoney)
local disco_stat = 0
local disco_status = getPlayerStorageValue(cid,9777)
-----------------------------------------------------------------------------------------------------------------------------
-- Roman - ******
if rewardType == 1 then
    reward = gold_ID
elseif rewardType == 2 then
    reward = plat_ID
elseif rewardType == 3 then
    reward = crystal_ID
end
-- Roman - ******
-----------------------------------------------------------------------------------------------------------------------------
if item.actionid == 9777 then
    if disco_status == -1 then
        local var = positionToVariant(getPlayerPosition(cid))
        doCombat(cid, combat, var)
        doPlayerSendTextMessage(cid,22,"Start the disco!")
        doSetCreatureLight(cid, lightLevel, lighttextRND, lightTicks)
        doSendAnimatedText(getPlayerPosition(cid), "Disco!", lighttextRND)
        doSendMagicEffect(getPlayerPosition(cid), effectRND)
        if moneychanceRND == 1 then
            doPlayerAddItem(cid,reward,moneyRND)
            doPlayerSendTextMessage(cid,22,"Moneh is flowin in!")
        end
        if disco_stat == 0 then
            addEvent(DiscoCheck,maxTime,cid)
            disco_stat = 1
        end
    else
        doPlayerSendCancel(cid, "You have already participated in this disco parteh!")
    end
end
end
-----------------------------------------------------------------------------------------------------------------------------
-- Roman - ******
function DiscoCheck(cid)
    setPlayerStorageValue(cid,9777,1)
end
-- Roman - ******
-----------------------------------------------------------------------------------------------------------------------------

Step 5
Simply set up all configurations:
PHP:
local lightLevel = 8 -- 1-10 (could be very wrong :p)
local lightTicks = 500 -- set how long each light should stay on for, leave as it is if you dont know
local moneyChance = 15 -- set a value and it will look like this: (1 in 10) for example, if you set 20 then it will be (1 in 20) chance
local rewardType = 1 -- set to 1 for gold, 2 for platinum, or 3 for crystal NOTE: not recommended to set crystal coins, you can set to some other differnent coin like token and trade with NPC for prizes
local minMoney = 1 -- min amount of coins to get
local maxMoney = 90 -- max amount of coins to get
local maxTime = 1*60*1000 -- max time allowed in disco until kick - change "1" to different values to set different minutes


Step 6
Try making bigger rooms so you can fit a whole bunch of people in there!

Step 7

Start the disco!


Notes
  • Tested and made in GTH Evolutions 8.0
  • Made in about 30-40 mins
  • The colours of lights strangely correspond to text colours in global.lua
 
Last edited:
Was waiting for u to post it here
anyway use php tags instead of code.
 
Tried it, but it didnt work <.<

Also I noticed ****** turns in ****** hope I dont get executed <.<
 
Nicely ! :D I really thank you but its your script? 6 posts.... ;p anyway thanks a lot ^^
 
posts doesn't mean anything...
Some ppl (like me) watch and learn then start posting.
 
Nicely ! :D I really thank you but its your script? 6 posts.... ;p anyway thanks a lot ^^

There are other OT forums, where he maybe doesn't have 6 posts?

Anyways, nice one :D Funny for some "today OT" lawl :D
 
very rox...
i have problems in TFS 0.2.7 rev. 866

[11/06/2008 00:02:39] Lua Script Error: [MoveEvents Interface]
[11/06/2008 00:02:39] data/movements/scripts/powerot/fireinthedisco.lua:eek:nStepIn

[11/06/2008 00:02:39] luaDoPlayerSendTextMessage(). Player not found

=\\
 
I've seen this script before, for quite a long time ago, on either this forum or the previous forum I used (OTfa**.net). Still is a great script tho, thanks! :)
 
Back
Top