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

📄 common.pas

📁 RO模拟器!!适合玩仙境传说的玩家们呦~
💻 PAS
📖 第 1 页 / 共 5 页
字号:
unit Common;



interface

uses
//Windows, Forms, Classes, SysUtils, ScktComp;
	Windows, StdCtrls, MMSystem, Classes, SysUtils, ScktComp,
	GlobalLists,
	List32;

const
	RELEASE_VERSION = '3.0';

	// Colus, 20040304: Let's see if this is truly global scope.
	MAX_SKILL_NUMBER = 411;
	MAX_JOB_NUMBER = 45;
	LOWER_JOB_END = 23;
	UPPER_JOB_BEGIN = 4000;
	MONSTER_ATK_RANGE = 9;

	MAX_PARTY_SIZE = 12;
    MAX_PACKET_NUMBER = $020B; // The highest packet number so far.

	//NPC CType Constants
	//Byte-sized ... Mmmmm-mmm!
	NPC_TYPE_WARP   = $00;
	NPC_TYPE_SHOP   = $01;
	NPC_TYPE_SCRIPT = $02;
	NPC_TYPE_ITEM   = $03;
	NPC_TYPE_SKILL  = $04;

  // Colus, 20040503: This is the default JID for invisible (non-displayed) NPCs.
	// callmob and SendNData will look for this.
  NPC_INVISIBLE = 32767;

	//ChrstphrR source: http://www.stud.ntnu.no/~magnusrk/calc/
	// Race Constants    (DamageFixR)
	RACE_FORMLESS  = 0;
	RACE_UNDEAD    = 1;
	RACE_BRUTE     = 2;
	RACE_PLANT     = 3;
	RACE_INSECT    = 4;
	RACE_FISH      = 5;
	RACE_DEMON     = 6;
	RACE_DEMIHUMAN = 7;
	RACE_ANGEL     = 8;
	RACE_DRAGON    = 9;
	
	// Element Constants (DamageFixE)
	ELE_NEUTRAL = 0;
	ELE_WATER   = 1; //Ice is water...
	ELE_EARTH   = 2;
	ELE_FIRE    = 3;
	ELE_WIND    = 4;
	ELE_POISON  = 5;
	ELE_HOLY    = 6;
	ELE_DARK    = 7;
	ELE_SENSE   = 8;
	ELE_UNDEAD  = 9;

	// Size Constants    (DamageFixS)
	SIZE_SML = 0;
	SIZE_MED = 1;
	SIZE_LRG = 2;

	//MapList Constants for Mode Field.
	MAP_NOTLOADED = 0;
	MAP_LOADING   = 1;
	MAP_LOADED    = 2;


type

TLivingType = ( imaCHARA, imaMOB, imaNPC );

TLiving = class
	public
		ID    : Cardinal;
		JID   : Word;
		Name  : string;
		Map   : string;
		Point : TPoint;
		ppos  : Integer;
		pcnt  : Integer;
		path  : array[0..999] of byte;
		Dir   : Byte;

		LType : TLivingType;
		//ChrstphrR 2004/06/01 -- Added to get rid of Pointer Types
		// The LType will determine what type of object AData etc
end;
//==============================================================================
// word宆嵗昗峔憿懱(TPoint偼cardinal宆嵗昗)
type rPoint = record
	X :word;
	Y :word;
end;
//------------------------------------------------------------------------------
// 僸乕僾峔憿懱(宱楬扵嶕梡)
type rHeap = record
	cost1   :word;
	cost2   :word;
	x       :word;
	y       :word;
	mx      :word;
	my      :word;
	dir     :byte;
	path    :array[0..255] of byte;
	pcnt    :byte;
end;
//------------------------------------------------------------------------------
// 宱楬扵嶕梡儅僢僾僨乕僞
type rSearchMap = record
	cost : Word;
	path : array[0..255] of Byte;
	pcnt : Byte;
	addr : Byte;
end;
//------------------------------------------------------------------------------
{ Item Database
These objects are linked to either the ItemDB or ItemDBName lists, and referred
to by the Data reference in the actual instances of items in the game.
}
type TItemDB = class
	ID        :word;
	Name      :string;
	JName     :string;
	IType     :byte;
	IEquip    :boolean;
	Price     :cardinal;
	Sell      :cardinal;
	Weight    :word;
	ATK       :word;
	MATK      :word;
	DEF       :word;
	MDEF      :word;
	Range     :byte;
	Slot      :byte;
	Param     :array[0..5] of shortint;
	HIT       :smallint;
	FLEE      :smallint;
	Crit      :byte;
	Avoid     :byte;
	Cast      :cardinal;
	Job       :Int64;
	Gender    :byte;
	Loc       :word;
	wLV       :byte;
	eLV       :byte;
	View      :byte;
	Element   :byte;
	Effect    :byte;
	HP1       :word;
	HP2       :word;
	SP1       :word;
	SP2       :word;
	//Rare      :boolean;
	//Box       :byte;
{曄峏}
  // Colus, 20040130: Changing these to smallints for resistance purposes
	DamageFixR :array[0..9] of SmallInt; // Race mod
	DamageFixE :array[0..9] of SmallInt; // Element mod
	DamageFixS :array[0..2] of SmallInt; // Size mod
	SFixPer1   :array[0..5] of SmallInt; // Option 1 mod
	SFixPer2   :array[0..4] of SmallInt; // Option 2 mod
	DrainFix   :array[0..1] of SmallInt; // Drain amount
	DrainPer   :array[0..1] of SmallInt; // Drain chance
	AddSkill   :array[0..MAX_SKILL_NUMBER] of Word; // Skill addition
	SplashAttack  :boolean;          // Splash attack
	SpecialAttack :integer;
	{
	1 = Knockback
	2 = Fatal Blow, .1% chance of instantly killing monster
	}
	WeaponSkill   :integer;
	WeaponSkillLV :integer;
	WeaponID      :integer;
	NoJamstone    :boolean;

	FastWalk      :boolean;
	NoTarget      :boolean;
	FullRecover   :boolean;
	LessSP        :boolean;
	OrcReflect    :boolean;
	AnolianReflect :boolean;
	UnlimitedEndure :boolean;
	DoppelgagnerASPD :boolean;
	GhostArmor    :boolean;
	NoCastInterrupt :boolean;
	MagicReflect  :boolean;
	SkillWeapon   :boolean;
	GungnirEquipped :boolean;
	LVL4WeaponASPD :boolean;
	PerfectDamage   :boolean;

	public
		Procedure Assign(Source : TItemDB);
End;(* TItemDB *)


//------------------------------------------------------------------------------
// 傾僀僥儉僨乕僞
type TItem = class
	ID        : Word;
	Amount    : Word;
	Equip     : Word;
	Identify  : Byte;
	Refine    : Byte;
	Attr      : Byte;
	Card      : Array[0..3] of Word;
	Data      : TItemDB;
	Stolen    : Cardinal;

public
	Constructor Create;
	Destructor  Destroy; OverRide;

	Procedure ZeroItem;
end;//TItem
//------------------------------------------------------------------------------
{捛壛}
type TItemList = class
	Zeny      : Cardinal;
	Item      : array[1..100] of TItem;
	Weight    : Cardinal;
	MaxWeight : Cardinal;
	Count     : Word;

	Constructor Create;
	Destructor  Destroy; OverRide;
end;//TItemList
{捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{傾僀僥儉惢憿捛壛}
// 惢憿僨乕僞
type TMaterialDB = class
	ID              :word;//惢憿傾僀僥儉偺ID
	ItemLV          :word;//惢憿偵昁梫側僗僉儖儗儀儖(嬥捚偲偺懳墳丄儕僗僩昞帵偍傛傃惉岟棪寁嶼偱巊梡)
	RequireSkill    :word;//惢憿偵昁梫偲偝傟傞僗僉儖(嬥捚偲偺懳墳丄儕僗僩昞帵偍傛傃惉岟棪寁嶼偱巊梡)
	MaterialID      :array[0..2] of word;//惢憿偵昁梫側慺嵽偺ID
	MaterialAmount  :array[0..2] of word;//惢憿偵昁梫側慺嵽偺屄悢
end;
{傾僀僥儉惢憿捛壛僐僐傑偱}
//------------------------------------------------------------------------------

// 儌儞僗僞乕僪儘僢僾傾僀僥儉峔憿懱
type rDropItem = record
	ID     : Word;
	Per    : Cardinal;
	Data   : TItemDB;
	Stolen : Cardinal;
end;
//------------------------------------------------------------------------------
// MapName, TerritoryName
type TTerritoryDB = class
	MapName       :ShortString;
	TerritoryName :ShortString;
end;

//------------------------------------------------------------------------------
type TMobAIDB = class
// ID,SKILL1,LEVEL1,PERCENT1,TYPE1,SKILL2,LEVEL2,PERCENT2,TYPE2,SKILL3,LEVEL3,PERCENT3,TYPE3,SKILL4,LEVEL4,PERCENT4,TYPE4
	ID            : Cardinal;
	Skill         : array[0..7] of integer;
	SkillLv       : array[0..7] of integer;
	PercentChance : array[0..7] of integer;
	//SkillType     : array[0..3] of integer;
end;
//------------------------------------------------------------------------------
type TMobAIDBFusion = class
// ID, Name,	STATUS	SKILL_ID	SKILL_LV	  PERCENT	 CASTING_TIME	  COOLDOWN_TIME		IF IfCondition
	ID        : cardinal;
	Number    : integer;
	Name      : string;
	Status    : string;
	SkillID   : string;
	SkillLV   : integer;
	Percent   : integer;
	//Casting   : integer;
	Cast_Time : integer;
	Cool_Time : integer;
	Dispel    : string;
	IfState   : string;
	IfCond    : string
end;
//------------------------------------------------------------------------------
type TGlobalVars = class
// Variable, Value
	Variable : String;
	Value    : Integer;
end;

// 儌儞僗僞乕僨乕僞儀乕僗
//ID,Name,JName,LV,HP,EXP,JEXP,Range,ATK1,ATK2,DEF1,DEF2,MDEF1,MDEF2,HIT,FLEE,
//Scale,Race,Ele,Mode,Speed,ADelay,aMotion,dMotion,Drop1id,Drop1per,Drop2id,
//Drop2per,Drop3id,Drop3per,Drop4id,Drop4per,Drop5id,Drop5per,Drop6id,Drop6per,
//Drop7id,Drop7per,Drop8id,Drop8per,MEXP,MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per
type TMobDB = class
	ID          :word;
	Name        :string;
	JName       :string;
	LV          :byte;
	HP          :cardinal;
	SP          :cardinal; //New
	EXP         :cardinal;
	JEXP        :cardinal;
	Range1      :byte;
	ATK1        :word;
	ATK2        :word;
	DEF         :byte; //New
	MDEF        :byte; //New
	LUK         :byte; //僋儕曗惓梡LUK
	HIT         :integer;
	FLEE        :integer;
	Param       :array[0..5] of byte; //New
	Range2      :byte; //峌寕奐巒帇奅
	Range3      :byte; //捛旜帇奅

	Scale       :byte;
	Race        :byte;
	Element     :byte;
	Mode        :byte;
	Speed       :word;
	ADelay      :word;
	aMotion     :word;
	dMotion     :word;
	Drop        :array[0..7] of rDropItem;
	Item1       :word; //New
	Item2       :word; //New
	MEXP        :cardinal;
	MEXPPer     :word;
	MVPItem     :array[0..2] of rDropItem;

	isDontMove  :boolean; //Mode &  1 : 堏摦
	isActive    :boolean; //Mode &  4 : 傾僋僥傿僽
{捛壛}
	isLoot      :boolean; //Mode &  2 : 儖乕僩
	isLink      :boolean; //Mode &  8 : 儕儞僋
	AISkill     :TMobAIDB;
	SkillLocations :string;  //Gives a list of where the monsters skills are located
	SkillCount  :integer;
	WaitTick :integer;
	Loaded  :boolean;
	DebugFlag :boolean;
{捛壛僐僐傑偱}
end;
//------------------------------------------------------------------------------
// MNAME,SLAVE_1,SLAVE_2,SLAVE_3,SLAVE_4,SLAVE_5,TOTALNUMSLAVES
type TSlaveDB = class
	Name        : string;
	Slaves      : array[0..4] of Integer;
	TotalSlaves : Integer;
end;
//------------------------------------------------------------------------------
// ID,BROADCAST,ITEMSUMMON,MONSTERSUMMON,CHANGESTATSKILL,CHANGEOPTION,SAVERETURN,CHANGELEVEL,WARP,WHOIS,GOTOSUMMONBANISH,KILLDIEALIVE,CHANGEJOB,CHANGECOLORSTYLE,AUTORAWUNIT,REFINE
type TIDTbl = class
	ID               :integer;
	BroadCast        :integer;
	ItemSummon       :integer;
	MonsterSummon    :integer;
	ChangeStatSkill  :integer;
	ChangeOption     :integer;
	SaveReturn       :integer;
	ChangeLevel      :integer;
	Warp             :integer;
	Whois            :integer;

⌨️ 快捷键说明

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