)... Hmm the Heal command isn't cheap like all the others, it does it exactly like it should... Fire you aim on who you want to 'heal'.. Then it'll ping from that person to another close team mater, except it'll loose 'healing power' when it pings...Code
GeSHi (python):import es, wcs, gamethread, random, popuplib, playerlib
from wcs import wcs
name = 'Shadow Hunter'
race = wcs.Race(name)
race.registerSkill('Healing Wave',5,2,'Calls forth a wave of energy that heals a target and bounces to nearby friendlies.')
race.registerSkill('Hex',6,1,'Have a chance to slow down your enemies!')
race.registerSkill('Serpent Ward',6,3,'Summons an immobile serpentine ward to attack the Shadow Hunter\'s enemies')
race.registerUltimate('Big Bad Voodo',6,7,4,'Turns all friendly units invulnerable in an area around the Shadow Hunter.')
race.registerMinLevel(60)
def load():
a = popuplib.create('Shadow_Ability')
b = a.addline
b('Shadow Hunters Abilities!')
b('--------------------------')
b('Please select an ability to')
b('do.')
b(' ')
b('->1. Healing Wave')
b(' ')
b('->2. Serpent Ward')
b(' ')
b('--------------------------')
b('0. Cancel')
a.menuselect = AbilityChoice
def AbilityChoice(userid, choice, popupid):
if choice < 3:
if choice == 1:
HealingWave(userid)
else:
SerpentWard(userid)
popuplib.send('Shadow_Ability',userid)
def round_start(ev):
SerpentWardLoop()
def round_end(ev):
gamethread.cancelDelayed('Serpent_loop')
def player_ability_on(ev):
uid = ev['userid']
if not wcs.Command(uid).GetCoolDown('Serpent Ward') or not wcs.Command(uid).GetCoolDown('Healing Wave'):
sw = wcs.GetLevel(uid,name,'Serpent Ward')
hw = wcs.GetLevel(uid,name,'Healing Wave')
if sw and not hw:
# Shadow Ward, and not Healing wave
SerpentWard(uid)
elif hw and not sw:
HealingWave(uid)
elif hw and sw:
popuplib.send('Shadow_Ability',uid)
def HealingWave(userid):
cooldown = wcs.Command(userid).GetCoolDown('Healing Wave')
if not cooldown:
target = wcs.Command(userid).GetViewPlayer()
if target and es.getplayerteam(target) == es.getplayerteam(userid):
level = wcs.GetLevel(userid,name,'Healing Wave')
if level:
heal = level * 10
wcs.Command(target).Heal(level * 5)
banned_list = [int(userid),target]
x,y,z = es.getplayerlocation(userid)
wcs.Effect().BeamCustom('#a',0,'sprites/halo01.vmt',x,y,z,x,y,z+400,5,80,40,255,0,255,155)
HealingWaveLoop(target, heal, banned_list)
wcs.Command(userid).SetCoolDown('Healing Wave',20)
else:
es.tell(userid,'#multi','#greenHealing Wave #default- #lightgreenYou must be aiming on a team-mate to use Healing Wave.')
else:
es.tell(userid,'#multi','#greenHealing Wave #default- #lightgreenYou cannot use Healing Wave for another %s seconds!'%cooldown)
def HealingWaveLoop(target, heal, banned_list):
x,y,z = es.getplayerlocation(target)
allow_list = []
for player in playerlib.getPlayerList('%s'%('#t' if es.getplayerteam(target) == '3' else '#ct')):
if int(player) != target and int(player) not in banned_list:
xx,yy,zz = es.getplayerlocation(int(player))
distance = ((x-xx) ** 2 + (y -yy)**2 + (z-zz) ** 2) ** 0.5
if distance <= 500:
allow_list.append(int(player))
if len(allow_list):
a = wcs.Effect()
random_player = random.choice(allow_list)
a.Beam4(target,random_player,2,255,0,0)
a.Ring4(random_player,150,75,4,60,80,0,255,0)
banned_list.append(random_player)
heal = int(round(heal/0.6))
wcs.Command(random_player).Heal(heal)
gamethread.delayed(0.5,HealingWaveLoop,(random_player,heal,banned_list))
serpent_dict = {}
def SerpentWard(userid):
cooldown = wcs.Command(userid).GetCoolDown('Serpent Ward')
if not cooldown:
level = wcs.GetLevel(userid,name,'Serpent Ward')
if level:
x,y,z = es.getplayerlocation(userid)
if not serpent_dict.has_key(int(userid)):
serpent_dict[int(userid)] = {'one':{'x':x,'y':y,'z':z,'timer':20}}
es.tell(userid,'#multi','#greenSerpent Ward #default- #lightgreenYou have just placed a Serpent Ward (1/2).')
elif not serpent_dict[int(userid)].has_key('one'):
serpent_dict[int(userid)]['one'] = {'x':x,'y':y,'z':z,'timer':20}
es.tell(userid,'#multi','#greenSerpent Ward #default- #lightgreenYou have just placed a Serpent Ward (1/2).')
else:
if not serpent_dict.has_key('two'):
serpent_dict[int(userid)]['two'] = {'x':x,'y':y,'z':z,'timer':20}
es.tell(userid,'#multi','#greenSerpent Ward #default- #lightgreenYou have just placed a Serpent Ward (2/2).')
else:
serpent_dict[int(userid)]['%s'%('one' if serpent_dict[int(userid)]['one']['timer'] >= serpent_dict[int(userid)]['two']['timer'] else 'two')] = {'x':x,'y':y,'z':z,'timer':20}
es.tell(userid,'#multi','#greenSerpent Ward #default- #lightgreenYou have just overwrote a Serpant Ward.')
wcs.Command(userid).SetCoolDown('Serpent Ward',10)
else:
es.tell(userid,'#multi','#greenSerpent Ward #default- #lightgreenYou cannot use this skill for another %s seconds.'%cooldown)
def player_spawn(ev):
global serpent_dict
if serpent_dict.has_key(int(ev['userid'])):
del serpent_dict[int(ev['userid'])]
wcs.Command(ev['userid']).UpdateDict('Hexed',0)
def SerpentWardLoop():
global serpent_dict
if len(serpent_dict):
deleting = []
for player in serpent_dict:
level = wcs.GetLevel(player,name,'Serpent Ward')
for index in serpent_dict[player]:
timer = serpent_dict[player][index]['timer']
if timer:
serpent_dict[player][index]['timer'] = timer - 1
x = serpent_dict[player][index]['x']
y = serpent_dict[player][index]['y']
z = serpent_dict[player][index]['z']
wcs.Effect().RingCustom('#a','0','sprites/lgtning.vmt',x,y,z,20,level*40,1,20,100,1,255,150,70,100,10)
for target in playerlib.getPlayerList('%s'%('#t' if int(es.getplayerteam(player)) == 3 else '#ct')):
xx,yy,zz = es.getplayerlocation(int(target))
distance = ((x-xx) ** 2 + (y -yy)**2 + (z-zz) ** 2) ** 0.5
if distance <= (level*40):
if not int(es.getplayerprop(userid,'CBasePlayer.pl.deadflag')):
wcs.Command(target).Damage(level * random.randint(4,6), 32, player)
wcs.Effect().BeamCustom('#a','0','sprites/lgtning.vmt',x,y,z+30,xx,yy,zz+30,1,10,20,255,150,70,255)
else:
temp_key = '%s:%s'%(player,index)
deleting.append(temp_key)
es.tell(player,'#multi','#greenSerpent Ward #default- #lightgreenA Serpent Ward has dissapeared!')
if len(deleting):
for key in deleting:
args = key.split(':')
del serpent_dict[int(args[0])][args[1]]
gamethread.delayedname(1,'Serpent_loop',SerpentWardLoop)
def player_disconnect(ev):
global serpent_dict
userid = int(ev['userid'])
if serpent_dict.has_key(userid): del serpent_dict[userid]
def est_map_end(ev):
global serpent_dict
serpent_dict.clear()
def player_hurt(ev):
userid = int(ev['userid'])
attacker = int(ev['attacker'])
if ev['es_userteam'] != ev['es_attackerteam'] and attacker and not wcs.Command(userid).ReturnDict('Hexed'):
Hex = wcs.GetLevel(attacker,name,'Hex')
if Hex and random.randint(1,100) <= Hex:
wcs.Command(userid).UpdateDict('Hexed',1)
speed = wcs.Command(userid).ReturnDict('Speed')
divider = speed/(1 + (Hex * 0.2))
# This should divide the speed by: 1.2, 1.4, 1.6, 1.8, 2.0, 2.2
wcs.Command(userid).Speed(divider)
es.tell(userid,'#multi','#greenHex #default- #lightgreenPlayer %s has slowed you to %.0f%% of your maximum speed!'%(ev['es_attackername'],(100 * divider * speed)))
es.tell(attacker,'#multi','#greenHex #default- #lightgreenYou have slowed player %s to %.0f%% of his maximum speed!'%(ev['es_username'],(100 * divider * speed)))
gamethread.delayed(3,wcs.Command(userid).Speed,speed)
gamethread.delayed(3,wcs.Command(userid).UpdateDict,('Hexed',0))
def player_ultimate_on(ev):
userid = int(ev['userid'])
level = wcs.GetLevel(userid,name,'Big Bad Voodo')
if level:
wcs.Command(userid).Near(level*50,God,'%s'%('#t' if int(es.getplayerteam(userid)) == 2 else '#ct'))
wcs.Command(userid).SetCoolDown('Big Bad Voodo',30)
x,y,z = es.getplayerlocation(userid)
wcs.Effect().RingCustom('#a','0','sprites/lgtning.vmt',x,y,z,20,level*50,1,20,100,1,255,0,0,100,10)
def God(userid, friend_id):
level = wcs.GetLevel(friend_id,name,'Big Bad Voodo')
wcs.Command(userid).God(level)
a = wcs.Effect()
a.Ring4(userid,150,50,level,50,100,255,0,255)







Logged



United States



