diff options
author | wushin <pasekei@gmail.com> | 2014-09-26 12:14:03 -0500 |
---|---|---|
committer | wushin <pasekei@gmail.com> | 2014-09-26 12:14:03 -0500 |
commit | c8ae45d091f8a97c5a94d1d8032721984dff94c4 (patch) | |
tree | 76c5e8ed65baee2add9916ae8769debfaa00184a /being.py | |
download | manamarket-c8ae45d091f8a97c5a94d1d8032721984dff94c4.tar.gz manamarket-c8ae45d091f8a97c5a94d1d8032721984dff94c4.tar.bz2 manamarket-c8ae45d091f8a97c5a94d1d8032721984dff94c4.tar.xz manamarket-c8ae45d091f8a97c5a94d1d8032721984dff94c4.zip |
Making ManaMarket Public
Diffstat (limited to 'being.py')
-rw-r--r-- | being.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/being.py b/being.py new file mode 100644 index 0000000..3c70616 --- /dev/null +++ b/being.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +""" + Copyright 2011, Dipesh Amin <yaypunkrock@gmail.com> + Copyright 2011, Stefan Beller <stefanbeller@googlemail.com> + + This file is part of tradey, a trading bot in the mana world + see www.themanaworld.org +""" + +def job_type(job): + if (job <= 25 or (job >= 4001 and job <= 4049)): + return "player" + elif (job >= 46 and job <= 1000): + return "npc" + elif (job > 1000 and job <= 2000): + return "monster" + elif (job == 45): + return "portal" + +class BeingManager: + def __init__(self): + self.container = {} + + def findId(self, name, type="player"): + for i in self.container: + if self.container[i].name == name and self.container[i].type == type: + return i + return -10 + +class Being: + def __init__(self, being_id, job): + self.id = being_id + self.name = "" + self.x = 0 + self.y = 0 + self.action = "" + self.job = job + self.target = 0 + self.type = job_type(job) + +if __name__ == '__main__': + print "Do not run this file directly. Run main.py" |