Votifier Tracking & Rewards
Author: TheRealKeith
Created: 2014-06-28T01:45:12-0400
Edited: 2014-06-28T01:45:12-0400
Denizen Version: Build 1474
Views: 38
Downloads: 874
Likes: 1
Description: This is a votifier script that BlackCoyote helped me write a while back. It works with Votifier and requires depenizen to function. I decided to post a few of my scripts up here after losing one, it would be nice to archive a few here, and help others in the process.
You will want to edit the rewards, my server uses a plugin called mythicdrops and in the script Im executing a command for that plugin.
Features:
Offline Voting
Vote Tracking with Commands
Top Voter Tracking with Command
Lucky Voting
Goal voting rewards
Automatically resets monthly
Commands:
/votes (Displays your current vote count)
/vote <player name> (Displays another players vote count)
/topvoter (Displays the player with the highest votes)
Votifier:
type: world
debug: false
events:
on votifier vote:
- if <player.is_online> {
- run VotifierInternal instantly delay:1t
} else {
- flag missedvotes:++
}
on player joins:
- if <player.has_flag[missedvotes]> {
- repeat <player.flag[missedvotes].as_int> {
- run VotifierInternal instantly delay:1t
}
- flag missedvotes:!
}
on votes command:
- if <context.args.size> = 1 {
- narrate "<GREEN><context.args.get[1]> has voted <GOLD><context.args.get[1].as_player.flag[votes].as_int> <GREEN>times"
- determine fulfilled
}
- if <context.args.size> != 1 {
- narrate "<GREEN>You have voted <GOLD><player.flag[votes]> <GREEN>times"
- determine fulfilled
}
on topvoter command:
- foreach <server.list_players> {
- if <%highestplayer%.flag[votes]||0> < <%value%.flag[votes]||0> define highestplayer %value%
}
- narrate "<GREEN>The current top voter is <GOLD><%highestplayer%.name> <green>with <GOLD><%highestplayer%.as_player.flag[votes].as_int> <green>votes"
- determine fulfilled
VotifierInternal:
type: task
debug: false
script:
- announce "<GREEN><player.name> <DARK_PURPLE>voted and got <GREEN>3 Diamonds, $500, 100XP!"
- give i@diamond qty:3
- give money qty:500
- give xp qty:100
- flag <player.name> votes:++
- run RewardVote instantly
- run LuckyVote instantly
RewardVote:
type: task
debug: false
script:
- if <player.flag[votes]> == 45 {
- give i@52,54 qty:1
- narrate "<green>You've got a <dark_purple>spawner <green>for voting 45 times"
- announce "<GREEN><player.name> <GOLD>voted 45 times and got a <GREEN>Spawner!"
}
- if <player.flag[votes]> == 60 {
- give i@52,92 qty:1
- narrate "<green>You've got a <dark_purple>spawner <green>for voting 60 times"
- announce "<GREEN><player.name> <GOLD>voted 60 times and got a <GREEN>Spawner!"
}
- if <player.flag[votes]> == 75 {
- give i@52,51 qty:1
- narrate "<green>You've got a <dark_purple>spawner <green>for voting 75 times"
- announce "<GREEN><player.name> <GOLD>voted 75 times and got a <GREEN>Spawner!"
}
- if <player.flag[votes]> == 100 {
- give i@52,61 qty:1
- narrate "<green>You've got a <dark_purple>spawner <green>for voting 100 times"
- announce "<GREEN><player.name> <GOLD>voted 100 times and got a <GREEN>Spawner!"
}
- if <player.flag[votes]> == 150 {
- give i@52,50 qty:1
- narrate "<green>You've got a <dark_purple>spawner <green>for voting 150 times"
- announce "<GREEN><player.name> <GOLD>voted 150 times and got a <GREEN>Spawner!"
}
LuckyVote:
type: task
debug: false
script:
- if <util.random.int[1].to[1000]> = 500 {
- announce "<GREEN><player.name> <GOLD>was lucky and got <GREEN>$2000 and a <GOLD>Legendary item"
- give money qty:2000
- execute as_server "md give <player.name> -a 1 -t legendary"
} else if <util.random.int[1].to[100]> = 50 {
- announce "<GREEN><player.name> <GOLD>was lucky and got <GREEN>$1000 and an <GOLD>Exotic item"
- give money qty:1000
- execute as_server "md give <player.name> -a 1 -t exotic"
} else if <util.random.int[1].to[50]> = 25 {
- announce "<GREEN><player.name> <GOLD>was lucky and got <GREEN>$500 and an <GOLD>Epic item"
- give money qty:500
- execute as_server "md give <player.name> -a 1 -t epic"
} else if <util.random.int[1].to[10]> = 5 {
- announce "<GREEN><player.name> <GOLD>was lucky and got <GREEN>$250 and a <GOLD>Rare item!"
- give money qty:250
- execute as_server "md give <player.name> -a 1 -t rare"
}
ResetVote:
type: world
debug: false
events:
on time changes in w@world:
- if <server.flag[month]> != <util.date.time.month> {
- flag global month:<util.date.time.month>
- foreach <server.list_players> {
- flag %value% votes:!
}
}