Вы находитесь на странице: 1из 22

C

Lineage 2
Adrenaline
:
ICQ: 292934301

by Novikov

......................................................................................................................................................................................................................................................... 2
........................................................................................................................................................................................................................................................ 3
TL2Control = class ...................................................................................................................................................................................................................................................... 3
TL2Object = class ....................................................................................................................................................................................................................................................... 6
TL2Spawn = class(TL2Object); ................................................................................................................................................................................................................................... 6
TL2Drop = class(TL2Spawn); ...................................................................................................................................................................................................................................... 6
TL2Npc = class(TL2Live); ............................................................................................................................................................................................................................................ 6
TL2Pet = class(TL2Npc); ............................................................................................................................................................................................................................................. 6
TL2Char = class(TL2Live); ........................................................................................................................................................................................................................................... 6
TL2User = class(TL2Char); .......................................................................................................................................................................................................................................... 7
TL2Effect = class(TL2Object); ..................................................................................................................................................................................................................................... 7
TL2Buff = class(TL2Effect); ......................................................................................................................................................................................................................................... 7
TL2Live = class(TL2Spawn); ........................................................................................................................................................................................................................................ 8
TL2Skill = class(TL2Effect); ......................................................................................................................................................................................................................................... 9
TL2Item = class(TL2Object); ....................................................................................................................................................................................................................................... 9
TL2AucItem = class(TL2Item) ..................................................................................................................................................................................................................................... 9
TL2List = class;............................................................................................................................................................................................................................................................ 9
TL2Auction = class(TL2List) ......................................................................................................................................................................................................................................10
TL2WareHouse = class(TL2List) ...............................................................................................................................................................................................................................10
TSpawnList = class(TL2List); .....................................................................................................................................................................................................................................10
TNpcList = class(TL2List); .........................................................................................................................................................................................................................................10
TPetList = class(TL2List); ..........................................................................................................................................................................................................................................10
TCharList = class(TL2List); ........................................................................................................................................................................................................................................10
TDropList = class(TL2List); ........................................................................................................................................................................................................................................10
TSkillList = class(TL2List); .........................................................................................................................................................................................................................................10
TBuffList = class(TL2List); .........................................................................................................................................................................................................................................10
TItemList = class(TL2List); ........................................................................................................................................................................................................................................10
TParty = class; ..........................................................................................................................................................................................................................................................11
TInventory = class; ...................................................................................................................................................................................................................................................11
TConfirmDlg = class..................................................................................................................................................................................................................................................11
ChatMessage ...........................................................................................................................................................................................................................................................11
TL2Script = class .......................................................................................................................................................................................................................................................11
: ......................................................................................................................................................................................................................12
API : ..................................................................................................................................................................................................................................................12
......................................................................................................................................................................................................................................12
.......................................................................................................................................................................................................................12
API ........................................................................................................................................................................................................................................................13
.....................................................................................................................................................................................................................................................................13
. ...............................................................................................................................................................................................................................................14
. ...........................................................................................................................................................................................................................16
TTCPBlockSocket = class ..........................................................................................................................................................................................................................................16
TICQ = class ..............................................................................................................................................................................................................................................................17
....................................................................................................................................................................................................................................................................18
ChatMessage ...........................................................................................................................................................................................................................................................18

Function TL2Live.AbnormalID..................................................................................................................................................................................................................................18
function TL2Control.GetSkillList ..............................................................................................................................................................................................................................18
function TL2Control. GameWindow ........................................................................................................................................................................................................................19
TL2Control.MSG(Who, What : String; Color : Integer); ...........................................................................................................................................................................................19
TL2Live.Teleport... ...................................................................................................................................................................................................................................................19
15 , ..........................................................................................................................................20
.............................................................................................................................................................................................................................................20
..........................................................................................................................................................................21
, ctrl alt shift. ................................................................................................................................................................................................21


TL2Item
TL2Control
TL2Object

TL2Drop
TL2Spawn

TL2Script
TConfirmDlg

TL2Skill
TL2Effect
TL2Buff
TL2Auction
TSpawnList
TNpcList
TPetList

TL2List

TL2Char

TL2User

TL2Npc

TL2Pet

TL2Live

TParty
TInventory

TL2Auction

TCharList
TDropList
TSkillList
TBuffList
TItemList


TL2Control = class

AuctionBuyItem(Item: TL2AucItem): Boolean;

.
Engine.
GetControl(const Name: string):
TL2Control;
, NPC
. TimeOut - (); Ctrl -

AuctionCancelItem(Item: TL2AucItem): Boolean;

AuctionGetMySales: Boolean;

AuctionSearch(const Name: string; Grade:


Integer = -1; PageID: Integer = 0): Boolean;

. Grade: 0 - NG; 1 - D,.., 10 - R99.

AuctionSellItem(Item: TL2Item; Count, Price,


Days: Cardinal; CustomName: string = ''):
Boolean;

, Days: 1, 3, 5, 7

AutoSoulShot(const Name: string; Active:


Boolean): Boolean;

/ .
Name - ; Active - /

AutoTarget(Range: Cardinal = 2000; ZRange:


Cardinal = 300; NotBusy: Boolean = true):
Boolean;

- Range. NotBusy -
"" . (
IgnorList)

TL2Control = class
Assist(const Name: string): Boolean;
Attack(TimeOut: Cardinal = 2000; Ctrl:
Boolean = false): Boolean;

BotWindow: Cardinal;

. GameWindow - true
,
HWND .

ByPassToServer(const S : String) : Boolean;

ByPass

CancelTarget: Boolean;
ClearIgnore;
ClearMail: Boolean;
ClearZone;
ConfirmDialog(Accept: Boolean): Boolean;
ConfirmDlg : TConfirmDlg;
CreateRoom(Text: string; LevelStart,
LevelEnd: Integer): Boolean;



.
.
/
TConfirmDlg;

CloseRoom: Boolean;
CrystalItem(ID : Cardinal) : Boolean;

DismissParty(const Name: string): Boolean;


DismissPet: Boolean;
DismissSum: Boolean;
Dispel(const Name: string): Boolean;
DlgOpen: Boolean;

.
.
, delay ,
True
Name
Count
Name
( )
( )
Name
NPC

DlgSel(const Txt: string; const TimeOut :


Integer = 1000): Boolean; overload;

Txt

BlinkWindow(GameWindow: Boolean): Boolean;

Delay(const time : Cardinal) : Boolean;


DestroyItem(const Name: string; Count:
Cardinal): Boolean;

Equipped(const Name: string): Integer;


Index. TimeOut .

.
id ,
.
Enter, Txt, Enter.
.
- - function OnEntry(var Param):
Boolean; Param - .

FaceControl(ID: Integer; Active: Boolean):


Boolean;

/ .

DlgSel(Index: integer; const TimeOut :


Integer = 1000): Boolean; overload;
DlgText: string;
DMoveTo(x, y, z : Integer) : Boolean;
DUseSkill(id : Cardinal; ctrl, Shift :
Boolean) : Boolean;
EnterText(const Txt: string): Boolean;
Entry(var Param): Boolean;

FindEnemy(var Enemy: TL2Live; Obj: TL2Live;


Range: Cardinal = 2000; ZRange: Cardinal =
300): Boolean;

"" Obj
( Obj). - - true,
"" Enemy.

FindPath(StartX, StartY, EndX, EndY: Integer;


PathList: TList): Boolean;

Startx,y Endx,y
PathList .
( L2)
CharIndex
( ),
-1,


Game Protocol
HWND .

GameClose: Boolean;
GameStart(CharIndex: Integer = -1): Boolean;
GameTime: Cardinal;
GameVersion : Cardinal;
GameWindow : Cardinal;
GetCharList: TCharList;
GetDailyItems : Boolean;
GetDropList: TDropList;
GetFaceState(ID: Integer): Boolean;
GetInventory: TInventory;
GetMailItems(MaxLoad: Cardinal = 65;
MaxCount: Cardinal = 1000): Boolean;
GetNpcList: TNpcList;
GetParty: TParty;
GetPetList: TPetList;
GetSkillList: TSkillList;
GetUser: TL2User;
GoHome(ResType: TRestartType = rtTown) :
Boolean;

.
. (FaceControl)

,

User (TL2User) .

InZone(Obj: TL2Spawn): Boolean; overload;

. AutoTarget
AutoPickup
Name. Loot -

?

InZone(X, Y, Z: Integer): Boolean; overload;

IsBusy(Obj: TL2Npc): Boolean;


IsDay: Boolean;
JoinParty(Join: Boolean): Boolean;

LoadZone(const Name: string): Boolean;


MakeItem(Index : Cardinal) : Boolean;

""
?

ID. HighFive


Name.
Settings, .
, ToWH ,
Items ,
.
, Index .

MoveItem(const Name: string; Count: Cardinal;


ToPet: Boolean): Boolean;

/ Name
Count

MoveTo(Obj: TL2Spawn; Dist: Integer):


Boolean; overload;

Obj Dist

MoveTo(ToX: integer; ToY: integer; ToZ:


integer; const TimeOut : Integer = 8000):
Boolean; overload;

. TimeOut

MoveToTarget(Dist: Integer = -100): Boolean;

Dist

Ignore(Obj: TL2Spawn);
InviteParty(const Name: string; Loot:
TLootType = ldLooter): Boolean;

LearnSkill(ID: Cardinal): Boolean;


LeaveParty: Boolean;
LoadConfig(const Name: string): Boolean;
LoadItems(ToWH: Boolean; Items: array of
Cardinal): Boolean;

MSG(Who, What : String; Color : Integer);


NpcExchange(ID: Cardinal; Count: Cardinal):
Boolean;
NpcTrade(Sell: Boolean; items: array of
Cardinal): Boolean;
OpenQuestion: Boolean;

,
.
NPC. ID - id ,
Count - .
Npc. Sell - /. Items -
/.
ID, Count ( )
" " (
)

Pickup(Obj: TL2Drop; Pet: Boolean = false):


Boolean; overload;

Obj. Pet -

Pickup(Range: Cardinal = 250; ZRange:


Cardinal = 150; OnlyMy: Boolean = false; Pet:
Boolean = false): Integer; overload;

- Range. OnlyMy -
. Pet -

PostMessage(Msg: Cardinal; wParam, lParam:


Integer): Integer;
QuestStatus(QuestID: Cardinal; Step:
Integer): Boolean;
Restart: Boolean;
Say(const Text: string; ChatType: Cardinal =
0; const Nick: string = ''): Boolean;

SendMail(const Recipient: string; const


Theme: string; const Content: string; Items:
array of Cardinal; Price: Cardinal = 0):
Boolean;

SendMessage(Msg: Cardinal; wParam, lParam:


Integer): Integer;

. Step .
(
)
.
. Recipient - ; Theme - ;
Content - ; Items - ()
(ID/-); Price - (
" " "
"). ID
,
( ).
- ,
.
- 2.
/ .
.

ServerTime: Cardinal;
SetPartyLeader(const Name: string): Boolean;

Name (
)

SetTarget(const Name: string): Boolean;


overload;

SetTarget(ID: Cardinal): Boolean; overload;

ID.

SetTarget(Obj: TL2Live): Boolean; overload;

Obj .

Sit: Boolean;
Stand: Boolean;

Status: TL2Status;
StopCasting : Boolean;

Unstuck : Boolean;

Unstuck;

UpdateSkillList: Boolean;

, IL .

UseAction(ID: Cardinal; Ctrl: Boolean =


false; Shift: Boolean = false): Boolean;

UseItem(const Name: string; Pet: Boolean =


false): Boolean; overload;

. Pet -

UseItem(ID: Cardinal; Pet: Boolean = false):


Boolean; overload;

ID. Pet -

UseItem(Obj: TL2Item; Pet: Boolean = false):


Boolean; overload;

Obj. Pet -

UseKey(const Key: string; Ctrl: Boolean =


False; Shift: Boolean = False): Boolean;
overload;
UseKey(Key: Word; Ctrl: Boolean = False;
Shift: Boolean = False): Boolean; overload;

. Ctrl, Shift

UseSkill(const Name: string; Ctrl: Boolean =


false; Shift: Boolean = false): Boolean;
overload;

UseSkill(ID: Cardinal; Ctrl: Boolean = false;


Shift: Boolean = false): Boolean; overload;

ID

WaitAction(Actions: TL2Actions; var P1; var


P2; TimeOut: Cardinal = INFINITE):
TL2Action;

TL2Object = class
TL2Object = class
ID: Cardinal;
Name: String;
OID: Cardinal;
Valid: Boolean;
SetVar(Value: Cardinal);
GetVar: Cardinal;
L2Class: TL2Class;


ID

.

()


.

TL2Spawn = class(TL2Object);
TL2Spawn = class(TL2Object);
DistTo(X: Integer; Y: Integer; Z: Integer):
Cardinal; overload;

DistTo(Obj: TL2Spawn): Cardinal; overload;

Obj

InRange(X: Integer; Y: Integer; Z: Integer;


Range: Cardinal; ZRange: Cardinal = 250):
Boolean;

( )

InZone: Boolean;
SpawnTime: Cardinal;
X: Integer;
Y: Integer;
Z: Integer;

TL2Drop = class(TL2Spawn);
TL2Drop = class(TL2Spawn);
Count: int64;
IsMy: Boolean;
Stackable: Boolean;

("" -
, )

TL2Npc = class(TL2Live);
TL2Npc = class(TL2Live);
IsPet: Boolean;
PetType: Cardinal;

NPC

( )

TL2Pet = class(TL2Npc);
TL2Pet = class(TL2Npc);
Fed: Cardinal;

/
()

TL2Char = class(TL2Live);
TL2Char = class(TL2Live);
CP
: Cardinal;
CurCP
: Cardinal;
MaxCP
: Cardinal;
Hero
: Boolean;
Noble
: Boolean;
ClassID : Cardinal;
MainClass: Cardinal;
MountType: Byte;
StoreType: Byte;
Sex
: Cardinal;
Race
: Cardinal;
CubicCount: Cardinal;
Recom: Cardinal;
Premium
: Boolean;


0 1

TL2User = class(TL2Char);
TL2User = class(TL2Char);
CanCryst: Boolean;
Charges: Cardinal;
WeightPenalty: Cardinal;
WeapPenalty: Cardinal;
ArmorPenalty: Cardinal;
DeathPenalty: Cardinal;
Souls: Cardinal;

TL2Effect = class(TL2Object);
TL2Effect = class(TL2Object);
Level: Cardinal;
EndTime: Cardinal;

TL2Buff = class(TL2Effect);
TL2Buff = class(TL2Effect);

TL2Live = class(TL2Spawn);
TL2Live = class(TL2Spawn);
AbnormalID : Cardinal;
Abnormals : TBuffList;
Ally: string;
AllyID: Cardinal;
Attackable: Boolean;
AtkOID: Cardinal;
AtkTime: Cardinal;
Buffs: TBuffList;
Cast: TL2Effect;
Clan: string;
ClanID: Cardinal;
CurHP: Cardinal;
CurMP: Cardinal;
Dead: boolean;
Dropped: Boolean;
Exp: Int64;
EXP2: Int64;
Fishing: Integer;
Fly: Boolean;
HP: Cardinal;
InCombat: Boolean;
IsMember: Boolean;
Karma: Integer;
Level: Byte;
Load: Cardinal;
MaxHP: Cardinal;
MaxMP: Cardinal;
Moved : Boolean;
MP: Cardinal;
MyAtkTime: Cardinal;
PK: Boolean;
PvP: Boolean;
Running: Boolean;
Sitting: Boolean;
SP: Cardinal;
Speed: Double;
Sweepable: Boolean;
Target: TL2Live;
Team: Byte;
TeleportDist: Cardinal;
TeleportTime: Cardinal;
Title: string;
ToX: Integer;
ToY: Integer;
ToZ: Integer;

"" (, ,
..)
. .
+ .

ID
( ctrl)
OID

( ,
)
.
Cast.EndTime > 0,
.

ID



(Dead
True)

This is Fly, a member of class TL2Live.


- HP


( GoD (PK)
())

() (
)

?
- MP
?
Player Killer
PvP

?
SP
?

( ),
""



.

TL2Skill = class(TL2Effect);
TL2Skill = class(TL2Effect);
Disabled: Boolean;
Enchanted: Boolean;
Passive: Boolean;



This is Enchanted, a member of class TL2Skill.

TL2Item = class(TL2Object);
TL2Item = class(TL2Object);
Count: Int64;
Equipped: Boolean;
EnchantLevel: Word;
ItemType : Cardinal;
Grade: Cardinal;
GradeName: string;


( )

This is EnchantLevel, a member of class TL2Item.
0 ; 1 ; 2 ; 5
('NG', 'D', 'C', 'B', 'A', 'S', 'S80', 'S84', 'R', 'R95', 'R99');

TL2AucItem = class(TL2Item)
TL2AucItem = class(TL2Item)
LotType: Cardinal;
Seller: string;
Price: Int64;

.
0,

Days: Cardinal;

EndTime: Cardinal;

TL2List = class;
TL2List = class;
ByID(ID: Cardinal; var Obj): Boolean;
ByName(const Name: string; var Obj): Boolean;
Count: integer;
Items(Index: integer): TL2Object;


, : , , , ,
.
ID. ,
Obj.
. ,
Obj.

TL2Auction = class(TL2List)

.
- Search GetMySales.
TL2Auction = class(TL2List)

function Search(const Name: string; Grade:
Integer = -1; PageID: Integer = 0): Boolean;
function SellItem(Item: TL2Item; Count,
Price, Days: Cardinal; CustomName: string =
''): Boolean;

Auction.

Grade: 0 - NG; 1 - D,.., 10 - R99.

Days: 1, 3, 5, 7

function BuyItem(Item: TL2AucItem): Boolean;


function GetMySales: Boolean;

function CancelItem(Item: TL2AucItem):


Boolean;
property Items: TL2AucItem;

TL2WareHouse = class(TL2List)
TL2WareHouse = class(TL2List)
property WHType: Word
property Adena: Int64
Items(Index: integer): TL2Item;

TL2Item

TSpawnList = class(TL2List);
TSpawnList = class(TL2List);
Items(Index: integer): TL2Spawn;

TNpcList = class(TL2List);
TNpcList = class(TL2List);
Items(Index: integer): TL2Npc;

NPC.
NpcList

TPetList = class(TL2List);
TPetList = class(TL2List);
Items(Index: integer): TL2Pet;

.
PetList

TCharList = class(TL2List);
TCharList = class(TL2List);
Items(Index: integer): TL2Char;

.
CharList

TDropList = class(TL2List);
TDropList = class(TL2List);
Items(Index: integer): TL2Drop;

.
DropList

TSkillList = class(TL2List);
TSkillList = class(TL2List);
Items(Index: integer): TL2Skill;

.
SkillList

TBuffList = class(TL2List);
TBuffList = class(TL2List);
Items(Index: integer): TL2Buff;

TItemList = class(TL2List);
TItemList = class(TL2List);
Items(Index: integer): TL2Item;

TParty = class;
TParty = class;
Pets: TNpcList;
Chars: TCharList;
LootType: TLootType;
Leader: TL2Char;

.
Party.
.
.
.

TInventory = class;
TInventory = class;
Pet: TItemList;
User: TItemList;
Quest: TItemList;

.
Inventory.

.
()

TConfirmDlg = class
TConfirmDlg = class

MsgID : Cardinal;
ReqID : Cardinal;
Sender: string;
EndTime: Cardinal;
Valid : Boolean;
ChatMessage
ChatMessage
ChatMessage.unread: boolean;
ChatMessage.sender: string;
ChatMessage.text: string;
ChatMessage.chattype: TMessageType;


?
.

.

TL2Script = class
TL2Script = class;
MainProc(Proc: Pointer);

NewThread(Proc: TThreadFunc; Parameter:


Pointer = nil);
Path: String;
PaxFile : String;
Replace(const FullPath : String);
Resume;
Suspend;

Script
. Proc ; Parameter -
( )
. Proc -
(procedure MyThread(Prm: Pointer))
Parameter - (
)
.
.


:
API :

PlaySound(const FileName: string; Loop:
Boolean);
StopSound;
Delay(ms: Cardinal): Boolean;
ExePath: string;
GetHWID : Cardinal;
GetControl(const Name: string): TL2Control;
BotLoginID: Cardinal;


wave (.wav).
Loop - .

.
Adrenaline
.
Engine . Name -
.
ID () .



Engine : TL2Control;
User : TL2User;
Auction : TL2Auction;
SpawnList : TSpawnList;
NpcList : TNpcList;
PetList : TPetList;
CharList : TChatList;
DropList : TDropList;
SkillList : TSkillList;
ItemList : TItemList;
Party : TParty;
Inventory : TInventory;
Script : Tscript;
WareHouse: TL2WareHouse;
ChatMessage : TChatMessage;



MemToHex(const dt; size: Word; sep: char =
#0): String; overload;
MemToHex(const Mem: AnsiString): String;
overload;
HexToMem(const Hex: string; var Buf):
Cardinal; overload;
HexToMem(const Hex: string): AnsiString;
overload;



Engine

API
Captcha API
function Getaptcha(ImageData: TMemoryStream;
APIKey: String; var CaptchaRes: String;
MinLen: integer=0; MaxLen: integer=0;
Numeric: integer=0; Phrase: integer=0;
RegSense: integer=0; Calc: integer=0;
Russian: integer=0): Integer; overload;

function Getaptcha(ImageFile: string;


APIKey: String; var CaptchaRes: String;
MinLen: integer=0; MaxLen: integer=0;
Numeric: integer=0; Phrase: integer=0;
RegSense: integer=0; Calc: integer=0;
Russian: integer=0): Integer; overload;

Getaptcha -
AntiGate.com
:
ImageData - ,
ImageFile -
APIKey
- AntiGate.com

CaptchaRes - , ,

MinLen
-
MaxLen
-
Phrase
- 1,

Regsense - 1,

Numeric
- 1,
, 2
Calc
- 1,

Russian
- 1,
, 2 -
:
CaptchaID, 0

function aptchaBalance(APIKey: String):


String;

CapchaBalance -
:
APIKey
- AntiGate.com

:
, 'N/A'

function GetaptchaReportBad(APIKey: String;


CaptchaID: Integer): String;

CapchaReportBad -

:
APIKey
- AntiGate.com

CaptchaID - ,

:

(OK_REPORT_RECORDED - ), 'N/A'

CaptchaServer

AntiGate.com,

Procedure OnFree;
function OnEntry(var Param)
ShMem: array[0..1000] of integer;

.
.
.
,
. TL2Control, Entry
, TL2Control (
)

.
Enum values
TL2Status = (
lsOff,
lsOnline,
lsOffline
);

TL2Race = (
rtHuman,
rtElf,
rtDarkelf,
rtOrc,
rtDwarf,
rtKamael
);
TLootType = (
ldLooter
ldRandom
ldRandomSpoil
ldOrder
ldOrderSpoil
);
TStoreType = (
stNone,
stSell,
stPrepare,
stBuy,
stUnknown2,
stManufacture,
stUnknown6,
stObservingGames,
stSellPackage
);
TL2Actions = (
laSpawn,
laDelete,
laPetSpawn,
laPetDelete,
laInvite,
laDie,
laRevive,
laTarget,
laUnTarget,
laInGame
laStatus
laBuffs,
laSkills,
laDlg,
laConfirmDlg,
laStop,
laStartAttack,
laStopAttack,
laCast,
laCancelCast,
laTeleport,
laAutoSoulShot,
laNpcTrade,
laSysMsg,
laChat,
laKey
);

+

+

WaitAction
, TL2Spwan

TL2Live

p1 : TConfirmDlg

TL2Live .
TL2Live

p1 = id
, ChatMessage
p1 = id

TRestartType = (
rtTown,
rtClanHoll,
rtCastle,
rtFort,
rtFlags
);

TL2Control.GoHome

TMessageType = (
mtSystem,
mtAll,
mtPrivate,
mtParty,
mtClan,
mtFriend,
mtShout
);

ChatMessage.Type

TL2Class = (
lcError,
lcDrop,
lcNpc,
lcPet,
lcChar,
lcUser,
lcBuff,
lcSkill,
lcItem
);

TL2Object

TTCPBlockSocket = class
TCP.
TTCPBlockSocket = class
constructor Create;
destructor Destroy; override;
procedure CloseSocket; override;
function WaitingData: integer; override;
procedure Listen; override;
function Accept: integer; override;
procedure Connect(IP, Port: string); override;
function SendBuffer(Buffer : pointer; Len :
integer) : integer; override;
Function RecvBuffer(Buffer : pointer; Len :
integer; Timeout : integer) : integer; virtual;
Procedure SendByte(Data : byte); virtual;
Function RecvByte(Timeout : integer) : byte;
virtual;
Procedure SendString(Data : ansistring);
virtual;
Function RecvString(Timeout : integer) :
ansistring; virtual;
Procedure SendInteger(Data : integer); virtual;
Function RecvInteger(Timeout : integer) :
integer;
Property LastError : integer;

TCP

TICQ = class
ICQ.
TICQ = class
constructor Create;
destructor Destroy; override;

property Status: Cardinal;

function Connected: Boolean;


function Connect(UIN : Cardinal; const
Password : string; const Server : string =
'login.icq.com'; Port : Word = 5190; TimeOut
: Byte = 5) : Boolean;
procedure Disconnect;
procedure SendMessage(UIN : Cardinal; const
Msg : string);
procedure OnError(Sender : TObject; ErrorType
: TErrorType; const ErrorMsg : string);
virtual;

procedure OnMessageRecv(Sender : TObject;


Msg, UIN : string); virtual;

procedure OnUserOffline(Sender : TObject; UIN


: string); virtual;

procedure OnServerDisconnect(Sender :
TObject; Reason : LongInt; Description :
string); virtual;

ICQ.

:
ONLINE
= $00000000;
INVISIBLE = $00000100;
AWAY
= $00000001;
NA
= $00000005;
OFFLINE = $FFFFFFFF;
ICQ.
ICQ.
UIN - ICQ .
Password - ICQ.
Server - ICQ.
Port - .
TimeOut - ( ).
.
.
UIN - .
Msg - .
.
ErrorType -
ErrorMsg -
(
override)
.
Msg - .
UIN - .
(
override)
ICQ .
UIN -
(
override)
.
Reason - ()
Description - .
(
override)


ChatMessage
var
Obj: Tl2Live;
begin
while True do
begin
if ChatMessage.Unread and (ChatMessage.Time < 3000) then
begin
if CharList.ByName(ChatMessage.sender, Obj) and not Obj.IsMember then
if Obj.InZone then
begin
print(ChatMessage.sender);
print(ChatMessage.text);
print(ChatMessage.Time);
print(ChatMessage.ChatType);
end;
end;
Delay(111);
end;
end.
, ,
.
Function TL2Live.AbnormalID
Function IsUD(actor : TL2Live) : Boolean;
begin
Result := actor.AbnormalId and $8000000 = $8000000;
end;
// ?
begin
if isUD(User.target) then
print(' ');
end.
. $8000000 AbnormalID,
UD.
:
bleeding = $1;
poison = $2;
redcircle = $4;
ice = $8;
function TL2Control.GetSkillList
TL2Control Engine SkillList.
TL2Control GetSkillList
Function GetSkill(const Control : String; const ID : Cardinal) : TL2Skill;
var
NovObj : TL2Skill;
NovEngine : TL2Control;
begin
NovEngine := GetControl(control);
if Assigned(NovEngine) and NovEngine.GetSkillList.ByID(ID, NovObj) then
Result := NovObj;
end;
begin
if Assigned(GetSkill('MoyaEEshka',1255)) then
GetControl('MoyaEEshka').UseSkill(1255) //Recall
Else
Engine.UseItem(736); //
end.
'MoyaEEshka' Party Recall, ,
.

function TL2Control. GameWindow


HWND ?
WinApi .
function SetForegroundWindow(hwnd: integer) : Boolean; stdcall;
external 'user32.dll';
begin
While Engine.Delay(5000) then
if User.dead then
SetForegroundWindow(Engine.GameWindow);
end.
, .
TL2Control.MSG(Who, What : String; Color : Integer);
.
. :
clBlack = 0; //
clMaroon = 128; //-
clGreen = 32768; //
clOlive = 32896; //
clNavy = 8388608; //-
clPurple = 8388736; //
clTeal = 8421376; //
clGray = 8421504; //
clSilver = 12632256; //
clRed = 255; //
clLime = 65280; //-
clYellow = 65535; //
clBlue = 16711680; //
clFuchsia = 16711935; //
clAqua = 16776960; //

clWhite = 16777215; //
TL2Live.Teleport...
, . .
begin
While Engine.Delay(1000) do
if (GettickCount - User.TeleportTime < 5000) and (User.TeleportDist < 2000) and
(User.TeleportDist > 10) then
//5
begin
print('Teleported!');
PlaySound(exepath + '\sounds\' + 'dc' + '.wav', False);
end;
end.
, Sounds dc.wav.

15 ,
procedure FaceControlForAll(Pos : Boolean);
var
NowEng : TL2Control;
i : Integer;
begin
For i := 0 to Party.Chars.Count - 1 do
begin
NowEng := GetControl(Party.Chars.items(i).name);
if Assigned(NowEng) then
NowEng.FaceControl(0, Pos);
end;
Engine.FaceControl(0, Pos);
end;
procedure MassOff;
var
P1, P2 : Pointer;
begin
While True do
begin
if (Engine.WaitAction([laSysMsg], P1, P2, 500) = laTeleport) and
(TL2Char(P1).IsMember or
(TL2Char(P1) = User)) then
begin
FaceControlForAll(False);
Delay(15000);
FaceControlForAll(True);
end;
end;
end;
//****************************
begin
Script.NewThread(@MassOff);
Delay (-1);
end.

FaceControlForAll , ,
() .


var
I : INteger;
dist : Cardinal;
TrueGvard, CheckGvard : TL2Npc;
const
GvardsArray : array [1..8] of Cardinal =
(30039, 30040, 30041, 30042, 30043, 30044, 30045, 30046);
begin
print(' ');
While User.level > 81 do
begin
dist := 10000;
TrueGvard := nil;
For i := low(GvardsArray) to High(GvardsArray) do
if NpcList.ByID(GvardsArray[i], CheckGvard) and (User.Distto(CheckGvard) < Dist) then
begin
TrueGvard := CheckGvard;
dist := User.Distto(CheckGvard);
end;
if Assigned(TrueGvard) then
begin
Engine.MoveTo(TrueGvard, -5);
Engine.SetTarget(TrueGvard);
Engine.Attack(500, True);
end;
if User.dead then
Engine.GoHome;
end;
end.

, GvardsArray ( ),
.
, .
.


uses
SysUtils, Classes;
var
TargetLogSL : TStringList;
Procedure CheckTarget;
var
i : Integer;
begin
if TargetLogSL.Count > 5 then exit;
i := 0;
While i < CharList.Count do
begin
if ((CharList.Items(i).target.OID = User.OID) or CharList.Items(i).target.IsMember) and not
CharList.Items(i).IsMember then
if TargetLogSL.IndexOf(CharList.Items(i).name) = -1 then
begin
TargetLogSL.Add(CharList.Items(i).name);
print(' : ' + CharList.Items(i).name);
if Engine.SetTarget(CharList.Items(i)) then
Engine.UseAction(65);
break;
end;
inc(i);
end;
end;
Procedure OnFree;
begin
TargetLogSL.Free;
end;
begin
TargetLogSL := TStringList.Create;
While Engine.Delay(100) do
CheckTarget;
TargetLogSL.Free;
end.

, ctrl alt shift.


1.

uses

2.
3.
4.

SysUtils;

5.

function GetKeyState(nVirtKey: integer): byte; stdcall;


external 'user32.dll' name 'GetKeyState' ;

6.
7.

function KeyDown(K : byte) : Boolean;

8.
9.

begin
Result := (K = 128) or (K = 129)

10.

end;

11.
12.

function SHIFT : boolean;

13.

begin

14.
15.

end;

16.
17.

Result := KeyDown(GetKeyState($10));

function CTRL : boolean;

18.

begin

19.
20.

end;

21.
22.

Result := KeyDown(GetKeyState($11));

function ALT : boolean;

23.

begin

24.
25.

end;

Result := KeyDown(GetKeyState($12));

26.
27.

procedure ActionThread(p: pointer); // /

28.

var

29.
30.
31.
32.

KeyCode, i: integer;
begin
while Engine.Status = lsOnline do
begin

// (Online)

33.

Engine.WaitAction([laKey], KeyCode, i);

34.
35.

if ctrl and shift and (KeyCode = $4F) then //ctrl + SHift + "O"

36.
37.

Engine.UseSkill(1398);

38.

if ctrl and alt and (KeyCode = $50) then //ctrl + alt + "P"

39.
40.

Engine.UseSkill(1398);
end;

41.

end;

42.
43.

begin

44.
45.
46.

Script.NewThread(@ActionThread);
Delay(-1); //
end.