from __future__ import division import wcs, playerlib, es, random, gamethread from wcs import wcs info = es.AddonInfo() info['name'] = "Hades 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" h = 'Hades' race = wcs.Race(h) raceskill = wcs.Race(h).registerSkill raceskill('Helm Of Darkness', 5, 1, "A helmet given to you by the Cyclopes, which can make you invisible") raceskill('Riches Of The Earth', 6, 1, "You possess the riches of the earth and gain money over time") raceskill('Scepter Of Hades', 4, 3, "Send a plague upon your victim chance 10-20%") raceskill('Seasons Of Persephone', 4, 2, "Each level you have Persephone spends another month of the year with you\n Making you more powerfull") race.registerUltimate("Deadly Pomegrant", 4, 3, 5, "Persuade people to eat the Pomegrant seads beside you causing them to stay in the underworld chance 20-60%") race.registerMinLevel(15) def player_ultimate_on(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Hades': if wcs.GetLevel(userid, h, 'Deadly Pomegrant'): wcs.Command(userid).SetCoolDown('Deadly Pomegrant', 20) if playerlib.getPlayer(userid).attributes['teamid'] == 2: # T wcs.Command(userid).Near(200 + wcs.GetLevel(userid, h, 'Deadly Pomegrant') * 84, bury, '#ct') elif playerlib.getPlayer(userid).attributes['teamid'] == 3: # CT wcs.Command(userid).Near(200 + wcs.GetLevel(userid, h, 'Deadly Pomegrant') * 84, bury, '#t') def bury(userid, attacker): player_loc = es.getplayerlocation(userid) es.server.queuecmd('es_xsetloc %s %s %s %s'%(userid, player_loc[0], player_loc[1], player_loc[2] - 66)) gamethread.delayed(3 + (wcs.GetLevel(attacker, h, 'Deadly Pomegrant') / 2), es.server.queuecmd, 'es_xsetloc %s %s %s %s'%(userid, player_loc[0], player_loc[1], player_loc[2] - 66)) wcs.Effect().Misc1(userid, 1) def prep_hurt(event_var): if event_var['weapon'] != 'point_hurt': userid = int(event_var['userid']) attacker = int(event_var['attacker']) if wcs.GetRace(attacker) == 'Hades': if wcs.GetLevel(attacker, h, 'Scepter Of Hades'): if random.randint(1, 100) < wcs.GetLevel(attacker, h, 'Scepter Of Hades') * 4: wcs.Command(userid).Drain(wcs.GetLevel(attacker, h, 'Scepter Of Hades'), 4 - (wcs.GetLevel(attacker, h, 'Scepter Of Hades') / 2), 8, attacker) time = 1 gamethread.delayedname(1, 'Scepter_%s'%userid, scepter_effect_loop, args=(userid, time)) if wcs.GetLevel(attacker, h, 'Seasons Of Persephone'): if random.randint(1, 12) <= wcs.GetLevel(attacker, h, 'Seasons Of Persephone'): wcs.Command(userid).Damage(wcs.GetLevel(attacker, h, 'Seasons Of Persephone') * random.randint(1, 3), 32, attacker) wcs.Effect().Misc1(userid, 1) wcs.Effect().Beam4(attacker, userid, 1, 0, 255, 0) def scepter_effect_loop(userid, time): if time <= 8: wcs.Effect().Ring4(userid, 50, 100, 1, 40, 50, 64, 0, 128) es.server.queuecmd('est_fade %s 1 0.2 0.2 0 255 0 100'%userid) time += 1 gamethread.delayedname(1, 'Scepter_%s'%userid, scepter_effect_loop, args=(userid, time)) def money_loop(): if bool(es.getplayercount()): for userid in es.getUseridList(): player = playerlib.getPlayer(userid) money = player.get('cash') if wcs.GetRace(userid) == 'Hades': if wcs.GetLevel(int(userid), h, 'Riches Of The Earth'): player.set('cash', money + (wcs.GetLevel(userid, h, 'Riches Of The Earth') * 4)) gamethread.delayed(3, money_loop, args=()) def player_spawn(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Hades': if wcs.GetLevel(userid, h, 'Helm Of Darkness'): wcs.Command(userid).Fade(255 - (wcs.GetLevel(userid, h, 'Helm Of Darkness') * 37), 1) if wcs.GetLevel(userid, h, 'Seasons Of Persephone'): if random.randint(1, 12) <= wcs.GetLevel(userid, h, 'Seasons Of Persephone'): es.tell(userid, '#multi', '#greenIt\'s Peresphone\'s time to stay in the under world, you have gained extra health and speed') playerlib.getPlayer(userid).set('speed', 1 + (wcs.GetLevel(userid, h, 'Seasons Of Persephone') / 15)) playerlib.getPlayer(userid).set('health', 100 + (wcs.GetLevel(userid, h, 'Seasons Of Persephone') * 5)) if random.randint(1, 2) <= wcs.GetLevel(userid, h, 'Seasons Of Persephone'): es.msg('#multi', '#greenDemeter is sad that Peresphone is gone. A shadow of darkness casts over the sun') for userid in playerlib.getUseridList('#all'): wcs.Command(int(userid)).Blind(25, 150) wcs.Effect().Smoke(int(userid)) money_loop()