from __future__ import division import wcs, playerlib, es, random, gamethread from wcs import wcs info = es.AddonInfo() info['name'] = "Poseidon 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 #3" p = 'Poseidon' race = wcs.Race(p) raceskill = wcs.Race(p).registerSkill raceskill('Abbundent Resources', 6, 1, "Recieve health bonuses for an abbundent ammount of resourcess") raceskill("Fish's Delight", 8, 2, "Send a wave of fish where you're looking +ability to use") raceskill('Dolphin Strike', 7, 1, "You call upon Dolphins to blast your enemies with ice cold water chance 2-14%") race.registerUltimate("Trident's Wrath", 5, 6, 3, "Create an earthquake and Tidal Wave with your Trident. Hold down +ultimate to charge") race.registerMinLevel(65) trident_power = {} def player_ultimate_on(event_var): global trident_power userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Poseidon': if wcs.GetLevel(userid, p, "Trident's Wrath"): trident_power[userid] = 0 power_time = 0 position = es.getplayerlocation(userid) z = position[2] gamethread.delayedname(0.01, 'trident_power_effect_%s'%userid, trident_power_up_effect, args=(userid)) gamethread.delayedname(0.1, 'trident_power_up_%s'%userid, trident_power_up, args=(userid, power_time, z)) es.server.queuecmd('est_freeze %s 1'%userid) def trident_power_up(userid, power_time, z): global trident_power power_time += 0.1 if power_time <= 3: z += 5 trident_power[userid] += 10 position = es.getplayerlocation(userid) es.server.queuecmd('es_xsetpos %s %s %s %s'%(userid, position[0], position[1], z)) gamethread.delayedname(0.1, 'trident_power_up_%s'%userid, trident_power_up, args=(userid, power_time, z)) if random.randint(1, 2) == 1: es.server.queuecmd('est_god %s 1'%userid) gamethread.delayed(0.4 + (wcs.GetLevel(userid, p, "Trident's Wrath") / 20.0), es.server.queuecmd, 'est_god %s 0'%userid) else: es.cexec(userid, '-Ultimate') def trident_power_up_effect(userid): power = trident_power[userid] if power == 50: wcs.Effect().Ring2(userid, 100, 3.5, 0, 200, 255) elif power == 70: wcs.Effect().Ring2(userid, 105, 3.25, 0, 200, 255) elif power == 100: wcs.Effect().Ring2(userid, 110, 3, 25, 210, 255) elif power == 130: wcs.Effect().Ring2(userid, 115, 2.75, 0, 200, 255) elif power == 150: wcs.Effect().Ring2(userid, 120, 2.5, 50, 220, 255) elif power == 170: wcs.Effect().Ring2(userid, 125, 2.25, 0, 200, 255) elif power == 200: wcs.Effect().Ring2(userid, 130, 2, 75, 230, 255) elif power == 230: wcs.Effect().Ring2(userid, 135, 1.75, 0, 200, 255) elif power == 250: wcs.Effect().Ring2(userid, 140, 1.5, 100, 235, 255) elif power == 270: wcs.Effect().Ring2(userid, 145, 1.25, 0, 200, 255) elif power == 300: wcs.Effect().Ring2(userid, 150, 1, 125, 240, 255) gamethread.delayedname(0.01, 'trident_power_effect_%s'%userid, trident_power_up_effect, args=(userid)) def player_ultimate_off(event_var): global trident_power userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Poseidon': if not wcs.Command(userid).GetCoolDown("Trident's Wrath"): if trident_power[userid] > 30: position = es.getplayerlocation(userid) es.server.queuecmd('es_xsetpos %s %s %s %s'%(userid, position[0], position[1], position[2] - (trident_power[userid] / 3))) wcs.Effect().Ring3(userid, 360, 1, 128, 128, 128) wcs.Effect().RingCustom('#all', 0, 'sprites/purpleglow1.vmt', position[0], position[1], position[2] - (trident_power[userid] / 3), 100, 400, 2, 5, 80, 80, 0, 0, 255, 255, 20) wcs.Effect().RingCustom('#all', 0, 'sprites/purpleglow1.vmt', position[0], position[1], position[2], 100, 400, 2, 5, 80, 80, 40, 240, 255, 255, 20) wcs.Effect().MiscCustom('#a', 0, 'sprites/purpleglow1.vmt', position[0], position[1], position[2], 2, 4.5, 150) gamethread.cancelDelayed('trident_power_effect_%s'%userid) gamethread.cancelDelayed('trident_power_up_%s'%userid) es.server.queuecmd('est_freeze %s 0'%userid) wcs.Command(userid).SetCoolDown("Trident's Wrath", 35) if playerlib.getPlayer(userid).attributes['teamid'] == 2: wcs.Command(userid).Near(trident_power[userid] * 1.6, shake_users, '#ct') elif playerlib.getPlayer(userid).attributes['teamid'] == 3: wcs.Command(userid).Near(trident_power[userid] * 1.6, shake_users, '#t') es.server.queuecmd('est_shake %s 3 25 25'%userid) es.server.queuecmd('es_xfire %s !self DispatchEffect WaterSurfaceExplosion'%userid) gamethread.delayedname(0.1, 'make_zero_%s'%userid, make_zero, args=(userid)) else: es.tell(userid, '#green', 'Ultimate failed, Hold down the +Ultimate key to charge!') wcs.Command(userid).SetCoolDown("Trident's Wrath", 3) gamethread.cancelDelayed('trident_power_effect_%s'%userid) gamethread.cancelDelayed('trident_power_up_%s'%userid) gamethread.delayedname(0.1, 'make_zero_%s'%userid, make_zero, args=(userid)) es.server.queuecmd('est_freeze %s 0'%userid) def make_zero(userid): global trident_power trident_power[userid] = 0 def shake_users(userid, attacker): es.server.queuecmd('est_shake %s 3 25 25'%userid) es.server.queuecmd('es_xfire %s !self DispatchEffect WaterSurfaceExplosion'%userid) es.server.queuecmd('es_xfire %s !self DispatchEffect WaterSurfaceExplosion'%attacker) wcs.Command(userid).Damage((random.randint(1, 10) + (wcs.GetLevel(attacker, p, "Trident's Wrath") * trident_power[attacker]) / 30.0), 32, attacker) def player_ability_on(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Poseidon': range = wcs.GetLevel(userid, p, "Fish's Delight") * 30 if range: if not wcs.Command(userid).GetCoolDown("Fish's Delight"): (x, y, z) = wcs.Command(userid).GetViewCoord() wcs.Command(userid).SetCoolDown("Fish's Delight", 22) if playerlib.getPlayer(userid).attributes['teamid'] == 2: wcs.Command(userid).NearCoord(x, y, z, range, range, range, fish_strike, '#ct') elif playerlib.getPlayer(userid).attributes['teamid'] == 3: wcs.Command(userid).NearCoord(x, y, z, range, range, range, fish_strike, '#t') else: es.tell(userid, '#multi', '#greenSorry, you have to wait #lightgreen%s #greenseconds to use this again'%wcs.Command(userid).GetCoolDown("Fish's Delight")) def fish_strike(userid, attacker): wcs.Command(userid).Damage(5 + wcs.GetLevel(attacker, p, "Fish's Delight") * random.randint(1, 4), 32, attacker) es.server.queuecmd('est_freeze %s 1'%userid) gamethread.delayed(wcs.GetLevel(attacker, p, "Fish's Delight") / 10, es.server.queuecmd, 'est_freeze %s 0'%userid) wcs.Effect().Beam2(userid, attacker, 0.5, 40, 200, 255) gamethread.delayed(0.1, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 40, 200, 255)) gamethread.delayed(0.2, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 40, 240, 255)) gamethread.delayed(0.3, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 0, 0, 255)) gamethread.delayed(0.4, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 100, 250, 255)) gamethread.delayed(0.5, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 0, 255, 0)) position = es.getplayerlocation(userid) wcs.Effect().RingCustom('#all', 0, 'sprites/purpleglow1.vmt', position[0], position[1], position[2], 100, 400, 1.5, 5, 80, 80, 40, 240, 255, 255, 20) def prep_hurt(event_var): userid = int(event_var['userid']) attacker = int(event_var['attacker']) if wcs.GetRace(attacker) == 'Poseidon': ds_level = wcs.GetLevel(attacker, p, 'Dolphin Strike') if ds_level: if random.randint(1, 100) <= ds_level * 2: gamethread.delayed(0.1, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 40, 200, 255)) gamethread.delayed(0.2, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 40, 240, 255)) gamethread.delayed(0.3, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 0, 0, 255)) gamethread.delayed(0.4, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 100, 250, 255)) gamethread.delayed(0.5, wcs.Effect().Beam2, args=(userid, attacker, 0.5, 0, 255, 0)) gamethread.delayed(0.2, wcs.Effect().Misc2, args=(userid, 1, 1)) es.server.queuecmd('est_freeze %s 1'%userid) gamethread.delayed(ds_level / 10, es.server.queuecmd, 'est_freeze %s 0'%userid) def player_disconnect(event_var): global trident_power if trident_power.has_key(int(event_var['userid'])): del trident_power[int(event_var['userid'])] def player_spawn(event_var): userid = int(event_var['userid']) if wcs.GetRace(userid) == 'Poseidon': ar_level = wcs.GetLevel(userid, p, 'Abbundent Resources') if ar_level: if random.randint(1, 4) == 1: playerlib.getPlayer(userid).set('health', 100 + ar_level * random.randint(1, 6)) es.tell(userid, '#green', 'You have recieved a health bonus from your abbundant resource of fish!') wcs.Effect().Misc3(userid, 1, 1) if random.randint(1, 4) == 1: playerlib.getPlayer(userid).set('speed', 1 + (ar_level / random.randint(10, 100))) es.tell(userid, '#green', 'You have recieved a speed bonus from eating a fish on roids!') wcs.Effect().Follow(userid, 255, 0, 0) wcs.Effect().Follow(userid, 0, 255, 0) wcs.Effect().Follow(userid, 0, 0, 255) if random.randint(1, 4) == 1: playerlib.getPlayer(userid).set('cash', (playerlib.getPlayer(userid).get('cash') + (ar_level * random.randint(1, 500)))) es.tell(userid, '#green', 'You have recieved extra cash because a fishing trauler paid you for your fish!') position = es.getplayerlocation(userid) wcs.Effect().RingCustom('#all', 0, 'sprites/purpleglow1.vmt', position[0], position[1], position[2], 50, 200, 1.5, 5, 80, 80, 0, 255, 0, 255, 20)