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 2010-01-16 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
January 16, 2010, 07:18:01 AM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Remember to check on the FAQ before start posting.
It may save you time and effort.
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
This topic has not yet been rated! You have not rated this topic. Select a rating:
Author Topic: DanMister[Heavy Soldier] (python)  (Read 103 times)
DanMister
Level 7 Expert
*****
Online Online

United States United States

Posts: 205


no autographs, please.



Danthescam
danmi5ter
« on: November 28, 2009, 11:31:32 PM »

New Race 'Heavy Soldier' Enjoy!

Code
GeSHi (python):
############################
#   IMPORT
import es
import gamethread
import playerlib
import random
 
import wcs
 
############################
#   PUBLISH INFO
info = es.AddonInfo()
info.name = 'Heavy Soldier'
info.author = 'DanMister'
 
############################
#   RACE INFO
 
RaceName = 'Heavy Soldier'
race = wcs.Race(RaceName)
race.registerWeaponRestriction('allow only',['knife','deagle','m429'])
 
############################
#   SKILL INFO
 
race.registerSkill('Heavy Weapon',1,5,'Gain your heavy weapon, the M429,with extra ammo')
race.registerSkill('Heavy Health',1,6,'Recieve the health and armor a heavy should have')
race.registerSkill('Heavy Hits'1,5,'Do the damage a heavy should do')
race.registerSkill('Plan B'1,6,'Explode, resulting in area damage, and taking away enemy ammo')
race.registerSkill('Heavy Force'1,5,'Push enemy back and take a percentage of their ammo for your own')
 
#############################
#   CODE/PT.1 PLAYER_SPAWN
 
 
def player_spawn(ev):
   userid = ev['userid']
   effect = wcs.effect()
   player = playerlib.getPlayer(userid)
   Weapon = wcs.GetLevel(userid, RaceName, 'Heavy Weapon')
   Health = wcs.GetLevel(userid, RaceName, 'Heavy Health')
   player.setSpeed(.75)
 
   if Weapon > 3 and not Weapon == 0:
       es.server.queuecmd('est_Give %s weapon_m429' % (userid))
       wcs.effect().Misc3(userid, 5, 1)
       player.setPrimaryAmmo(125)
       player.setPrimaryClip(125)
 
   if Weapon = 3:
       es.server.queuecmd('est_Give %s weapon_m429' % (userid))
       wcs.effect().Misc3(userid, 5, 2)
       player.setPrimaryAmmo(150)
       player.setPrimaryClip(150)
 
   if Weapon > 3:
       es.server.queuecmd('est_Give %s weapon_m429' % (userid))
       wcs.effect()Misc3(userid, 5, 3)
       player.setPrimaryAmmo(175)
       player.setPrimaryClip(175)
 
       if Health < 3 and not Health == 0:
           player.setHealth(150)
           player.setArmor(100)
 
       if Health = 3:
           player.setHealth(225)
           player.setArmor(125)
 
       if Health > 3:
           player.setHealth(300)
           player.setArmor(150)
 
 
##############################
#   CODE/PT.2 PLAYER_HURT
 
 
def player_hurt(ev):
   userid = ev['userid']
   attacker = ev['attacker']
   effect = wcs.effect()
   player = playerlib.getPlayer(userid)
   player2 = playerlib.getPlayer(attacker)
   player1 = wcs.Command(userid)
   H-Hits = wcs.GetLevel(userid, RaceName, 'Heavy Hits')
   H-Force = wcs.GetLevel(userid, RaceName, 'Heavy Force')
   chance = random.randint(1,20)
   chance1 = random.randint(1,40)
 
   if H-Hits < 3 and not H-Hits == 0 and H-Hits >= chance:
       player1.Damage(2, 2, (attacker))
       effect.Beam1((attacker), (userid), 5, 0, 100, 100, 0)
 
   if H-Hits = 3 and H-Hits >= chance:
       player1.Damage(3, 2, (attacker))
       effect.Beam1((attacker), (userid), 5, 0, 100, 100, 0)
 
   if H-Hits > 3 H-Hits >= chance:
       player1.Damage(4, 2, (attacker))
       effect.Beam1((attacker), (userid), 5, 0, 100, 100, 0)
 
       if H-Force < 3 and not H-Force == 0 and H-Force >= chance1:
           wcs.Command(userid).Push(25, 25, 25)
           player2.setPrimaryAmmo(player.getAmmo(player.getPrimary())*1/8)
           wcs.Command((userid).Drop()
 
       if H-Force = 3 and H-Force >= chance1:
           wcs.Command(userid).Push(30, 30, 30)
           player2.setPrimaryAmmo(player.getAmmo(player.getPrimary())*1/7)
 
       if H-Force > 3 and H-Force >= chance1:
           wcs.Command(userid).Push(35, 35, 35)
           player2.setPrimaryAmmo(player.getAmmo(player.getPrimary())*1/6)
 
 
###############################
#   CODE/PT.3 PLAYER_DEATH
 
 
def player_death(ev):
   player3 = wcs.Command(ev['attacker'])
   Plan-B = wcs.GetLevel(userid, RaceName, 'Plan B')
   userid = ev['userid']
   player = playerlib.getPlayer(userid)
   player4 = playerlib.getPlayer(attacker)
   player5 = playerlib.getPlayer(player.getNearPlayers(150))
   player6 = playberlib.getPlayer(player.getNearPlayers(175))
   player7 = playerlib.getPlayer(player.getNearPlayers(200))
   if Plan-B < 3 and not Plan-B == 0:
       if ['es_userteam'] == '2':
           team = 'c'
       else:
           team = 't'
   player5.setAmmo(player5.getPrimary(), (player5.getAmmo(player5.getPrimary())*2/3))
   player.AreaDamage(team, 150, 50)
 
   if Plan-B = 3:
       if ['es_userteam'] == '2':
           team = 'c'
       else:
           team = 't'
   player6.setAmmo(player6.getPrimary(), (player6.getAmmo(player6.getPrimary())*1/2))
   player.AreaDamage(team, 175, 60)
 
   if Plan-B > 3:
       if ['es_userteam'] == '2':
           team = 'c'
       else:
           team = 't'
       player7.setAmmo(player7.getPrimary(), (player7.getAmmo(player7.getPrimary())*1/3))
       player.AreaDamage(team, 200, 75)
 
################################
#   CODE END. RACE COMPLETE! :D
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
« Last Edit: November 29, 2009, 05:00:12 AM by DanMister » Logged

Quote
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister

Quote
"Genius may have its limitations, but stupidity is not thus handicapped."   Elbert Hubbard
Maxxi
Level 7 Expert
*****
Offline Offline

Netherlands Netherlands

Posts: 1494



WWW
16maxpayne16

myServer 84.243.214.217:27015
(Warning: click connects through Steam)
« Reply #1 on: November 29, 2009, 01:18:23 AM »

check your last race.registerSkill Tongue
Logged

Zawmbee
Guest
« Reply #2 on: November 29, 2009, 01:22:45 AM »

Yeah, that does kind of suck since it is case sensitive...
Logged
DanMister
Level 7 Expert
*****
Online Online

United States United States

Posts: 205


no autographs, please.



Danthescam
danmi5ter
« Reply #3 on: November 29, 2009, 04:58:37 AM »

arg!! i hate that! ... fixed
Logged

Quote
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister

Quote
"Genius may have its limitations, but stupidity is not thus handicapped."   Elbert Hubbard
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
January 14, 2010, 06:18:58 PM
here is the topic i created... please put the skills in there: http://warcraft-source.com/board/index.php/topic,9315.0.html
January 14, 2010, 06:15:26 PM
O.K. I started now the project for a new RaceCreator... I will programm it and upload it then.... would be nice if you could make a topic with all skills texno and all others (sepretated in "player_attacker" etc. )
January 14, 2010, 05:30:29 PM
yeah..
January 14, 2010, 04:11:46 PM
Oh i see... not very much skills / ultimates... and just maximum 4 lvl for the skills lol....
January 14, 2010, 04:08:57 PM
thanks, are there any bugs ?? I can't fix it because first : don't have the programm code and second : don't know if he wrote it in C#...^^
January 14, 2010, 11:37:50 AM
Here's the link... maby you can update it Termi ? "http://warcraft-source.com/board/index.php/topic,6199.0.html"

http://warcraft-source.com/board/index.php/topic,6199.0.html
January 13, 2010, 07:26:02 PM
No prob dude
Recent
[Today at 02:12:10 AM]

[Today at 12:02:45 AM]

[January 15, 2010, 11:58:57 PM]

[January 15, 2010, 11:42:07 PM]

[January 15, 2010, 11:25:21 PM]

[January 15, 2010, 11:04:53 PM]

[January 15, 2010, 10:44:43 PM]

by NeSo
[January 15, 2010, 07:20:35 PM]

[January 15, 2010, 06:07:34 PM]

[January 15, 2010, 05:01:54 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.247 seconds with 25 queries.