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 2008-04-10 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
April 10, 2008, 11:54:18 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Remember to check on the FAQ before start posting.
It may save you time and effort.
Also here is the WCS Wiki!
Google  
  Home   Forum   Help Search Login Register   *
Pages: 1 2 [3]   Go Down
  Print  
This topic has not yet been rated! You have not rated this topic. Select a rating:
Author Topic: Firelord, any bugs?  (Read 321 times)
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #30 on: March 08, 2008, 06:11:05 PM »

This is what Jeff and I have got so far after working on it yesterday Fred:

Code
GeSHi (python):
'''
Firelord for WCSP, coded by Hawk. (The_Last_Ghost)
(Also my first race =D)
'
''
import es, wcs, gamethread, random
from wcs import wcs
 
RaceName = 'Firelord'
race = wcs.Race(RaceName)
race.registerMinLevel(50)
 
race.registerSkill('Soul Burn',5,2,'Deal damage over time and slow victim.') #use ability to Soul Burn the enemy you're looking at, damaging and slowing the target. (Can i disable "ability" and "ultimate" for victim?)
race.registerSkill('Consuming Fire',5,3,'Consume the enemy flesh by attacking them to feed your eternal fire (Respawns you if you have gathered enough energy, once/round)') #Save the damage you deal into a dictionary, if above 50 then respawn player on death, max 200 spawning hp.
race.registerSkill('Incinerate',6,4,'Deal additional damage for every hit, and explode victim if you kill.') #deal a small amount of extra dmg every hit, if the victim dies, he explodes.
race.registerUltimate('Volcano',8,8,4,'Channel a volcano to damage and stun enemies around you (and a small chance to do instant-kill).') #Channel a volcano, damaging and stunning nearby enemies every 3 seconds for 15 seconds, small chance for instant kill.
 
def player_hurt(ev):
   uid = int(ev['userid'])
   aid = int(ev['attacker'])
   playera = wcs.Command(aid)
   playeru = wcs.Command(uid)
   if ev['es_userteam'] != ev['es_attackerteam'] and aid:
       ConFireOn = playera.ReturnDict('ConFireOn')
       ConFire = wcs.GetLevel(aid, RaceName, 'Consuming Fire')
       if ConFireOn and ConFire:
           damage = int(ev['dmg_health'])
           temp = playera.ReturnDict('ConFireValue')
           damage = damage * 0.2 * ConFire
           if (temp + damage) > 200:
               damage = damage + temp - 200
           playera.ModDict('ConFireValue', damage)
       Incinerate = wcs.GetLevel(aid, RaceName, 'Incinerate')
       if Incinerate:
           damage = int(ev['dmg_health'])
           damage = damage * 0.03 * Incinerate
           playeru.Damage(damage, 32, aid)
           wcs.Effect().Beam2(uid, aid, 0.3, 200, 27, 28)
           if int(ev['es_userdead']):
               erange = Incinerate * 25
               edamage = Incinerate * 7.5
               if int(ev['es_attackerteam']) == 2:
                   targets = '#ct'
               elif int(ev['es_attackerteam']) == 3:
                   targets = '#t'
               randsound = 'weapons/%s' % random.choice(['explode3.wav', 'explode4.wav', 'explode5.wav'])
               es.emitsound(player, uid, randsound, 1.0, erange * 1.25)
               wcs.Effect().Smoke(uid)
               playeru.AreaDamage(targets, erange, edamage)
 
def player_death(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   ConFire = wcs.GetLevel(uid, RaceName, 'Consuming Fire')
   ConFireOn = playeru.ReturnDict('ConFireOn')
   if ConFireOn and ConFire:
       ConFireValue = playeru.ReturnDict('ConFireValue')
       if ConFireValue >= 50:
           es.tell(uid, 'multi', "#lightgreenYour flame builds again, you respawn in 3 seconds.")
           gamethread.delayedname(3, ConFireSpawn, playeru.Spawn)
           gamethread.delayedname(3.2, ConFireSpawn, playeru.Health, confirevalue)
           gamethread.delayedname(3.3, ConFireSpawn, es.emitsound, (player, uid, 'ambient/fire/ignite.wav', 1.0, 200))
           playeru.UpdateDict('ConFireOn', 0)
           playeru.UpdateDict('ConFireValue', 0)
       else:
           es.tell(uid, 'multi', "#lightgreenYou didn't gather enough energy to respawn.")
 
def player_ability_on(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   cooldown = playeru.GetCoolDown('Soul Burn')
   if not cooldown:
       SoulBurn = wcs.GetLevel(uid, RaceName, 'Soul Burn')
       if SoulBurn:
           target = playeru.GetViewPlayer()
           if target:
               playert = wcs.Command(target)
               targetteam = es.getplayerteam(target)
               userteam = es.getplayerteam(uid)
               if targetteam != userteam:
                   duration = SoulBurn * 2
                   slow = SoulBurn * -0.1
                   damage = SoulBurn * 3
                   playert.Drain(damage, 3, duration)
                   playert.SpeedAdd(slow)
                   playert.BlockUlti(duration)
                   playert.BlockAbil(duration)
                   gamethread.delayedname(duration, SoulBurnSpeed, playert.SpeedAdd, -slow)
                   playert.SetCoolDown('Soul Burn', 20)
               else:
                   es.tell(uid, '#multi', '#lightgreenYou must be looking at an enemy target to use #greenSoul Burn!')
           else:
               es.tell(uid, '#multi', '#lightgreenYou must be looking at an enemy target to use #greenSoul Burn!')
 
def player_ultimate_on(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   volcano = wcs.GetLevel(uid, RaceName, 'Volcano')
   cooldown = playeru.GetCoolDown('Volcano')
   if volcano and not cooldown:
       es.tell(uid, '#multi', "#lightgreenYou start channeling a #greenVolcano!")
       es.setplayerprop(uid, 'CBasePlayer.m_fFlags', 32.0)
       playeru.SetCoolDown('Volcano', 30)
       vrange = volcano * 50
       volcanoexec(uid, vrange)
       playeru.UpdateDict('VolcanoOn', 1)
       gamethread.delayedname(12, 'VolcanoOff', player_ultimate_off_force, uid)
 
def player_ultimate_off(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   volcano = wcs.GetLevel(uid, RaceName, 'Volcano')
   if volcano:
       es.cexec(uid, '-ultimate')
       es.tell(uid, '#multi', "#lightgreenYou stop channeling the #greenVolcano!")
       es.server.queuecmd('est_freeze %s 0' % uid)
       playeru.UpdateDict('VolcanoOn', 0)
       name = 'volcano_%s' % uid
       gamethread.cancelDelayed(name)
 
def player_ultimate_off_force(uid):
   volcano = wcs.GetLevel(uid, RaceName, 'Volcano')
   playeru = wcs.Command(uid)
   if volcano:
       es.cexec(uid, '-ultimate')
       es.tell(uid, '#multi', "#lightgreenYou stop channeling the #greenVolcano!")
       es.server.queuecmd('est_freeze %s 0' % uid)
       playeru.UpdateDict('VolcanoOn', 0)
       name = 'volcano_%s' % uid
       gamethread.cancelDelayed(name)
 
def volcanoloop(uid, aid):
   playeru = wcs.Command(uid)
   playera = wcs.Command(aid)
   volcano = wcs.GetLevel(aid, RaceName, 'Volcano')
   damage = volcano * 4
   stun = volcano * 0.2
   instakill = volcano * 0.5
   es.emitsound(player, uid, 'ambient/explosions/explode_8.wav', 1.0, volcano * 55)
   wcs.Effect().Misc5(aid, 2, 3)
   wcs.Effect().Smoke(aid)
   if instakill > random.randint(1, 100):
       health = es.gethealth(uid)
       playeru.Damage(health, 32, aid)
       es.tell(uid, '#multi', "#lightgreenYou have been killed by a volcano rock") #Better luck next time! hehe...
   else:
       playeru.Damage(damage, 32, aid)
       playeru.Freeze(stun)
       es.tell(uid, '#multi', "#lightgreenYou have taken #green%s damage #lightgreenand been #greenstunned for %s seconds #lightgreenby a volcano") % (str(damage), str(stun))
   volcanoon = playera.ReturnDict('VolcanoOn')
   if volcanoon:
       name = 'volcano_%s' % aid
       gamethread.delayedname(3, name, volcanoloop, (uid, aid))
 
def volcanoexec(uid, vrange):
   playeru = wcs.Command(uid)
   userteam = es.getplayerteam(uid)
   if userteam == 2:
       targetteam = '#ct'
   elif userteam == 3:
       targetteam = '#t'
   playeru.Near(vrange, volcanoloop, targetteam)
 
def round_start(ev):
   for uid in es.getUseridList():
       wcs.Command(uid).UpdateDict('ConFireOn', 1)
 
def round_end(ev):
   gamethread.cancelDelayed('SoulBurnSpeed')
   gamethread.cancelDelayed('ConFireSpawn')
   gamethread.cancelDelayed('VolcanoOff')
   for uid in es.getUseridList():
       name = 'volcano_%s' % uid
       gamethread.cancelDelayed(name)
       VolcanoOn = wcs.Command(uid).ReturnDict('VolcanoOn')
       if VolcanoOn:
           player_ultimate_off_force(uid)
 
Logged
freddukes
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 230



« Reply #31 on: March 08, 2008, 06:23:14 PM »

Having a quick scout the only error I can see is in player_death...

There's 3 delaynames, and the names should be inside ' ' but instead they're represented as variables, instead of strings... For all 3 instances, change ConFireSpawn to "ConFireSpawn".... If that don't work, I'll get it up on my server later and test it...

-freddukes
Logged

The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #32 on: March 08, 2008, 07:09:44 PM »

That's an awful lot of bugs ^^

Thx alot to Josh and j3ff for spending so much time testing and fixing bugs...

I myself will be able to do some testing soon i hope, once my m8'es server is up and running.
Logged

- I will tell you what u want to hear, but not mean anything!
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #33 on: March 08, 2008, 10:07:32 PM »

@ Fred

Hey, I changed those 3 instances like you said.

It still gets stuck in a loop the moment you press the ultimate.  It continues through death.  It no longer crashes the server, but it will only stop if you disconnect and reconnect.

No visual errors are shown in the error.log
Logged
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #34 on: March 09, 2008, 02:02:32 AM »

Found some more bugs, and posted them in the bug forum located here.
« Last Edit: March 09, 2008, 02:46:20 AM by joshtrav » Logged
The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #35 on: March 09, 2008, 11:34:27 AM »

w0w, the new way it shows code is fucked, it splits lines where it shouldn't o.O

I'll get on with reading and fixing the code when i get the time, i have been working on an important school project the last week and i'm gonna present it tommorow, so i'm not sure if i have time b4 tuesday... We'll see about it.
Logged

- I will tell you what u want to hear, but not mean anything!
The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #36 on: March 13, 2008, 09:53:07 PM »

Alright, i've looked through the code and posted the updated code on the first post, also gave Joshtrav credits, because i really appreciate his testing!

I've fixed all the errors i could manually find, though as I said earlier, i can't test it so I'm not sure if it's bug-free now.
Logged

- I will tell you what u want to hear, but not mean anything!
Pages: 1 2 [3]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
Today at 08:23:54 PM
not really power, there are bad people and there are people who are killing other people, and there are people who are destroying other people.
Today at 05:07:31 PM
Who's happy ? ^^
Today at 04:45:28 PM
Yea, well be happy that there is still some people whom behave like me... without... the world would be a boring(better) place.... wich sucks...
Today at 02:43:59 PM
i'm not serious, i'm just pointing how do you behave (always)
Today at 10:16:51 AM
all im doing is keeping an uppy attitude... im trying to look a bit positive at this... you arez teh ones always being negative... yo uguys shouldnt be so F*kin Serious...
April 09, 2008, 08:11:39 PM
thats not positive feedback at all, it is just making that guy more frustrated
April 09, 2008, 04:52:39 PM
you mean "postive feedback"?
Recent
by Jeff
[Today at 11:50:15 PM]

[Today at 10:48:04 PM]

by Jeff
[Today at 08:55:56 PM]

by Jeff
[Today at 08:48:07 PM]

[Today at 08:10:58 PM]

[Today at 07:21:15 PM]

by Jeff
[Today at 06:24:17 PM]

[Today at 05:37:32 PM]

[Today at 05:27:50 PM]

[Today at 05:24:58 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.23 seconds with 25 queries.