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:
<?xml version="1.0" encoding="UTF-8"?> <mod name="Paintball event" version="1. - Pastebin.com (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.