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

📄 common.pas

📁 RO模拟器!!适合玩仙境传说的玩家们呦~
💻 PAS
📖 第 1 页 / 共 5 页
字号:
	DisableSkillLimit      :boolean;
  Timer                  :boolean;
	FormLeft:integer;
	FormTop:integer;
	FormWidth:integer;
	FormHeight:integer;

	ScriptList :TStringList;

{傾僀僥儉惢憿捛壛}
	MaterialDB :TIntList32;
{傾僀僥儉惢憿捛壛僐僐傑偱}
{僷乕僥傿乕婡擻捛壛}
	PartyNameList	:TStringList;
  CastleList    :TStringList;
  TerritoryList :TStringList;
  EmpList       :TStringList;
{僷乕僥傿乕婡擻捛壛僐僐傑偱}
{僉儏乕儁僢僩}
	PetDB      :TIntList32;
        PetList    :TIntList32;
{僉儏乕儁僢僩偙偙傑偱}
{僠儍僢僩儖乕儉婡擻捛壛}
	ChatRoomList :TIntList32;
	ChatMaxID  : cardinal;
{僠儍僢僩儖乕儉婡擻捛壛僐僐傑偱}
{業揦僗僉儖捛壛}
	VenderList :TIntList32;
{業揦僗僉儖捛壛僐僐傑偱}
{庢堷婡擻捛壛}
	DealingList :TIntList32;
	DealMaxID  :cardinal;
{庢堷婡擻捛壛僐僐傑偱}

	{ChrstphrR 2004/04/19 - Changing SummonMobList for size/algorithm
	improvements}
	SummonMobList : TSummonMobList;
	SummonMobListMVP : TStringList; //Changed for ease of use/cleanup.
	SummonIOBList    : TStringList; //Changed " " " "/"
	SummonIOVList    : TStringList; //Changed " " " "/"
	SummonICAList    : TStringList; //Changed " " " "/"
	SummonIGBList    : TStringList; //Changed " " " "/"
	SummonIOWBList   : TStringList; //Changed " " " "/"

{NPC僀儀儞僩捛壛}
	ServerFlag :TStringList;
	MapInfo    :TStringList;
{NPC僀儀儞僩捛壛僐僐傑偱}
{僊儖僪婡擻捛壛}
	GuildList     :TIntList32;
	NowGuildID    :cardinal;
	GSkillDB      :TIntList32;
	GExpTable     :array[0..50] of cardinal;
{僊儖僪婡擻捛壛僐僐傑偱}
	//Item     :TStringList;
	ItemDB     :TIntList32;
	ItemDBName :TStringList;
	MobDB      :TIntList32;
	MobDBName  :TStringList;
        {Monster Skill Database}
        MobAIDB    :TIntList32;
        //MobAIDBAegis:TStringList;
        MobAIDBFusion:TIntList32;
        GlobalVars:TStringList;
        //PharmacyDB :TIntList32;
  SlaveDBName:TStringList;
  MArrowDB   :TIntList32;
  WarpDatabase:TStringList;
  IDTableDB  :TIntList32;
	SkillDB    :TIntList32;
  SkillDBName:TStringlist;
	Player     :TIntList32;
	PlayerName :TStringList;
	Chara      :TIntList32;
	CharaName  :TStringList;
	CharaPID   :TIntList32;
	Map        :TStringList;
	MapList    :TStringList;

	//NowAccountID :cardinal;
	NowUsers      :word;
	NowLoginID    :cardinal;
	NowCharaID    :cardinal;
	NowNPCID      :cardinal;
	NowItemID     :cardinal;
	NowMobID      :cardinal;
{僉儏乕儁僢僩}
	NowPetID      :cardinal;
{僉儏乕儁僢僩偙偙傑偱}

	DebugCnt      :word;
	id1           :cardinal;
	id2           :cardinal;
	CancelFlag    :boolean;
	ServerRunning :boolean;

	DebugOut      :TMemo;

	ShowDebugErrors : Boolean;
	{ChrstphrR - added 2004/05/09 for Debug messages for Script validation}


	//exp_db
	ExpTable        :array[0..3] of array[0..255] of cardinal;
	//job_db1
	WeightTable     :array[0..MAX_JOB_NUMBER] of word;
	HPTable         :array[0..MAX_JOB_NUMBER] of word;
	SPTable         :array[0..MAX_JOB_NUMBER] of word;
	WeaponASPDTable :array[0..MAX_JOB_NUMBER] of array[0..16] of word;
	//job_db2
	JobBonusTable   :array[0..MAX_JOB_NUMBER] of array[1..255] of byte;
	//wp_db
	WeaponTypeTable :array[0..2] of array[0..16] of word;
	//ele_db
	ElementTable    :array[0..9] of array[0..99] of integer;

	mm              :array[0..60] of array[0..60] of rSearchMap;

	buf             :array[0..32767] of byte;
//  buf2            :array[0..32767] of byte;{ChrstphrR 2004/04/24 - not used!}
	stra            :array[0..32767] of char;
{Things related to Options}
	//僉儍儔僋僞乕弶婜僨乕僞娭楢
	WarpEnabled :boolean;
	WarpItem    :cardinal;
  StartDeathDropItem  :cardinal;
  EndDeathDropItem    :cardinal;
  TokenDrop       :boolean;
	GMCheck         :cardinal; // Can the GM commands be used by non-GM's?
	DebugCMD        :cardinal; // Can use Debug Commands?
	DeathBaseLoss     :integer;
	DeathJobLoss      :integer;
	MonsterMob        :boolean;
	SummonMonsterExp  :boolean;
	SummonMonsterAgo  :boolean;
	SummonMonsterName :boolean;
	SummonMonsterMob  :boolean;
	GlobalGMsg        :string;
	MapGMsg           :string;
{Things related to Options}

// Fusion SQL Declarations
UseSQL            :Boolean;
DbHost            :String;
DbUser            :String;
DbPass            :String;
DbName            :String;
// Fusion SQL Declarations

// Fusion INI Declarations
Option_PVP        :boolean;
Option_PVP_Steal  :boolean;
Option_PartyShare_Level :word;
Option_PVP_XPLoss :boolean;

Option_MaxUsers   :word;
Option_AutoSave   :word;
Option_AutoBackup   :word;
Option_WelcomeMsg :boolean;

Option_MOTD        : Boolean;//Master MOTD option
Option_MOTD_Athena : Boolean;//Allows Athena-style MOTD message
// If Athena style is chosen, the limit on the text is 1 line vs 4 without.

Option_GM_Logs     :Boolean;

Option_Pet_Capture_Rate :word;
Option_GraceTime  :cardinal;
Option_GraceTime_PvPG :cardinal;
Option_Username_MF : boolean;
Option_Back_Color : string; //未使用
Option_Font_Color : string; //未使用
Option_Font_Size : integer; //未使用
Option_Font_Face : string;  //未使用
Option_Font_Style : string; //未使用
// Fusion INI Declarations


//------------------------------------------------------------------------------
// 娭悢掕媊
		procedure MapLoad(MapName:string);
		Function  ScriptValidated(MapName : string; FileName : string; Tick : Cardinal) : Boolean;
		procedure MapMove(Socket:TCustomWinSocket; MapName:string; Point:TPoint);
//------------------------------------------------------------------------------
		procedure RFIFOB(index:word; var b:byte);
		procedure RFIFOW(index:word; var w:word);
		procedure RFIFOL(index:word; var l:cardinal);
		function  RFIFOS(index:word; cnt:word):string;
		procedure RFIFOM1(index:word; var xy:TPoint);
		procedure RFIFOM2(index:word; var xy1:TPoint; var xy2:TPoint);
		procedure WFIFOB(index:word; b:byte);
		procedure WFIFOW(index:word; w:word);
		procedure WFIFOL(index:word; l:cardinal);
		procedure WFIFOS(index:word; str:string; cnt:word);
		procedure WFIFOM1(index:word; xy:TPoint; Dir:byte = 0);
		procedure WFIFOM2(index:word; xy1:TPoint; xy2:TPoint);
//------------------------------------------------------------------------------
		procedure PickUpItem(tc:TChara; l:Cardinal);

		procedure CalcAbility(tc:TChara; td:TItemDB; o:Integer = 0);
		procedure CalcEquip(tc:TChara);
		procedure CalcSkill(tc:TChara; Tick:cardinal);
		procedure CalcStat(tc:TChara; Tick:cardinal = 0);

                {Bard Calculations}
                procedure CalcSongSkill(tc:TChara; Tick:cardinal = 0);
                procedure CalcSongStat(tc:TChara; Tick:cardinal = 0);

                {Sage Calculations}
                procedure CalcSageSkill(tc:TChara; Tick:cardinal = 0);

		procedure CalcLvUP(tc1:TChara; EXP:cardinal; JEXP:cardinal);

		procedure SendCGetItem(tc:TChara; Index:word; Amount:word);
		procedure SendCStat(tc:TChara; View:boolean = false);
		procedure SendCStat1(tc:TChara; Mode:word; DType:word; Value:cardinal);
		procedure SendCStoreList(tc:TChara);
		procedure SendCSkillList(tc:TChara);
		procedure SendCData(tc1:TChara; tc:TChara; Use0079:boolean = false);
		procedure SendCMove(Socket: TCustomWinSocket; tc:TChara; before, after:TPoint);
		procedure SendCLeave(tc:TChara; mode:byte);
		procedure SendBCmd(tm:TMap; Point:TPoint; PacketLen:word; tc:TChara = nil; tail:boolean = False);

    procedure SendCAttack1(tc:TChara; dmg0:integer; dmg1:integer; dmg4:integer; dmg5:integer; tm:TMap; ts:TMob; Tick:cardinal);
    procedure SendMAttack(tm:TMap; ts:TMob; tc:TChara; dmg0:integer; dmg4:integer; dmg5:integer; Tick:cardinal);

		procedure SendItemSkill(tc:TChara; s:Cardinal; L:Cardinal = 1);
		procedure SendSkillError(tc:TChara; EType:byte; BType:word = 0);
                procedure SendItemError(tc:TChara; Code:Cardinal);
		function  UseFieldSkill(tc:TChara; Tick:Cardinal) : Integer;
		function  UseTargetSkill(tc:TChara; Tick:Cardinal) : Integer;

		procedure SendCSkillAtk1(tm:TMap; tc:TChara; ts:TMob; Tick:cardinal; dmg:Integer; k:byte; PType:byte = 0);
                procedure SendCSkillAtk2(tm:TMap; tc:TChara; tc1:TChara; Tick:cardinal; dmg:Integer; k:byte; PType:byte = 0);

		procedure CalcSkillTick(tm:TMap; tc:TChara; Tick:cardinal = 0);

    procedure CharaDie(tm:TMap; tc:TChara; Tick:Cardinal; KilledByP:short = 0);
    procedure ItemDrop(tm:TMap; tc:TChara; j:integer; amount:integer);
    procedure CreateGroundItem(tm:TMap; itemID:cardinal; XPoint:cardinal; YPoint:cardinal);
                procedure UpdateStatus(tm:TMap; tc:TChara; Tick:Cardinal);
                procedure UpdateOption(tm:TMap; tc:TChara);
                procedure UpdateIcon(tm:TMap; tc:TChara; icon:word; active:byte = 1);
                procedure SilenceCharacter(tm:TMap; tc:TChara; Tick:Cardinal);
                procedure IntimidateWarp(tm:TMap; tc:TChara);

                procedure UpdateMonsterDead(tm:TMap; ts:TMob; k:integer);   //Kills a monster
				procedure UpdatePetLocation(tm:TMap; tn:TNPC);  //Update the location of a pet
                procedure SendPetRelocation(tm:TMap; tc:TChara; i:integer); //Move a pet
                procedure SendMonsterRelocation(tm:TMap; ts:tMob); //Move a monster
                procedure UpdateMonsterLocation(tm:TMap; ts:TMob);  //Update the location of a monster
                procedure UpdatePlayerLocation(tm:TMap; tc:TChara);  //Update the location of a Player
                procedure UpdateLivingLocation(tm:TMap; tv:TLiving);  //Update the location of a Player

                procedure  PetSkills(tc: TChara; Tick:cardinal);  //Calculate the Pets Skills

                procedure  Monkdelay(tm:TMap; tc:TChara; Delay:integer);

		Procedure UpdateSpiritSpheres(tm:TMap; tc:TChara; spiritSpheres:integer);
		function  DecSP(tc:TChara; SkillID:word; LV:byte) :boolean;
                function  UseItem(tc:TChara; j:integer): boolean;
                function  UseUsableItem(tc:TChara; w:integer) :boolean;
                function  UpdateWeight(tc:TChara; j:integer; td:TItemDB)  :boolean;
                function  GetMVPItem(tc1:TChara; ts:TMob; mvpitem:boolean) :boolean;
                function  StealItem(tc:TChara) :boolean;

    procedure SendLivingDisappear(tm:TMap; tv:TLiving; mode: byte = 0); // Make a Living disappear

		function  SearchCInventory(tc:TChara; ItemID:word; IEquip:boolean):word;
		function  SearchPInventory(tc:TChara; ItemID:word; IEquip:boolean):word;
//------------------------------------------------------------------------------
		//儌儞僗丒NPC
		procedure SendMData(Socket:TCustomWinSocket; ts:TMob; Use0079:boolean = false);
		procedure SendMMove(Socket: TCustomWinSocket; ts:TMob; before, after:TPoint; ver2:Word);
    procedure SendNData(Socket:TCustomWinSocket; tn:TNPC; ver2:Word; Use0079:boolean = false);
{僉儏乕儁僢僩}
                procedure SendPetMove(Socket: TCustomWinSocket; tc:TChara; target:TPoint);
{僉儏乕儁僢僩偙偙傑偱}
//------------------------------------------------------------------------------
    //抧揰僗僉儖
		function  SetSkillUnit(tm:TMap; ID:cardinal; xy:TPoint; Tick:cardinal; SType:word; SCount:word; STime:cardinal; tc:TChara = nil; ts:TMob = nil; SText:string = ''):TNPC;
		procedure DelSkillUnit(tm:TMap; tn:TNPC; tc:TChara);
//------------------------------------------------------------------------------
    //強帩傾僀僥儉
		Function  MoveItem(
                Dest    : TItemList;
                Source  : TitemList;
                Index   : Word;
                Quant   : Word
              ) : Integer;
		function  GetItemStore(
                AList   : TItemList;
                AnItem  : TItem;
                Quant   : Word;
                IsEquip : Boolean = False
              ) : Integer;
		function  DeleteItem(
                AList : TItemList;
                Index : Word;
                Quant : Word
              ) : Integer;
		function  SearchInventory(
                AList   : TItemList;
                ItemID  : Word;
                IEquip  : Boolean
                ) : Word;//SearchCInventory()摍偲巊偄曽偼摨偠
		procedure CalcInventory( AList : TItemList );
    
		procedure SendCart(tc:TChara);
//------------------------------------------------------------------------------
{僷乕僥傿乕婡擻捛壛}
    //僷乕僥傿乕
		procedure PartyDistribution(Map:string; tpa:TParty; EXP:Cardinal = 0; JEXP:Cardinal = 0);
		procedure SendPartyList(tc:TChara);
		procedure SendPCmd(tc:TChara; PacketLen:word; InMap:boolean = false; AvoidSelf:boolean = false);
{僷乕僥傿乕婡擻捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{僠儍僢僩儖乕儉婡擻捛壛}
		procedure ChatRoomExit(tc:TChara; AvoidSelf:boolean = false);
		procedure ChatRoomDisp(Socket: TCustomWinSocket; tc1:TChara);
		procedure SendCrCmd(tc:TChara; PacketLen:word; AvoidSelf:boolean = false);
		procedure SendNCrCmd(tm:TMap; Point:TPoint; PacketLen:word; tc:TChara = nil; AvoidSelf:boolean = false; AvoidChat:boolean = false);
{僠儍僢僩儖乕儉婡擻捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{業揦僗僉儖捛壛}
		procedure VenderExit(tc:TChara; AvoidSelf:boolean = false);
		procedure VenderDisp(Socket: TCustomWinSocket; tc1:TChara);
{業揦僗僉儖捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{庢堷婡擻捛壛}
		procedure CancelDealings(tc:TChara; AvoidSelf:boolean = false);
{庢堷婡擻捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{NPC僀儀儞僩捛壛}
		function ConvFlagValue(tc:TChara; str:string; mode:boolean = false) : Integer;
{NPC僀儀儞僩捛壛僐僐傑偱}
//------------------------------------------------------------------------------
{僊儖僪婡擻捛壛}
		procedure SendGuildInfo(tc:TChara; Tab:Byte; GuildM:boolean = false; AvoidSelf:boolean = false);
		procedure SendGuildMCmd(tc:TChara; PacketLen:word; AvoidSelf:boolean = false);
		procedure CalcGuildLvUP(tg:TGuild; tc:TChara; GEXP:cardinal);
		procedure SendGLoginInfo(tg:TGuild; tc:TChara);
		function  GetGuildConUsers(tg:TGuild) : word;
    procedure GuildDInvest(tn:TNPC);
    procedure SpawnNPCMob(tn:TNPC;MobName:string;X:integer;Y:integer;SpawnDelay1:cardinal;SpawnDelay2:cardinal);
    procedure SpawnEventMob(tn:TNPC;MobID:cardinal;MobName:string;X:integer;Y:integer;DropItem:cardinal);
    procedure CallGuildGuard(tn:TNPC;guard:integer);
    procedure SetGuildKafra(tn:TNPC;mode:integer);
    procedure EnableGuildKafra(MapName:string;KafraName:string;Mode:integer);
    procedure ClaimGuildCastle(ID:cardinal;MapName:string);
    function  GetGuildKafra(tn:TNPC) : integer;
    function  GetGuildID(tn:TNPC) : word;
    function  GetGuildEDegree(tn:TNPC) : cardinal;
    function  GetGuildETrigger(tn:TNPC) : word;
    function  GetGuildDDegree(tn:TNPC) : cardinal;
    function  GetGuildDTrigger(tn:TNPC) : word;
    function  CheckGuildID(tn:TNPC; tc:TChara) : word;
    function  CheckGuildMaster(tn:TNPC; tc:TChara) : word;
    function  GetGuildName(tn:TNPC) : string;
    function  GetGuildMName(tn:TNPC) : string;
		function  GetGuildRelation(tg:TGuild; tc:TChara) : integer;
		procedure KillGuildRelation(tg:TGuild; tg1:TGuild; tc:TChara; tc1:TChara; RelType:byte);
		function  LoadEmblem(tg:TGuild) : word;
		procedure SaveEmblem(tg:TGuild; size:cardinal);
    procedure UpdateLook(tm:TMap; tv:TLiving; option:byte; val1: word; val2: word = 0; use00c3: boolean = false);
//-----------------

⌨️ 快捷键说明

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