TL2Object = class

Parent class for all objects in adrik.

Name Result Description Code Params Examples
ID Cardinal Object ID in game
property ID: Cardinal;
There are no arguments
if (User.Target.ID = 1472) then  // if target ID  = 1472 then ...
Name String Object name
property Name: String;
There are no arguments
Print(User.Target.Name);  // prints target's name
OID Cardinal Unique identificator for any object in the game
property OID: Cardinal;
There are no arguments
Print('Наш OID: ' +IntToStr(User.OID));  // prints our unique ID
Valid Boolean Check object for existence in the game (relevance \ validity)
property Valid: Boolean;
There are no arguments
if (NpcList(i).Valid) then  // if i-th NPC relevant, then
L2Class TL2Class Get class to which this object belongs
function L2Class: TL2Class;
There are no arguments
if (User.Target.L2Class <> lcChar) then Engine.CancelTarget;  // If our target isnt char, then cancel the target
SetVar - Setting a custom variable to the object
procedure SetVar(Value: Cardinal);

Value - integer value to be given to the object

NpcList(i).SetVar(GetTickCount+60*1000);   // Set value of i-th NPC
GetVar Cardinal Getting a custom variable to the object
function GetVar: Cardinal;
There are no arguments
Print(IntToStr(MobList(i).GetVar));  // prints value of i-th mob

Methods

Name Result Description
TL2List.Items TL2Object Allows to access the object in the list by index