Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2009-12-03 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
December 03, 2009, 10:55:30 PM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Join the new Facebook Warcraft-Source.com Group! It has been currently opened!
Join!
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
Current Topic Rating: ***** You have not rated this topic. Select a rating:
Author Topic: New Race!! 'Night Stalker' by DanMister.... (coded in python)  (Read 67 times)
DanMister
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 92


DanMister = python coder. python coder = AWESOME!!



Danthescam
danmi5ter
« on: November 27, 2009, 08:49:31 AM »

hey guys, heres my new race i just whipped up tonight! hope you enjoy! : D


##/EDIT\##
Hey guys, just updated the race. Really hope you guys take a look at it.

##/EDIT\##
updated once again to solve my %'s issue and my misspelling of 'userid' Tongue

Code
GeSHi (python):
##################
# IMPORT MODULES
import es
import random
import gamethread
 
import wcs
##################
#   PUBLISH INFO
info = es.AddonInfo()
info.name = 'NightStalker'
info.author = 'DanMister'
 
##################
#   RACE INFO
#
RaceName = 'NightStalker'
race = wcs.Race(RaceName)
race.registerWeaponRestriction('allow only',['knife','glock','usp','mp5'])
 
###################
#   SILL INFO
 
race.registerSkill('Weapon of choice',5,1,"Recieve your favorite weapon, the mp5")
race.registerSkill('Sneaky Sneaky',5,1,'Invisibily')
race.registerSkill('Spectacles',3,1,'Nightvision(Required for Specatacle Skill)')
race.registerSkill('Spectactle skill',6,1,'Run faster,do more damage if Nightvision is on')
 
###################
#   ULTIMATE INFO
 
race.registerUltimate('Into the shadows',10,6,1,'Teleport into the shadows')
 
###################
#   CODE
 
 
 
def player_spawn(ev):
   userid = int(eventvar['userid'])
   chance1 = random.randint(1,5)
   chance2 = random.randint(1,3)
   chance3 = random.randint(1,6)
   effect = wcs.Effect()
   player  = playerlib.getPlayer(event_var['userid'])
   weapon = wcs.GetLevel(userid, RaceName, 'Weapon of choice')
   Invis = wcs.GetLevel(userid, RaceName, 'Sneaky Sneaky')
   nvg = wcs.GetLevel(userid, RaceName, 'Spectacles')
   nvgSkills = wcs.GetLevel(userid, RaceName, 'Spectacle skill')
 
   if weapon >= chance1:
       es.server.queuecmd('est_Give %s weapon_mp5' % event_var['userid'])
       effect.Ring1(ev['userid'], 150, 5, 0, 0, 0)
       es.tell(userid, '#multi', text('You have recieved your weapon of choice.', lang = playerlib.getPlayer(userid).get("lang") ) )
 
       if Invis >= chance1:
           player.setcolor(255, 255, 255, 100)
           player.setWeaponColor(255, 255, 255, 100)
           es.tell(userid, '#multi', text('Your Invisibility has been set.', lang = playerlib.getPlayer(userid).get("lang") ) )
 
           if nvg >= chance2:
               player.setNightvision(1)
               player.setNightvisionState(1)
               es.tell(userid, '#multi', text('NightVision set.', lang = playerlib.getPlayer(userid).get("lang") ) )
 
                   if nvgSkills >= chance3 and player.getNightvisionState() < 1:
                       player.setSpeed(1.5)
                       es.tell(userid, '#multi', text('NightVision speed skill set', lang = playerlib.getPlayer(userid).get("lang") ) )
 
 
def player_hurt(ev):
   attacker = int(ev['attacker'])
   userid = int(ev['userid'])
   chance = random.randint(1,15)
   effect = wcs.Effect()
   player1 = wcs.Command(userid)
   player  = playerlib.getPlayer(event_var['userid'])
   nvgSkills = wcs.GetLevel(userid, RaceName, 'spectacle skill')
 
   if nvgSkills >= chance and player.getNightvisionState() < 1:
       player1.damage(2, 2, ev['attacker'])
       effect.Beam1(ev['attacker'], ev['userid'], 2, 0, 70, 0)
 
 
def player_ultimate(ev):
   userid = int(ev['userid'])
   player = playerlib.getPlayer(ev['userid'])
   Teleport = wcs.GetLevel(userid, RaceName, 'Into the shadows')
   effect = wcs.Effect()
 
   if Teleport < 3 and not wcs.Command(ev['userid']).GetCoolDown('Into the shadows'):
       player.PushTo(player.getViewCoord(), 100)
       effect.Smoke(ev['userid'])
       wcs.Command(ev['userid']).SetCoolDown('Into the shadows',10)
       es.tell(userid, '#multi', text('You teleported into the shadows', lang = playerlib.getPlayer(userid).get("lang") ) )
 
       if Teleport = 3 and not wcs.Command(ev['userid']).GetCoolDown('Into the shadows'):
           player.PushTo(player.getViewCoord(), 100)
           effect.Smoke(ev['userid'])
           wcs.Command(ev['userid']).SetCoolDown('Into the shadows',5)
           es.tell(userid, '#multi', text('You teleported into the shadows', lang = playerlib.getPlayer(userid).get("lang") ) )
 
           if Teleport > 3 and not wcs.Command(ev['userid']).GetCoolDown('Into the shadows'):
               player.PushTo(player.getViewCoord(), 100)
               effect.Smoke(ev['userid'])
               wcs.Command(ev['userid']).SetCoolDown('Into the shadows',2)
               es.tell(userid, '#multi', text('You teleported into the shadows', lang = playerlib.getPlayer(userid).get("lang") ) )
 
               # AND THATS IT!
               ################################################################
 
« Last Edit: November 28, 2009, 01:07:11 AM by DanMister » Logged

When life gives'ya lemons, throw em at lifes face and be like "WTF! I hate fuckin' lemons!!!!
Zawmbee
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 755


Watch Tower


« Reply #1 on: November 27, 2009, 10:16:56 PM »

better attempt then your last one, keep up the good work...
Logged


(Anyone who C&P's my races, give credit, TY)
CA.Berettonawak
Le renommé méconnu...
Watchdogs
Level 7 Expert
*****
Offline Offline

France France

Posts: 2759


Big Berettonawak is watching you...


WWW
Bifkids
« Reply #2 on: November 27, 2009, 10:24:44 PM »

Quote
    nvgSkills = wcs.GetLevel(useird, RaceName, 'Spectacle skill')
Not sure about this one, but i think you need a space after % to pass arguments.
And in any case you still need one before the %.
        es.server.queuecmd('es_xgive %s weapon_mp5' % event_var['userid'])
Logged

Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice Cheesy
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
DanMister
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 92


DanMister = python coder. python coder = AWESOME!!



Danthescam
danmi5ter
« Reply #3 on: November 28, 2009, 12:54:19 AM »

lol ya i misspelled userid twice then. i corrected myself the first time though Cheesy.
and thanks for the info on the %'s... don't really understand what they do, but none the less!!!

but do you think it was a good race?

and zawmbee what do you mean "better attempt"?? why last attempt was flawless!@#!@#  rofl jk.. jk..
Logged

When life gives'ya lemons, throw em at lifes face and be like "WTF! I hate fuckin' lemons!!!!
Zawmbee
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 755


Watch Tower


« Reply #4 on: November 28, 2009, 02:00:54 AM »

lol ya i misspelled userid twice then. i corrected myself the first time though Cheesy.
and thanks for the info on the %'s... don't really understand what they do, but none the less!!!

but do you think it was a good race?

and zawmbee what do you mean "better attempt"?? why last attempt was flawless!@#!@#  rofl jk.. jk..

I actually wanted you to look through your code yourself and find the mistakes before anyone else could do it for you.  It is always best to keep testing and guessing before resulting to a leap of faith and have others find the problem for you.  I have made a mistake with my coding before, more then once, and it keeps me from wanting to release anything else I make...
Logged


(Anyone who C&P's my races, give credit, TY)
DanMister
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 92


DanMister = python coder. python coder = AWESOME!!



Danthescam
danmi5ter
« Reply #5 on: November 28, 2009, 02:41:25 AM »

well the misspelling of 'userid' i would have found and corrected.

but the %'s bit... ya i would have needed help finding that one anyway.

and zawmbee can you add me on steam? im having trouble finding you. my steam is in my account info.
thanks.
    -Dan-
Logged

When life gives'ya lemons, throw em at lifes face and be like "WTF! I hate fuckin' lemons!!!!
Zawmbee
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 755


Watch Tower


« Reply #6 on: November 28, 2009, 03:19:27 AM »

well the misspelling of 'userid' i would have found and corrected.

but the %'s bit... ya i would have needed help finding that one anyway.

and zawmbee can you add me on steam? im having trouble finding you. my steam is in my account info.
thanks.
    -Dan-

Why are you trying to add me, if you don't mind me asking?
Logged


(Anyone who C&P's my races, give credit, TY)
DanMister
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 92


DanMister = python coder. python coder = AWESOME!!



Danthescam
danmi5ter
« Reply #7 on: November 28, 2009, 03:48:58 AM »

no reason really, quicker response time rofl....im very impatient and, well, forums aren't the fastest way of communication.
Logged

When life gives'ya lemons, throw em at lifes face and be like "WTF! I hate fuckin' lemons!!!!
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
December 02, 2009, 09:04:43 PM
New Mod Available to allow Player Configuration  Settings in Game:

http://warcraft-source.com/board/index.php/topic,8954.0.html
December 02, 2009, 08:31:47 PM
You should waste* some time in school
December 02, 2009, 07:45:33 PM
video games is waisting time....who disagree?
December 01, 2009, 11:00:50 PM
Bedtime, nighty ! Smiley
November 30, 2009, 07:16:39 PM
yello Cheesy
November 30, 2009, 06:34:01 PM
hellow^^
Recent
[Today at 10:07:27 PM]

[Today at 08:48:41 PM]

[Today at 08:10:58 PM]

[Today at 08:05:33 PM]

[Today at 05:21:46 PM]

[Today at 04:52:38 PM]

[Today at 04:16:26 PM]

[Today at 02:55:11 PM]

[Today at 02:45:07 PM]

[Today at 02:29:26 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.288 seconds with 24 queries.