Well, just wondering if someone can look into this race and see any problems there may be... First time coding with python, so I just looked at original coding and put a race together... Appreciate any help, just looking to become educated with both python and regular...
Race: Riddick
Skills: (4)
[Combined Skills from Human Alliance and Night Elf]
1.) Stealth - Evasion and Invisibility mix.
2.) Furion Devotion - Extra Health
3.) Sweet Spot - Extra Damage and Bash mix.
4.) Rage of the Furion - Avatar settings re-arranged and modified.
Race: Riddick
Skills: (4)
[Combined Skills from Human Alliance and Night Elf]
1.) Stealth - Evasion and Invisibility mix.
2.) Furion Devotion - Extra Health
3.) Sweet Spot - Extra Damage and Bash mix.
4.) Rage of the Furion - Avatar settings re-arranged and modified.
Code: [Select]
import es
import random
import playerlib
import gamethread
import wcs
from wcs import wcs
raceName = 'Riddick'
race = wcs.Race(raceName)
""" Load the strings into the variable text """
text = race.loadStrings()
""" ### Begin the configuration ### """
config = race.config()
config.addComment()
config.addComment('********************')
config.addComment('Stealth')
config.addComment(' This skill allows a player to have evasion and an invisibility effect')
config.addComment('********************')
config.addComment()
invisMaxlevel = config.addVar('invisMaxlevel', 6, 'The maximum level of the Invisibility skill')
invisLevelInterval = config.addVar('invisLevelInterval', 2, 'The intervals between the abilities to upgrade their Invisibility skill')
invisibilityRating = config.addVar('invisibilityRating', 30, 'The effect that the invisibility skill will have... A relativly high value is 30, whereas a low value is 10.')
config.addComment()
config.addComment('********************')
config.addComment('Furion Devotion')
config.addComment(' This skill allows a player to spawn with more health')
config.addComment('********************')
config.addComment()
devotMaxlevel = config.addVar('devotMaxlevel', 4, 'The maximum level of the Devotion skill')
devotLevelInterval = config.addVar('devotLevelInterval', 1, 'The intervals between the abilities to upgrade their Devotion skill')
devotHealthIncrement = config.addVar('devotHealthIncrement', 25, 'The amount of health devotion gives the player, multiplied by their level')
config.addComment()
config.addComment('********************')
config.addComment('Sweet Spot')
config.addComment(' This skill has a chance to stun enemies')
config.addComment(' as well as causes internal bleeding')
config.addComment(' every time the player attacks another')
config.addComment('********************')
config.addComment()
sweetMaxlevel = config.addVar('sweetMaxlevel', 4, 'The maximum level of the sweet spot skill')
sweetLevelInterval = config.addVar('sweetLevelInterval', 3, 'The intervals between the abilities to upgrade their sweet spot skill')
sweetPercentage = config.addVar('sweetPercentage', 8, 'The chance a player will use their sweet spot skill, multiplied via their level')
config.addComment()
config.addComment('********************')
config.addComment('Rage of the Furion')
config.addComment(' This ultimate gives the player')
config.addComment(' better attributes for a certain')
config.addComment(' time, including health, speed and')
config.addComment(' extra damage. However, when the effect')
config.addComment(' runs out, the player will be severely')
config.addComment(' vulnerable.')
config.addComment('********************')
config.addComment()
rageMinLevel = config.addVar('rageMinLevel', 8, 'The level required before a player can buy level 1 in the Avatar Skill')
rageMaxLevel = config.addVar('rageMaxLevel', 3, 'The maximum level of the Avatar skill')
rageLevelInterval = config.addVar('rageLevelInterval', 4, 'The intervals between the abilities to upgrade their Avatar skill')
rageDuration = config.addVar('rageDuration', 4, 'The number of seconds multiplied via their level that the Avatar effect will last for')
rageCoolDown = config.addVar('rageCoolDown', 20, 'The amount of seconds after the avatar effect has worn off before the player can use the skill again.')
config.load(True)
""" ### END OF CONFIG ### """
if wcs.game is not 'Pirates, Vikings, and Knights':
race.registerSkill('Stealth', int(invisMaxlevel), int(invisLevelInterval), 'Makes you partially invisible.')
race.registerSkill('Furion Devotion', int(devotMaxlevel), int(devotLevelInterval), 'Gives you additional health each round.')
race.registerSkill('Sweet Spot', int(sweetMaxlevel), int(sweetLevelInterval), 'Have a chance to stun and cause internal bleeding.')
race.registerUltimate('Rage of the Furion', int(rageMinLevel), int(rageLevelInterval), int(rageLevelInterval), 'Feel the Strength of the Furion.')
def player_spawn(ev):
userid = int(ev['userid'])
if not wcs.GetLevel(userid, raceName, 'Stealth'):
wcs.Command(userid).Color(alpha=255)
invisi(userid)
devotion = wcs.GetLevel(userid, raceName, 'Furion Devotion') * int(devotHealthIncrement)
if devotion:
wcs.Command(userid).HealthAdd(devotion)
es.tell(userid, '#multi', text('devotion', {'health' : devotion}, playerlib.getPlayer(userid).get("lang") ) )
wcs.effect.Misc1(userid, 1)
#wcs.Command(userid).UpdateDict('furion', 0)
wcs.Command(userid)['furion'] = 0
def item_pickup(ev):
userid = int(ev['userid'])
#furion = wcs.Command(userid).ReturnDict('furion')
furion = wcs.Command(userid)['furion']
if not furion and wcs.dir != 'pvkii':
invisi(userid)
def prep_hurt(ev):
userid = int(ev['userid'])
attacker = int(ev['attacker'])
if attacker:
damage = int(ev['dmg_health'])
evasion = wcs.GetLevel(userid, raceName, 'Sweet Spot') * 5
if evasion:
if evasion >= random.randint(1,100):
wcs.Command(userid).SaveLife(damage)
es.tell(userid, '#multi', text('evasion', {'damage' : damage}, playerlib.getPlayer(userid).get("lang") ) )
def player_hurt(ev):
userid = int(ev['userid'])
attacker = int(ev['attacker'])
if attacker:
damage = int(ev['dmg_health'])
sweet spot = wcs.GetLevel(attacker, raceName, 'Sweet Spot') * int(sweetPercentage)
extra damage = wcs.GetLevel(attacker, raceName, 'Sweet Spot') * (30 * .01)
if sweet spot >= random.randint(1,100):
wcs.effect.Beam1(userid, attacker, 1.5, 0, 0, 255)
wcs.Command(userid).Damage(damage * trueshot, 32, attacker)
wcs.Command(userid).Freeze(4)
es.tell(attacker, '#multi', text('sweet spot', {'damage' : damage * extra damage}, playerlib.getPlayer(attacker).get("lang") ) )
es.tell(attacker, '#multi', text('sweet spot', {'victim' : es.getplayername(userid)}, playerlib.getPlayer(attacker).get("lang") ) )
wcs.effect.Beam2(attacker, userid, 1.5, 0, 200, 150)
if wcs.dir in ('cstrike', 'dod'):
furion = wcs.GetLevel(attacker, raceName, 'Rage of the Furion')
if furion:
#state = wcs.Command(attacker).ReturnDict('furion')
state = wcs.Command(attacker)['furion']
if state:
wcs.Command(userid).Damage(damage * .3, 32, attacker)
def player_ultimate_on(event_var):
userid = int(event_var['userid'])
furion = wcs.GetLevel(userid, raceName, 'Rage of the Furion') * int(rageDuration)
#if fur and not wcs.Command(userid).ReturnDict('furion'):
if furion and not wcs.Command(userid)['furion']:
es.tell(userid, '#multi', text('furion on', {'time' : furion}, playerlib.getPlayer(userid).get("lang") ) )
command = wcs.Command(userid)
#wcs.Command(userid).UpdateDict('furion', 1)
command['furion'] = 1
command.HealthAdd(100)
command.Color(red=255)
command.Delayed(furion, furoff, userid)
wcs.effect.Ring1(userid, 50, 2, 0, 50, 255)
def invisi(userid):
invis = wcs.GetLevel(userid, raceName, 'Stealth')
if invis:
wcs.Command(userid).Color(alpha = 255 - (invis * int(invisibilityRating) + 90) )
def furoff(userid):
command = wcs.Command(userid)
#state = wcs.Command(userid).ReturnDict('furion')
state = command['furion']
if state:
es.tell(userid, '#multi', text('furion off', lang = playerlib.getPlayer(userid).get("lang") ) )
#command.UpdateDict('furion', 0)
command['furion'] = 0
command.SetCoolDown('Rage of the Furion', int(rageCoolDown) )
invisi(userid)
wcs.effect.Ring1(userid, 50, 2, 0, 255, 50)
if es.getplayerprop(userid, 'CBasePlayer.m_iHealth') >= 101:
wcs.Command(userid).HealthAdd(-100)
else:
wcs.Command(userid).Health(1)
Logged

)![[D-u-G] Danish United Gamers](../board/Themes/default/images/www_sm.gif)