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

[MOD] Paintball event 0.4/0.3.6pl1

Bogart

...has super panda powers
Senator
Joined
Jun 21, 2009
Messages
8,007
Solutions
27
Reaction score
564
Location
Panda Land!
Hello there! today I bring you my latest creation, a paintball event.
I started this script like 3 years ago and didn't finish it; 3 days ago I decided to finish it for fun which means the code might be a lil different in some parts, anyway...
IT IS HIGHLY HIGHLY HIGHLY RECOMMENDED THAT THE EVENT ZONE IS NON-PVP AND NO-LOGOUT ZONE!
Questions & answers:
Q: How does this work?
A: This script works by commands (!shoot bullet, !shoot ammo, !shoot info [!shoot start, !shoot end only for staff]), I'll explain what these commands do.
!shoot bullet This command shoots a "paintball bullet" in the direction the player is looking, the range is based on the default size of the tibia client.
!shoot ammo This command exchanges score points for ammunition.
!shoot info This commands shows your information (score, ammo left) and the top 3 players with highest score.
!shoot start This commands starts the event, creates a teleport and broadcasts a message.
!shoot end This command ends the event, removes the teleport and broadcasts a message.


Q: Have you tested it?
A: Yes. Well, kinda.. since I was the only one making it, I tested it with 2 MC's, which means that I don't have any idea how this script behaves when there's a lot of players in the event.
Q: How do I configure the script?
A: Ok, I'll try to explain the configuration.

Code:
paintball_spawn_area = {
                        top_left = {x = 970, y = 1040, z = 4},
                        bottom_right = {x = 975, y = 1046, z = 7}
                    }
Okay, after some thinking I realized that players would probably camp the spawn area of the event to get free score, which would make it totally unfair, so this part was made so players would spawn in a random place inside of the area (top_left, bottom_right)

Code:
tp_to_paintball = {x = 985, y = 1052, z = 7},
                    event_ending_pos = {x = 985, y = 1052, z = 7}
So the first line is where the teleport to access the event will be created.
The second line is where the players will be teleported after the event finishes.
Code:
                messages = {
                    event_started = "Paintball event has started! there's a teleport near Thais temple!",
                    event_ended = "Paintball event has ended!"
                }
These are the messages that will be shown when the event starts or ends
Code:
                event_config = {
                    event_duration = 0, --minutes, 0 if it's an always-open event
                    infinite_ammo = false,
                    winner_gets_item = true,
                    prize_item_id = 3051,
                    decrease_score_on_death = true,
                    points_per_kill = 1,
                    ammo_per_point = 100,
                    reset_bullets_on_death = true,
                    min_bullets_on_spawn = 100
                }
This part is quite obvious, here you change the duration, infinite ammunition, if the winner will get an item, the item the winner will receive, if the script should take points from the players killed, ammunition received for each point, whether players get their ammunition restored after death & how many ammo the player will receive when spawning.
Code:
misc = {
                    walls_id = {1115,1111,1112,5258,1385,1113},
                    bullets_exhaust = 500, --in ms
                    bullet_speed = 150
                },
Wall_ids this array will contain all the items that may block the bullets.
bullets_exhaust time between each shoot in milliseconds
bullet_speed the speed the bullet travels in milliseconds (I WOULDN'T CHANGE IT IF I WERE YOU BECAUSE THE ANIMATION WOULD GET SCREWED UP)

Alrighty, here's the script:
http://pastebin.com/NsfJeAqa

And here's the map I used while testing (all the walls have been configured in the script and yes, bullets pass through windows)
http://speedy*****malware.localhost/WpDXP/paintballmap.zip

Please report bugs, and if anyone uses this script in their server with lots of people, please let me know, I wanna try it.
 
Last edited:
Woot?! The panda is in da house! Havent seen you lately mate! Welcome back :)
Thanks for the contribution!

Kind regards,
Damon
 
azFlQzJII.png
u can explian to me how i can play its sorry can't understand it
 
Last edited:
Oh my bad!
Fixed the script and made an explanation video.
Watch in 720p for better understanding
Also..
IT IS HIGHLY HIGHLY HIGHLY RECOMMENDED THAT THE EVENT ZONE IS NON-PVP AND NO-LOGOUT ZONE!
 
Test server online if anyone wants to try it:
189.182.120.240 MSG Calexus for items/levels
 
Fixed an error & added Spanish subtitles to the video, main post updated.
 
Hello there! today I bring you my latest creation, a paintball event.
I started this script like 3 years ago and didn't finish it; 3 days ago I decided to finish it for fun which means the code might be a lil different in some parts, anyway...
IT IS HIGHLY HIGHLY HIGHLY RECOMMENDED THAT THE EVENT ZONE IS NON-PVP AND NO-LOGOUT ZONE!
Questions & answers:
Q: How does this work?
A: This script works by commands (!shoot bullet, !shoot ammo, !shoot info [!shoot start, !shoot end only for staff]), I'll explain what these commands do.
!shoot bullet This command shoots a "paintball bullet" in the direction the player is looking, the range is based on the default size of the tibia client.
!shoot ammo This command exchanges score points for ammunition.
!shoot info This commands shows your information (score, ammo left) and the top 3 players with highest score.
!shoot start This commands starts the event, creates a teleport and broadcasts a message.
!shoot end This command ends the event, removes the teleport and broadcasts a message.


Q: Have you tested it?
A: Yes. Well, kinda.. since I was the only one making it, I tested it with 2 MC's, which means that I don't have any idea how this script behaves when there's a lot of players in the event.
Q: How do I configure the script?
A: Ok, I'll try to explain the configuration.

Code:
paintball_spawn_area = {
                        top_left = {x = 970, y = 1040, z = 4},
                        bottom_right = {x = 975, y = 1046, z = 7}
                    }
Okay, after some thinking I realized that players would probably camp the spawn area of the event to get free score, which would make it totally unfair, so this part was made so players would spawn in a random place inside of the area (top_left, bottom_right)

Code:
tp_to_paintball = {x = 985, y = 1052, z = 7},
                    event_ending_pos = {x = 985, y = 1052, z = 7}
So the first line is where the teleport to access the event will be created.
The second line is where the players will be teleported after the event finishes.
Code:
                messages = {
                    event_started = "Paintball event has started! there's a teleport near Thais temple!",
                    event_ended = "Paintball event has ended!"
                }
These are the messages that will be shown when the event starts or ends
Code:
                event_config = {
                    event_duration = 0, --minutes, 0 if it's an always-open event
                    infinite_ammo = false,
                    winner_gets_item = true,
                    prize_item_id = 3051,
                    decrease_score_on_death = true,
                    points_per_kill = 1,
                    ammo_per_point = 100,
                    reset_bullets_on_death = true,
                    min_bullets_on_spawn = 100
                }
This part is quite obvious, here you change the duration, infinite ammunition, if the winner will get an item, the item the winner will receive, if the script should take points from the players killed, ammunition received for each point, whether players get their ammunition restored after death & how many ammo the player will receive when spawning.
Code:
misc = {
                    walls_id = {1115,1111,1112,5258,1385,1113},
                    bullets_exhaust = 500, --in ms
                    bullet_speed = 150
                },
Wall_ids this array will contain all the items that may block the bullets.
bullets_exhaust time between each shoot in milliseconds
bullet_speed the speed the bullet travels in milliseconds (I WOULDN'T CHANGE IT IF I WERE YOU BECAUSE THE ANIMATION WOULD GET SCREWED UP)

Alrighty, here's the script:
http://pastebin.com/HhsWyBFa

And here's the map I used while testing (all the walls have been configured in the script and yes, bullets pass through windows)
http://speedy*****malware.localhost/WpDXP/paintballmap.zip

Please report bugs, and if anyone uses this script in their server with lots of people, please let me know, I wanna try it.
It's that the Pandas voice?! Cutest panda voice ever. ^^
 
Added automatically start, you can turn it on in the configuration
Code:
start_automatically = false
 
Bogart, can you add a waiting area?
that is, when you enter to the teleport (when the event is open), you send automatically all members to waiting zone, and 2 minutes later, all players send to the paintball area (random spawn).
 
Bogart, can you add a waiting area?
that is, when you enter to the teleport (when the event is open), you send automatically all members to waiting zone, and 2 minutes later, all players send to the paintball area (random spawn).
Done, use
Code:
use_waiting_room = true
.

@Thread, fixed a bug and added ^ and also added
Code:
tfs_version = "0.3", --0.3 or 0.4
since 0.4 uses doSetItemActionId and 0.3 doSetItemAttribute
 
Hello Bogar i saw on this video your engine and i have a question. Can you tell me where did you get him? With menu bar etc.
because i'm searching it for a longer time. And great event!!! THX
 
Hello Bogar i saw on this video your engine and i have a question. Can you tell me where did you get him? With menu bar etc.
because i'm searching it for a longer time. And great event!!! THX
 
Im Gonna try it out now :) But what if someone is standing on the tp pos when its about to spawn? I dont know how hard it is, but maybe a command !join paintball, instead of tp? :p Just an idea :p Will edit when I tried it out!

[EDIT] When I enabled these 2, it started to spam the broadcast message and my client crashed for some reason while trying to enter the TP again. Other than that it looks fine. Now Im no good scripter, but a max limit of players and min limit of 2 for ex and a command to join ex !join paintball and you wont be able to move in PZ for like a minute or 2 until it starts. Then I will diffently use this event! :)
start_automatically = true,
use_waiting_room = true,

[EDIT 2] Im using 0.4 REV and it fucks up my talkactions. When the Event is disabeld I cant use my normal player commands like !online, !frags then I get this:

[7:19:31.916] [Error - TalkAction Interface]
[7:19:31.916] files/data/talkactions/scripts/frags.lua:eek:nSay
[7:19:31.916] Description:
[7:19:31.916] files/data/lib/exhaustion.lua:20: field 'day' missing in date table
[7:19:31.916] stack traceback:
[7:19:31.916] [C]: in function 'time'
[7:19:31.916] files/data/lib/exhaustion.lua:20: in function 'set'
[7:19:31.916] files/data/talkactions/lib/talkactions.lua:4: in function 'checkExhausted'
[7:19:31.916] files/data/talkactions/scripts/frags.lua:7: in function <files/data/talkactions/scripts/frags.lua:6>

I have an exhaust script so you cant spam commands. Even for GODs, so 10 sec Cooldown. But yea, with even enabeld all player talkactions stops working, except the events. :(
 
Last edited:
I put the ID in Wall_IDS , however he gives respawn in places that have this ID . Can u help me?

Code:
 if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
 
I put the ID in Wall_IDS , however he gives respawn in places that have this ID . Can u help me?

Code:
 if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then
Do you mean the bullet goes through the wall or does the player respawn on a wall?
 
Back
Top