Posted: Wed May 13, 2015 12:54 pm
Is there now any difference between "skill" and "passive"?
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\events\listener.py', line
93, in fire_game_event
callback(game_event)
File '..\addons\source-python\plugins\hw\player.py', line 40, in player_discon
nect
save_player_data(player)
File '..\addons\source-python\plugins\hw\database.py', line 65, in save_player
_data
(player.steamid, player.gold, player.hero.cid)
AttributeError: 'NoneType' object has no attribute 'cid'
This shouldn't really happen, my best quess is you're still using the database from an old version of Hero-Wars. Try deleting hw.db from your \addons\source-python\plugins\hw folder and then try again.SpreadKiller wrote:Thanks, And i've updated and now its spamming this in console, It shows the Menu once and thats all, You wont get EXP or anything :S.Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\events\listener.py', line
93, in fire_game_event
callback(game_event)
File '..\addons\source-python\plugins\hw\player.py', line 40, in player_discon
nect
save_player_data(player)
File '..\addons\source-python\plugins\hw\database.py', line 65, in save_player
_data
(player.steamid, player.gold, player.hero.cid)
AttributeError: 'NoneType' object has no attribute 'cid'
Syntax: Select all
from ..entities import Hero
from ..entities import Skill, callback
from effects.base import TempEntity
from engines.precache import Model
from entities.entity import Entity
from filters.players import PlayerIter
from listeners.tick import Delay, TickRepeat
from messages import SayText2
from random import randint
from time import time
class Orc(Hero):
'Battle-scorned orcs are known to be brutal in combat.'
max_level = 40
required_level = 0
@Orc.skill
class Critical_Strike(Skill):
'You are able to hit vital points, causing major damage.'
max_level = 8
laser = Model('sprites/lgtning.vmt')
@callback('player_spawn', 'player_upgrade_skill')
def _on_spawn_start_repeat(self, player, **eargs):
self._can_crit = True
self._counter = 0
self._repeat = TickRepeat(self._on_game_tick)
self._repeat.start(0.1, 0)
@callback('player_death')
def _on_death_stop_repeat(self, victim, **eargs):
if hasattr(self, '_repeat'):
self._repeat.stop()
@callback('player_pre_attack')
def _on_player_pre_attack(self, attacker, victim, info, **eargs):
if self._can_crit:
info.damage *= 1 + 0.2 * self.level
SayText2(
'+ \x04Critical strike \x05on \x0a{} \x05caused \x02vital damage!'.format(
victim.name)
).send(attacker.index)
self._can_crit = False
self._counter = 0
def _on_game_tick(self):
self._counter += 1
if self._counter == 60 - (self.level * 2):
self._can_crit = True
@Orc.skill
class Earthgrab_Totem(Skill):
'Root your enemies to the ground.'
laser = Model('sprites/lgtning.vmt')
max_level = 8
@callback('player_pre_attack')
def _on_player_pre_attack(self, attacker, victim, **eargs):
if randint(1, 100) <= 16 + self.level and not victim.stuck:
victim.stuck = True
Delay(1.5, victim.__setattr__, 'stuck', False)
SayText2('~ \x04Rooted \x0a{} \x01to the ground.'.format(victim.name)
).send(attacker.index)
@Orc.skill
class Reincarnation(Skill):
'Upon death, the shamans will ressurect you in your old location.'
max_level = 8
@callback('player_pre_victim')
def _on_pre_death_obtain_weapons(self, victim, **eargs):
self._weapons = [Entity(index).class_name for index in victim.weapon_indexes(
not_filters='knife')
]
@callback('player_death')
def _on_death_respawn(self, victim, **eargs):
if randint(1, 100) <= 25 + self.level:
Delay(0.5, victim.respawn)
for index in victim.weapon_indexes(not_filters='knife'):
entity = Entity(index)
Delay(0.7, victim.drop_weapon, entity.pointer, None, None)
for weapon in self._weapons:
Delay(1.2, victim.give_named_item, weapon)
SayText2('~ \x0cRespawning \x04in \x011 \x04second.').send(victim.index)
@Orc.skill
class Chain_Lightning(Skill):
'You channel a lightning rod which ricochets from player to player.'
max_level = 8
laser = Model('sprites/lgtning.vmt')
beam = TempEntity('BeamPoints', alpha=255, red=255, green=200, blue=200,
life_time=1.0, start_width=7, end_width=7, frame_rate=255)
def _find_closest_player(self, player, team, length=99999, exclusions=[]):
_target = None
for target in PlayerIter(not_filters=team):
_distance = player.origin.get_distance(target.origin)
if _distance < length and not target in exclusions:
_target = target
length = _distance
return _target
def _find_chain_players(self, player, length, count):
_last_target = player
team = ['t', 'ct'][player.team-2]
_targets = []
while count > 0:
if not _last_target:
break
_target = self._find_closest_player(_last_target, team, length, _targets)
_targets.append(_target)
_last_target = _target
count -= 1
return _targets
@callback('player_spawn', 'player_upgrade_skill')
def _on_player_spawn_reset(self, player, **eargs):
self._cooldown = False
self._delay = Delay(4, self.__setattr__, '_cooldown', True)
@callback('player_ultimate')
def _on_player_ultimate(self, player, **eargs):
if self._cooldown:
last_target = player
targets = self._find_chain_players(player, 500, 3)
if targets[0] == None:
SayText2('~ \x04Chain Lightning \x01found no enemies!').send(player.index)
return
for target in targets:
if not target:
continue
target.take_damage(20+4*self.level, attacker_index=player.index)
self.beam.start_point = last_target.origin
self.beam.end_point = target.origin
self.beam.model = self.beam.halo = self.laser
self.beam.create()
last_target = target
SayText2('~ \x04Chain Lightning \x02hit enemies!').send(player.index)
self._cooldown = False
self._delay = Delay(15, self.__setattr__, '_cooldown', True)
else:
SayText2('~ \x04Chain Lightning \x01is on \x05cooldown for {} seconds.'.format(
int(self._delay.exec_time-time()))
).send(player.index)
Syntax: Select all
@Orc.skill
class Chain_Lightning(Skill):
'You channel a lightning rod which ricochets from player to player.'
max_level = 8
laser = Model('sprites/lgtning.vmt')
beam = TempEntity('BeamPoints', alpha=255, red=255, green=200, blue=200,
life_time=1.0, start_width=7, end_width=7, frame_rate=255)
@callback('player_ultimate')
def _on_player_ultimate(self, player, **eargs):
...
self.beam.start_point = last_target.origin
self.beam.end_point = target.origin
# This can't be globalized, since the precache tables are freed every
# map change.
self.model = self.halo = self.laser
self.beam.create()
rafau94 wrote:I assume project is dead since your repo is down ?
iPlayer wrote:rafau94 wrote:I assume project is dead since your repo is down ?
I believe it's reincarnated as Warcraft-SP