⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slayer.h

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 H
📖 第 1 页 / 共 2 页
字号:
//////////////////////////////////////////////////////////////////////////////// Filename    : Slayer.h// Written By  : Elca// Description ://////////////////////////////////////////////////////////////////////////////#ifndef __SLAYER_H__#define __SLAYER_H__#include "PlayerCreature.h"#include "Zone.h"#include "Assert.h"#include "Inventory.h"#include "PCSlayerInfo.h"#include "PCSlayerInfo2.h"#include "PCSlayerInfo3.h"#include "InventoryInfo.h"#include "ItemLoaderManager.h"#include "GearInfo.h"#include "ExtraInfo.h"#include "OptionInfo.h"#include "RideMotorcycleInfo.h"#include "SlayerSkillInfo.h"#include "CreatureUtil.h"#include "ModifyInfo.h"#include "Mutex.h"#include <hash_map>//#include "RankExpTable.h"#include "SlayerAttrExpTable.h"#include "skill/Skill.h"#include "skill/SkillSlot.h"#include "Gpackets/GCModifyInformation.h"#ifdef __CHINA_SERVER__#define	SLAYER_BOUND_LEVEL			100#define SLAYER_BOUND_ATTR			200#define	SLAYER_BOUND_ATTR_SUM		300#define SLAYER_BOUND_ONE_EXP_ATTR	200#define SLAYER_MAX_LEVEL			150#define SLAYER_MAX_ATTR				295#define	SLAYER_MAX_ATTR_SUM			435#define SLAYER_ONE_EXP_ATTR			400#define	SLAYER_MAX_DOMAIN_LEVEL		150#define SLAYER_MAX_RANK	50#else// 浇饭捞绢绰 档皋牢 饭骇捞 BOUND_LEVEL俊 档崔窍扁 傈鳖瘤绰// 瓷仿摹啊 BOUND_ATTR 捞窍肺, 瓷仿摹 醚钦捞 BOUND_ATTR_SUM 捞窍肺 力茄等促.// BOUND_LEVEL捞 逞篮 第俊绰 MAX_ATTR苞 MAX_ATTR_SUM栏肺 力茄等促.#define	SLAYER_BOUND_LEVEL			100#define SLAYER_BOUND_ATTR			210#define	SLAYER_BOUND_ATTR_SUM		330#define SLAYER_BOUND_ONE_EXP_ATTR	210#define SLAYER_MAX_LEVEL			150#define SLAYER_MAX_ATTR				295#define	SLAYER_MAX_ATTR_SUM			435#define SLAYER_ONE_EXP_ATTR			400#define	SLAYER_MAX_DOMAIN_LEVEL		150#define SLAYER_MAX_RANK	50#endif////////////////////////////////////////////////////////////////////////////////// 厘厚甫 涝绊 哈阑 锭 厘厚 涝绊 哈扁 傈狼 瓷仿摹甫 // 历厘秦 滴扁 困茄 滚欺(?) 努贰胶.////////////////////////////////////////////////////////////////////////////////class SLAYER_RECORD{public:	Attr_t       pSTR[3];	Attr_t       pDEX[3];	Attr_t       pINT[3];	Rank_t    	 Rank;	HP_t         pHP[2];	MP_t         pMP[2];	Damage_t     pDamage[2];	Defense_t    Defense;	Protection_t Protection;	ToHit_t      ToHit;	Speed_t      AttackSpeed;};//////////////////////////////////////////////////////////////////////////////////// Class Slayer;//// Creature 狼 窍困 努贰胶肺 敲饭捞绢啊 炼辆窍绰 PC 捞寸.//////////////////////////////////////////////////////////////////////////////////	class Motorcycle;class Slayer : public PlayerCreature {//////////////////////////////////////////////////////////////// 努贰胶 郴何 惑荐 急攫//////////////////////////////////////////////////////////////public:	enum WearPart 	{ 		WEAR_HEAD, 		WEAR_NECK, 		WEAR_BODY, 		WEAR_LEFTHAND, 		WEAR_RIGHTHAND,		WEAR_HAND3,		WEAR_BELT,		WEAR_LEG,		WEAR_WRIST1, 		WEAR_WRIST2, 						WEAR_FINGER1, 		WEAR_FINGER2, 		WEAR_FINGER3, 		WEAR_FINGER4,		WEAR_FOOT,		WEAR_MAX 	};//////////////////////////////////////////////////////////////// 积己磊/家戈磊//////////////////////////////////////////////////////////////public:	Slayer() throw();	virtual ~Slayer() throw (Error);	//////////////////////////////////////////////////////////////// 窍困 努贰胶 惑加 窃荐//////////////////////////////////////////////////////////////public:	virtual CreatureClass getCreatureClass() const throw() { return CREATURE_CLASS_SLAYER; }	virtual string getCreatureClassString() const throw() { return "CREATURE_CLASS_SLAYER"; }	virtual void registerObject() throw(Error);	virtual void registerInitObject() throw(Error);	virtual bool load() throw (InvalidProtocolException, Error);	void loadItem( bool checkTimeLimit = false ) throw (InvalidProtocolException, Error);	virtual void save() const throw (Error);	virtual void tinysave(const string & field) const throw (Error);//	virtual void tinysave(const char* field) const throw (Error);	void saveSkills(void) const throw (Error);	void saveGears(void) const throw (Error);	void saveExps(void) const throw (Error);	virtual void act(const Timeval& currentTime) throw(Error) {}	virtual string toString() const throw();	virtual Race_t getRace() const { return RACE_SLAYER; }	virtual GuildID_t getCommonGuildID() const { return SlayerCommon; }//////////////////////////////////////////////////////////////// 矫埃力茄 酒捞袍 包访 窃荐//////////////////////////////////////////////////////////////public:	void checkItemTimeLimit() throw (Error);//////////////////////////////////////////////////////////////// 惑怕 包访 窃荐(dead or alive)//////////////////////////////////////////////////////////////public:	virtual bool isDead() const throw() { return m_HP[ATTR_CURRENT] == 0; }	virtual bool isAlive() const throw() { return m_HP[ATTR_CURRENT] != 0; }//////////////////////////////////////////////////////////////// 把葛嚼 包访 窃荐(捞抚, 鼻茄, 己喊, 赣府, 乔何, 傈拳锅龋)//////////////////////////////////////////////////////////////public:	const string& getName() const throw() { return m_Name; }	void setName(const string & name) throw() { m_Name = name; m_Owner = name; }	BYTE getCompetence() const throw() { return m_Competence; }	void setCompetence(BYTE Competence) { m_Competence = Competence; }	BYTE getCompetenceShape() const throw() { return m_CompetenceShape; }	void setCompetenceShape(BYTE CompetenceShape) { m_CompetenceShape = CompetenceShape; }	Sex getSex() const throw() { return m_Sex; }	void setSex(Sex sex) throw() { m_Sex = sex; m_SlayerInfo.setSex(sex); }	void setSex(const string & sex) throw(InvalidProtocolException)	{		if(sex == Sex2String[MALE]) setSex(MALE);		else if(sex == Sex2String[FEMALE]) setSex(FEMALE);		else throw InvalidProtocolException("invalid sex value");	}	HairStyle getHairStyle() const throw() { return m_HairStyle; }	void setHairStyle(HairStyle hairStyle) throw() { m_HairStyle = hairStyle; }	void setHairStyle(const string& hairStyle) throw(InvalidProtocolException)	{		if(hairStyle == HairStyle2String[HAIR_STYLE1])      m_HairStyle = HAIR_STYLE1;		else if(hairStyle == HairStyle2String[HAIR_STYLE2]) m_HairStyle = HAIR_STYLE2;		else if(hairStyle == HairStyle2String[HAIR_STYLE3]) m_HairStyle = HAIR_STYLE3;		else throw InvalidProtocolException("invalid hairstyle value");	}	Color_t getHairColor() const throw() { return m_HairColor; }	void setHairColor(Color_t hairColor) throw() { m_HairColor = hairColor; }	Color_t getSkinColor() const throw() { return m_SkinColor; }	void setSkinColor(Color_t skinColor) throw() { m_SkinColor = skinColor; }//////////////////////////////////////////////////////////////// 傈拳 包访 窃荐//////////////////////////////////////////////////////////////public:	PhoneNumber_t getPhoneNumber() const throw() { return m_PhoneNumber; }	void setPhoneNumber(PhoneNumber_t PhoneNumber) throw() { m_PhoneNumber = PhoneNumber; }		PhoneNumber_t getPhoneSlotNumber(SlotID_t SlotID) throw();	void setPhoneSlotNumber(SlotID_t SlotID, PhoneNumber_t PhoneNumber) throw();	SlotID_t getSlotWithPhoneNumber(PhoneNumber_t PhoneNumber) throw();	SlotID_t findEmptyPhoneSlot() throw();	bool isEmptyPhoneSlot() throw();	bool isSlotByPhoneNumber(PhoneNumber_t PhoneNumber) throw();//////////////////////////////////////////////////////////////// 瓷仿摹 包访 窃荐(STR, DEX, INT)//////////////////////////////////////////////////////////////public:	// 己氢	Alignment_t getAlignment() const throw() { return m_Alignment; }	void setAlignment(Alignment_t Alignment) throw() { m_Alignment = Alignment; }	void saveAlignment(Alignment_t alignment) throw();	Attr_t  getSTR(AttrType attrType = ATTR_CURRENT) const throw() { return m_STR[attrType]; }	void    setSTR(Attr_t attr, AttrType attrType = ATTR_CURRENT) throw() { m_STR[attrType] = attr; }	Exp_t   getSTRGoalExp() const throw() { return m_pAttrs[ATTR_KIND_STR]->getGoalExp(); }	Attr_t  getDEX(AttrType attrType = ATTR_CURRENT) const throw() { return m_DEX[attrType]; }	void    setDEX(Attr_t attr, AttrType attrType = ATTR_CURRENT) throw() { m_DEX[attrType] = attr; }	Exp_t   getDEXGoalExp() const throw() { return m_pAttrs[ATTR_KIND_DEX]->getGoalExp(); }	Attr_t  getINT(AttrType attrType = ATTR_CURRENT) const throw() { return m_INT[attrType]; }	void    setINT(Attr_t attr, AttrType attrType = ATTR_CURRENT) throw() { m_INT[attrType] = attr; }	Exp_t   getINTGoalExp() const throw() { return m_pAttrs[ATTR_KIND_INT]->getGoalExp(); }	Attr_t	getTotalAttr( AttrType attrType = ATTR_CURRENT ) const throw() { return getSTR( attrType ) + getDEX( attrType ) + getINT( attrType ); }	QuestGrade_t getQuestGrade() const throw();	void divideAttrExp(AttrKind kind, Damage_t damage, ModifyInfo& ModifyInfo);	// 拌鞭 眠啊. by sigi. 2002.8.30	// PlayerCreature肺 颗辫. 2004.1 by Sequoia	// 檬焊磊牢啊? 鉴荐 瓷仿摹 钦捞 40 捞窍	bool	isNovice() const;//////////////////////////////////////////////////////////////// 瓷仿摹 包访 窃荐(HP, MP)//////////////////////////////////////////////////////////////public:	HP_t getHP(AttrType attrType = ATTR_CURRENT) const throw() { return m_HP[attrType]; }	void setHP(HP_t hp, AttrType attrType = ATTR_CURRENT) throw() { m_HP[attrType] = hp; }	void setHP(HP_t current, HP_t max) throw() { m_HP[ATTR_CURRENT] = current; m_HP[ATTR_MAX] = max; }	MP_t getMP(AttrType attrType = ATTR_CURRENT) const throw() { return m_MP[attrType]; }	void setMP(MP_t hp, AttrType attrType = ATTR_CURRENT) throw() { m_MP[attrType] = hp; }	void setMP(MP_t current, MP_t max) throw() { m_MP[ATTR_CURRENT] = current; m_MP[ATTR_MAX] = max; }//////////////////////////////////////////////////////////////// 瓷仿摹 包访 窃荐(Damage, CC, Defense, ToHit)//////////////////////////////////////////////////////////////public:	Damage_t     getDamage(AttrType attrType = ATTR_CURRENT) const throw() { return m_Damage[attrType]; }	Protection_t getProtection(void) const throw() { return m_Protection[ATTR_CURRENT]; }	Defense_t    getDefense(void) const throw() { return m_Defense[ATTR_CURRENT]; }	ToHit_t      getToHit(void) const throw() { return m_ToHit[ATTR_CURRENT]; }	Speed_t      getAttackSpeed(void) const throw() { return m_AttackSpeed[ATTR_CURRENT]; }	//////////////////////////////////////////////////////////////// 胶懦 包访 窃荐//////////////////////////////////////////////////////////////public:	Exp_t getGoalExp(SkillDomainType_t Domain) const throw() { return m_GoalExp[Domain]; }	void  setGoalExp(SkillDomainType_t Domain, Exp_t GoalExp) throw() { m_GoalExp[Domain] = GoalExp; }	SkillLevel_t getSkillDomainLevel(SkillDomainType_t skillDomain) const throw() { return m_SkillDomainLevels[skillDomain]; }	void         setSkillDomainLevel(SkillDomainType_t skillDomain, SkillLevel_t skillLevel) throw() { m_SkillDomainLevels[skillDomain] = skillLevel; }	SkillLevel_t getHighestSkillDomainLevel() const throw();	SkillDomainType_t getHighestSkillDomain() const throw();//	SkillExp_t getSkillDomainExp(SkillDomainType_t skillDomain) const throw() { return m_SkillDomainExps[skillDomain]; }//	void       setSkillDomainExp(SkillDomainType_t skillDomain, SkillExp_t skillExp) throw() { m_SkillDomainExps[skillDomain] = skillExp; }//	void setSkillDomain(SkillDomainType_t skillDomain, SkillLevel_t skillLevel, SkillExp_t skillExp) throw() { m_SkillDomainLevels[skillDomain] = skillLevel; m_SkillDomainExps[skillDomain] = skillExp; }	SkillLevel_t getSkillDomainLevelSum() const throw();	Level_t getLevel() const throw() { return (Level_t)getSkillDomainLevelSum(); }	int getQuestLevel() const { return getHighestSkillDomainLevel(); }	void addSkill(SkillSlot* pSkillSlot) throw();	void addSkill(SkillType_t SkillType) throw();	void removeCastleSkill(SkillType_t SkillType) throw();	void removeAllCastleSkill() throw();	SkillSlot* hasSkill(SkillType_t SkillType) const throw() { return getSkill(SkillType); }	SkillSlot* getSkill(SkillType_t SkillType) const throw();	Exp_t getGunBonusExp() const throw() { return m_GunBonusExp; }	void setGunBonusExp(Exp_t GunBonusExp) throw() { m_GunBonusExp = GunBonusExp; }	Exp_t getRifleBonusExp() const throw() { return m_RifleBonusExp; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -