from __future__ import division import wcs, playerlib, es, random, gamethread from wcs import wcs info = es.AddonInfo() info['name'] = "Hera Race" info['version'] = "1.0" info['author'] = "Bonbon AKA: Bonbon367" info['url'] = "http://www.notimplementedyet.com" info['description'] = "A completely origional race for those of you who like Greek Mythology Race #4" h = 'Hera' race = wcs.Race(h) raceskill = wcs.Race(h).registerSkill raceskill('Wrath Of The Angry Wife', 6, 2, "Super Slap your attacker when you die chance 0-18%") raceskill("Pomegrant Delight", 6, 2, "A narcotic that you carry may make your enemies fall asleep") raceskill('Deadly looks', 7, 1, "Freeze your attackers with your stunning looks") race.registerUltimate("Protective Husband", 7, 6, 2, "Call upon Zeus to hail a lightning storm around you") race.registerMinLevel(35) def player_ultimate_on(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Hera': if wcs.GetLevel(userid, h, 'Protective Husband'): loc = es.getplayerlocation(userid) effect_time = 0 wcs.Effect().BeamCustom('#all', 0, 'sprites/lgtning.vmt', loc[0], loc[1], loc[2], loc[0], loc[1], loc[2] + 120, 1, 10, 20, 40, 240, 255, 255) gamethread.delayedname(0.1, 'effect_%s'%userid, effect_loop, args=(loc, effect_time, userid)) wcs.Command(userid).SetCoolDown('Protective Husband', 40) def effect_loop(loc, effect_time, userid): ph = wcs.GetLevel(userid, h, 'Protective Husband') if effect_time <= 3 + (ph / 2.5): random1 = random.randint(ph * -60, ph * 60) random2 = random.randint(ph * -60, ph * 60) es.server.queuecmd('est_effect 3 #all 0 sprites/lgtning.vmt %s %s %s %s %s %s 1 10 20 40 250 255 255'%(loc[0] + random1, loc[1] + random2, loc[2], loc[0] + random1, loc[1] + random2, loc[2] + 120)) # wcs.Effect().BeamCustom('#all', 0, 'sprites/lgtning.vmt', loc[0] + random1, loc[1] + random2, loc[2], loc[0] + random1, loc[1] + random2, loc[2] + 120, 1, 10, 20, 40, 240, 255, 255) effect_time += 0.1 - (ph / 70) if playerlib.getPlayer(userid).attributes['teamid'] == 2: wcs.Command(userid).NearCoord(loc[0] + random1, loc[1] + random2, loc[2], 29 + (ph * 2), 29 + (ph * 2), 29 + (ph * 2), lightning_damage, '#ct') elif playerlib.getPlayer(userid).attributes['teamid'] == 3: wcs.Command(userid).NearCoord(loc[0] + random1, loc[1] + random2, loc[2], 29 + (ph * 2), 29 + (ph * 2), 29 + (ph * 2), lightning_damage, '#t') gamethread.delayedname(0.1 - (ph / 70), 'effect_%s'%userid, effect_loop, args=(loc, effect_time, userid)) def lightning_damage(userid, attacker): ph = wcs.GetLevel(attacker, h, 'Protective Husband') random3 = random.randint(1, 3) if ph: random4 = random.randint(0, ph) wcs.Command(userid).Damage((ph * random3) - random4, 32, attacker) es.tell(attacker, '#multi', '#greenYou dealt #lightgreen%s #greendamage to #lightgreen%s!'%((random3 * ph - random4), playerlib.getPlayer(userid).attributes['name'])) def player_death(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Hera': ss = wcs.GetLevel(userid, h, 'Wrath Of The Angry Wife') if ss: if random.randint(1, 100) <= 15 + (ss * 2): if playerlib.getPlayer(userid).attributes['teamid'] == 2: wcs.Command(userid).Near(ss * 85, mega_slap, '#ct') elif playerlib.getPlayer(userid).attributes['teamid'] == 3: wcs.Command(userid).Near(ss * 85, mega_slap, '#t') def mega_slap(userid, attacker): slap_time = 0 gamethread.delayedname(0.1, 'mega_slap_%s'%userid, mega_slap_loop, args=(userid, attacker, slap_time)) def mega_slap_loop(userid, attacker, slap_time): if slap_time <= wcs.GetLevel(attacker, h, 'Wrath Of The Angry Wife') / 2.5: es.setplayerprop(userid, 'CBasePlayer.localdata.m_vecBaseVelocity', '%s,%s,%s'%(random.randint(-155, 155), random.randint(-155, 155), random.randint(0, 155))) if random.randint(1, 6) == 1: wcs.Command(userid).Damage(wcs.GetLevel(attacker, h, 'Mega Slap') / 2, 32, attacker) wcs.Effect().Misc2(userid, 0.1, 5) if random.randint(1, 2) == 1: wcs.Effect().Misc2(userid, 0.1, 1) slap_time += 0.1 gamethread.delayedname(0.1, 'mega_slap_%s'%userid, mega_slap_loop, args=(userid, attacker, slap_time)) def prep_hurt(event_var): userid = int(event_var['userid']) attacker = int(event_var['attacker']) pd = wcs.GetLevel(attacker, h, 'Pomegrant Delight') dl = wcs.GetLevel(userid, h, 'Deadly Looks') if wcs.GetRace(attacker) == 'Hera': if pd: if random.randint(1, 100) <= pd * 4: es.server.queuecmd('est_fade %s 0 %s %s 0 0 0 255'%(userid, pd / 20, pd / 20)) es.server.queuecmd('est_freeze %s 1'%userid) gamethread.delayed(pd / 7, es.server.queuecmd, 'est_freeze %s 0'%userid) loc = es.getplayerlocation(userid) wcs.Effect().BeamCustom('#all', 0, 'sprites/lgtning.vmt', loc[0], loc[1], loc[2], loc[0], loc[1], loc[2] + 120, 1, 10, 20, 255, 0, 255, 255) if wcs.GetRace(userid) == 'Hera': if dl: if random.randint(1, 100) <= dl * 2.8: es.server.queuecmd('est_freeze %s 1'%attacker) gamethread.delayed(dl / 10, es.server.queuecmd, 'est_freeze %s 0'%attacker) wcs.Effect().Misc1(attacker, dl / 10)