📄 common.pas
字号:
GotoSummonBanish :integer;
KillDieAlive :integer;
ChangeJob :integer;
ChangeColorStyle :integer;
AutoRawUnit :integer;
Refine :integer;
PVPControl :integer;
UserControl :integer;
end;
//------------------------------------------------------------------------------
// ID,Create ID,Number Created
TMArrowDB = class
ID : Integer;
CID : array[0..2] of integer;
CNum : array[0..2] of integer;
end;
//------------------------------------------------------------------------------
TWarpDatabase = class
NAME:String; //Name that player will type
MAP :String; //Name of the Actual Map
X :integer; //X Coordinate to warp to
Y :integer; //Y Coordinate to warp to
Cost:integer; //Amount of zeny the warp takes
end;
//------------------------------------------------------------------------------
// 宱尡抣攝暘梡僇僂儞僞
TChara = class; //Forward declaration.
rEXPDist = record
// CData :Pointer;
CData : TChara;
Dmg :integer;
end;
//------------------------------------------------------------------------------
// 儌儞僗僞乕僨乕僞
TMob = class(TLiving)
tgtPoint :TPoint;
NextPoint :TPoint;
Point1 :TPoint;
Point2 :TPoint;
Speed :word;
Stat1 :Byte; // 1 = Stone, 2 = Freeze, 3 = Stun, 4 = Sleep, 5 = ankle snar
Stat2 :Byte; // 1 = Poison, 2 = Curse, 4 = Silence, 8 = Chaos, 16 = Blind
nStat :Cardinal;
BodyTick :Cardinal; // Status change tick1 (for Stat1)
BodyCount :byte; // Colus, 20040505: Counts hits for stat1 effects (current use, SG hitcount)
HealthTick :Array[0..4] of Cardinal; // Status change tick2 (for Stat2 effects)
EffectTick :Array[0..11] of Cardinal; // Skill ticks (0 = Lex Aet, 1=Quagmire, 2=ME, 3=Sanct currently)
isLooting :boolean;
Item :array[1..10] of TItem;
HP :integer;
SpawnDelay1 :cardinal;
SpawnDelay2 :cardinal;
SpawnTick :cardinal;
SpawnType :cardinal;
ATick :cardinal;
NextFlag :boolean;
MoveTick :cardinal;
MoveWait :cardinal;
DeadWait :cardinal;// mf
DmgTick :cardinal; //僲僢僋僶僢僋
AMode :byte;
ATarget :cardinal;
AData :Pointer;
ARangeFlag :boolean;
MMode :byte;
ATKPer :word; //僾儘儃僢僋側偳偵傛傞峌寕椡曗惓
DEFPer :word; //僾儘儃僢僋側偳偵傛傞杊屼椡曗惓
EXPDist :array[0..31] of rEXPDist; //宱尡抣攝暘梡僇僂儞僞
MVPDist :array[0..31] of rEXPDist; //MVP敾掕梡僇僂儞僞
Slaves :Array[1..12] of Cardinal;
Data :TMobDB;
{捛壛}
Element :Byte;
DEF1 :Byte;
DEF2 :Byte;
MDEF1 :Byte;
MDEF2 :Byte;
SlaveCount :Byte;
isSummon :Boolean;
isLeader :boolean;
isEmperium :boolean;
isGuardian :Cardinal;
isSlave :boolean;
isActive :boolean; //Mode & 4 : 傾僋僥傿僽
LeaderID :Cardinal;
EmperiumID :Cardinal;
GID :Cardinal;
NPCID :Cardinal; //庢傝姫偒梡
{NPC僀儀儞僩捛壛}
Event :cardinal;
isCasting :boolean;
Stolen :cardinal;
Status :string; //Lists the monsters Current status
MSkill :integer;
MLevel :integer;
Hidden :boolean;
Cloaked :boolean;
AnkleSnareTick : Cardinal; //Tracks how long ankle snare lasts
MPoint : rPoint;
MTick : Cardinal;
CastTime : Integer;
SkillWaitTick : Cardinal;
NowSkill : Integer;
NowSkillLv : Integer;
SkillSlot : Integer;
// AI : Pointer;
NoDispel : Boolean;
Mode : Integer;
Burned : Boolean;
SkillType : Integer;
// 1 = No target needed
// 2 = Area Effect
// 3 = Target Skill
// 4 = Support skill
CanFindTarget :boolean;
{NPC僀儀儞僩捛壛僐僐傑偱}
constructor Create;
destructor Destroy; override;
{捛壛僐僐傑偱}
end;
//------------------------------------------------------------------------------
{Cute Pet Classes}
// Pet Database
(*=============================================================================*
TPetDB
--
Overview:
--
Represents the data that defines a pet's stats. This info is static,
determined by \database\pet_db.txt
ChrstphrR 2004/05/26 I'm trying to determine the ranges of the values allowed
for these values, so that the object safety checks itself.
At first look, translating the comments... the data seems odd - I'm going to
check into the DB and how it's loaded/used to see if the comments are
-accurate-
--
Revisions:
--
2004/05/26 v0.2 [ChrstphrR] - Initial 'import' of this class.
"/"/26 [ChrstphrR] - Translate SJIS comments to help explain class fields.
"/"/26 [ChrstphrR] - explicity private/protected/public sections in
preparation for converting fields into properties with methods to keep ranges
within values and/or direct SQL queries (once we learn the proper ranges).
*=============================================================================*)
TPetDB = class
private
protected
public
MobID : Word; // ID number
ItemID : Word; // Capture Item ID
EggID : Word; // Egg Item ID
AcceID : Word; // Accessory ID
FoodID : Word; // ItemID of Food Pet eats.
Fullness : Word; // Degree of Fullness (ChrstphrR - what's the range??)
HungryDelay : Word; // Time delay in milliseconds per Hunger change.
Hungry : Word; // Intimacy gain when pet is REALLY hungry
Full : Word; // Intimacy reduction when pet is over-fed.
Reserved : Word; // Time that an intimacy increase lasts ???
Die : Word; // Degree of intimacy lost when owner dies
Capture : Word; // Basic Capture Ratio (0.1% units - 1000 = 100%)
SkillTime : Cardinal; //Tracks how long a skill lasts
// Constructor Create;
// Destructor Destroy; OverRide;
End;(* TPetDB ================================================================*)
(*=============================================================================*
TPet
--
Overview:
--
Represents the pets (as eggs, or fullgrown) that Characters own.
Links to the TPetDB for each species' particular characteristics.
--
Revisions:
--
2004/05/26 v0.2 [ChrstphrR] - Initial 'import' of this class.
"/"/26 [ChrstphrR] - Fullness now a property - range protected 0..100
*=============================================================================*)
TPet = class
private
fFullness : Byte; // Range 0..100 (It's a percentage, in other words)
protected
function GetFullness : Byte;
procedure SetFullness(Value : Byte);
public
PlayerID : Cardinal; // Account the pet is tied to
CharaID : Cardinal; // Actual Character that has pet.
Cart : Byte;
Index : Word;
Incubated : Byte;
PetID : Cardinal;
JID : Word;
Name : string;
Renamed : Byte; // 0 - default pet species name 1 - renamed(fixed)
LV : Word;
Relation : Integer; //. Level of intimacy? (Range 0..1000)
//Fullness : Integer; //. Level of Hunger/Fullness (Range 0..100)
Accessory : Word;
Data : TPetDB;
isLooting : Boolean; //Tracks if the pet is looting
ATarget : Cardinal; //Pets attacking target as well as looting
Item : array[1..25] of TItem; //Items a pet is holding
MobData : TMobDB; //Reference to the Pet's Monster attributes.
SkillTick : Cardinal; //Tracks when to use a skill
SkillActivate : Boolean; //Tracks if the skill is ready to be activated
LastTick : Cardinal; //Used for tracking a minute
Saved : Byte;
Constructor Create;
Destructor Destroy; OverRide;
//Level of Hunger/Fullness - shown at 5 levels on client side, but
// range is between 0..100%
property Fullness : Byte
read GetFullness
write SetFullness
default 25; //Default Fullness level when pet first made.
End;(* TPet ==================================================================*)
{End of Cute Pet Classes}
//------------------------------------------------------------------------------
// 僗僉儖僨乕僞儀乕僗
//N,ID,JName,Type,MLV,SP1,2,3,4,5,6,7,8,9,10,HP,Cast,Lv+,AR,Ele,
//Dat1,2,3,4,5,6,7,8,9,10,Dat2,2,3,4,5,6,7,8,9,10,Req1,LV,Req2,LV,Req3,LV
TSkillDB = class
ID :word;
IDC :string;
Name :string;
SType :byte;
MasterLV :byte;
SP :array[1..10] of word;
HP :word;
UseItem :word; //徚旓傾僀僥儉 715=僣僨儘乕,716=儗僢僪,717=僽儖乕,懠ItemID偺捠傝
CastTime1 :integer; //Base
CastTime2 :integer; //Lv偛偲偺+
CastTime3 :integer; //CastTime壓尷抣
Range :byte;
Element :byte;
Data1 :array[1..10] of integer;
Data2 :array[1..10] of integer;
Range2 :byte;
Icon :word;
Job1 :array[0..MAX_JOB_NUMBER] of boolean;
ReqSkill1 :array[0..9] of word;
ReqLV1 :array[0..9] of word;
Job2 :array[0..MAX_JOB_NUMBER] of boolean;
ReqSkill2 :array[0..9] of word;
ReqLV2 :array[0..9] of word;
end;//TSkillDB
//------------------------------------------------------------------------------
// 僗僉儖僨乕僞
TSkill = class
Lv :word;
Card :boolean;
Plag :boolean;
//Up :byte;
Tick :cardinal; //帪娫惂尷桳傝偺僗僉儖偺儕儈僢僩
EffectLV :word; //帪娫惂尷桳傝偺僗僉儖偺岠壥LV
Effect1 :integer; //帪娫惂尷桳傝偺僗僉儖偺岠壥僨乕僞1
Data :TSkillDB;
end;//TSkill
//------------------------------------------------------------------------------
// Character Data
TPlayer = class; //forward declaration - PData field in TChara
TNPC = class; //forward declaration - PetNPC " " "
TMap = class; //forward declaration - MData " " "
TChara = class(TLiving)
private
fFireWallCount : Byte;
procedure SetFirewallCount( Value : Byte );
public
// Control Variables
Socket :TCustomWinSocket;
PData :TPlayer; // Reference back to owning TPlayer
IP :string;
Login :byte; // 0 = offline; 1 = loading; 2 = online
// Data saved and loaded to/from chara.txt
// Line 1:
CID :cardinal; //CRW - used with party members.
Gender :byte;
BaseLV :word;
BaseEXP :cardinal;
StatusPoint :word;
JobLV :word;
JobEXP :cardinal;
SkillPoint :word;
PLv :word;
Plag :word;
Zeny :cardinal;
Stat1 :cardinal; // Status 1
Stat2 :cardinal; // Status 2
// Colus, 20040204:
// Option is a word-length bitmask. The bits are for the following
// character status conditions:
//
// 01: Sight 02: Hide 04: Cloak 08: Cart 1
// 16: Falcon 32: Peco 64: GM Hide 128: Cart 2
// 256: Cart 3 512: Cart 4 1024: Cart 5 2048: Reverse Orcish
// 4096: ? 8192: Ruwach 16384: Footsteps 32768: Cart 6?
// 0000 | 0000 | 0000 | 0000
// R OCCC CPPF CCHS
// w r543 2Hel 1lig
// c c dcc kdt
// h eon e
//
// OptionKeep is not necessary. All options should be set up
// using ands and ors to change the bitmask.
//
// Example: Cart check: if (Option and $0788);
// Example: Hide check: if (Option and 2);
// Example: Set peco on: tc.Option := tc.Option or 32;
//Option :cardinal;
//Optionkeep :cardinal;
Option :word;
Hidden :boolean;
Paradise :boolean;
Karma :cardinal;
Manner :cardinal;
HP :integer;
MAXHP :word;
SP :integer;
MAXSP :word;
{捛壛}
MAXHPPer :Word;
MAXSPPer :Word;
{捛壛僐僐傑偱}
Speed :word;
Hair :word;
_2 :word;
_3 :word;
Weapon :word;
Shield :word;
Head1 :word;
Head2 :word;
Head3 :word;
HairColor :word;
ClothesColor :word;
ParamBase :array[0..5] of word;
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -