public PlayerData ReadPlayerData(bool _moveReadPos = true) { try { int pid = ReadInt(); string name = ReadString(); int level = ReadInt(); int map = ReadInt(); PLAYER_SEXES sex = (PLAYER_SEXES)ReadInt(); PLAYER_RACES race = (PLAYER_RACES)ReadInt(); float x = ReadFloat(); float y = ReadFloat(); float z = ReadFloat(); int heading = ReadInt(); float attSpeed = ReadFloat(); float movSpeed = ReadFloat(); ANIMATION_STATES animation_state = (ANIMATION_STATES)ReadInt(); float hp = ReadFloat(); float mana = ReadFloat(); float maxHp = ReadFloat(); float maxMana = ReadFloat(); PlayerStats stats = new PlayerStats(); return(new PlayerData(pid, name, level, map, sex, race, new Vector3(x, y, z), heading, stats, animation_state, 0, 0, maxHp, hp, mana, maxMana)); } catch { Logger.Syserr("Could not read value of type 'PlayerData'!"); return(null); } }
/// <summary>Reads a playerdata object.</summary> /// <param name="_moveReadPos"></param> public PlayerData ReadPlayerData(bool _moveReadPos = true) { try { int pid = ReadInt(); int aid = ReadInt(); int sid = ReadInt(); string name = ReadString(); int level = ReadInt(); int exp = ReadInt(); int vit = ReadInt(); int str = ReadInt(); int _int = ReadInt(); int dex = ReadInt(); int map = ReadInt(); PLAYER_SEXES sex = (PLAYER_SEXES)ReadInt(); PLAYER_RACES race = (PLAYER_RACES)ReadInt(); float x = ReadFloat(); float y = ReadFloat(); float z = ReadFloat(); int heading = ReadInt(); float attSpeed = ReadFloat(); float movSpeed = ReadFloat(); float pAttack = ReadFloat(); float mAttack = ReadFloat(); PlayerStats stats = new PlayerStats(movSpeed, attSpeed, pAttack, mAttack); ANIMATION_STATES animation_state = (ANIMATION_STATES)ReadInt(); float maxHp = ReadFloat(); float maxMana = ReadFloat(); float hp = ReadFloat(); float mana = ReadFloat(); float pDef = ReadFloat(); float mDef = ReadFloat(); return(new PlayerData(pid, name, level, map, sex, race, new System.Numerics.Vector3(x, y, z), heading, stats, animation_state, aid, sid, maxHp, hp, mana, maxMana, exp, vit, str, _int, dex)); } catch { throw new Exception("Could not read value of type 'PlayerData'!"); } }
public PlayerData(int _pid, string _name, int _level, int _map, PLAYER_SEXES _sex, PLAYER_RACES _race, Vector3 _pos, int _heading, PlayerStats _stats, ANIMATION_STATES _animation_state, int _aid = 0, int _sid = 0, float _maxHp = 10, float _hp = 10, float _mn = 10, float _maxMn = 10, int _exp = 0, int _vit = 0, int _str = 0, int _int = 0, int _dex = 0) { this.pid = _pid; this.aid = _aid; this.sid = _sid; this.name = _name; this.level = _level; this.exp = _exp; this.vit = _vit; this.str = _str; this._int = _int; this.dex = _dex; this.map = _map; this.sex = _sex; this.race = _race; this.pos = _pos; this.stats = _stats; this.heading = _heading; this.animation_state = _animation_state; this.maxHp = _maxHp; this.maxMana = _maxMn; this.hp = _hp; this.mana = _mn; }