Tweak
Something I randomly thought up over the last hour or so. Tweak is an ultimate. When used, you receive a certain amount of "drugs" described by a tell event. Using the ultimate registers the command !inject. This is the second part of the ultimate. To actually receive any effect of the ultimate, the user must type !inject. Once input, depending on how much drugs you were given, it will give you a certain speed boost as well as drug induced screen. This skill can be customized to the user's/server operators liking, by simply changing some values within the Python file. You can make each level of drug injection do whatever you want it to, for how long you want it to. Also, please read the readme file included in the .zip as it contains some important instructions (while basic) on how to setup the skill. Here is the source code itself and some of the things you can change within it:Code: [Select]
import es
import random
import usermsg
import cmdlib
def pytweak():
global dosage
global wcs_user
userid = int(es.ServerVar("wcs_userid"))
wcs_user = int(userid)
has_tweaked = es.exists('saycommand', '!inject')
if has_tweaked == 0:
cmdlib.registerSayCommand('!inject', inject, "Injects your dose.")
dosage = random.randint(1, 100)
es.tell(userid, '#multi', "#green[Tweak]#lightgreen Type !inject to inject %i g of opiates into your blood." % dosage)
else:
es.tell(userid, '#multi', "#green[Tweak]#lightgreen Sorry, you've already prepared your dose.")
def inject(userid, args):
es.set('extra', wcs_user)
if userid == wcs_user:
es.tell(userid, '#multi', "#green[Tweak]#lightgreen You've taken the opiates. Prepare yourself.")
if dosage >= 1 and dosage <= 25:
#es.tell(userid, "Dosage was 1 - 25") <---------------customize
usermsg.fade(userid, 0, 1, 2500, 0, 55, 200, 175) # <-----------customize
es.server.queuecmd('es wcs_setfx speed server_var(extra) = 1.25') #<--------------customize
es.delayed(5, "es wcs_setfx speed server_var(extra) = 1.0") #<------------------customize
if dosage >= 26 and dosage <= 50:
#es.tell(userid, "Dosage was 26 - 50")
usermsg.fade(userid, 0, 1, 5000, 55, 150, 0, 175)
es.server.queuecmd('es wcs_setfx speed server_var(extra) = 1.50')
es.delayed(10, "es wcs_setfx speed server_var(extra) = 1.0")
if dosage >= 51 and dosage <= 75:
#es.tell(userid, "Dosage was 51 - 75")
usermsg.fade(userid, 0, 1, 7500, 200, 0, 25, 175)
es.server.queuecmd('es wcs_setfx speed server_var(extra) = 1.75')
es.delayed(15, "es wcs_setfx speed server_var(extra) = 1.0")
if dosage >= 76 and dosage <= 100:
#es.tell(userid, "Dosage was 76 - 100")
usermsg.fade(userid, 0, 1, 10000, 255, 255, 255, 155)
es.server.queuecmd('es wcs_setfx speed server_var(extra) = 2.0')
es.delayed(20, "es wcs_setfx speed server_var(extra) = 1.0")
cmdlib.unregisterSayCommand('!inject')
else:
es.tell(userid, '#multi', '#green[WCS]#lightgreen Sorry, but you are not authorized to run that command.')
def unload():
cmdlib.unregisterSayCommand('!inject')The lines where I have arrows pointing to the code and the word customize next to it are where you can put the effects you want, as in the actual skill, not special effects. This also applies to the lines below it that are in the same format, but that I just didn't want to draw lines for as it's 2:30 am and I'm tired. You can also change the actual command itself as well as the text events. I wouldn't recommend changing anything else unless you know how to code in Python as it can screw with stuff on your server and/or cause the skill/plugin to break. I'll also include in this post, below, the simple test race I used the skill on, as a general format:
Code: [Select]
[Tweak]
required = 0
maximum = 0
restrictteam = 0
teamlimit = 0
restrictmap = ""
restrictitem = "sockf50"
author = "Mizery"
desc = ""
spawncmd = ""
deathcmd = ""
roundstartcmd = ""
roundendcmd = ""
preloadcmd = ""
allowonly = "STEAM_0:1:46426328"
racecategory = "Private races"
onchange = ""
numberofskills = 1
numberoflevels = 1
skillnames = "Python Power"
skilldescr = "The power of the py."
skillcfg = "player_ultimate"
skillneeded = "0"
[[skill1]]
setting = ""
cmd = "es_doblock tweak/pytweak; es_set wcs_userid server_var(wcs_userid)"
sfx = ""
cooldown = "21"
If anything is not working, please post here, or fix yourself if you know how to. I'll be more than happy to fix anything that's going on with it or troubleshoot why it's not working on your server. I'm also open to customizing it to the needs of your server, if you just ask and tell me what exactly you need. Thanks.
=-=MizeЯy=-=


Logged


Great job!! I will look through the code and give it a try in a minute.





