TL2Char = class(TL2Live)

Class describing all chars

Name Result Description Code Params Examples
CP Cardinal Current CP percentage
function CP: Cardinal;
There are no arguments
if (User.CP < 80) then Engine.UseItem('CP Potion');  //if CP less than 80 percent, use CP Potion
CurCP Cardinal Accurate MP amount
function CurCP: Cardinal;
There are no arguments
while delay(1000) do Print(User.Target.Name +': '+ IntToStr(User.Target.CurCP) +' CP');   // prints target CP every second
MaxCP Cardinal Maximum MP amount
function MaxCP: Cardinal;
There are no arguments
if (User.Target.MaxCP > 99999999999) then Engine.CancelTarget;   // if max target CP amount too large, cancel the target
Hero Boolean Returns true if object is hero
function Hero: Boolean;
There are no arguments
// тут будет пример
Noble Boolean Returns true if object is noble
function Noble: Boolean;
There are no arguments
// тут будет пример
ClassID Cardinal Char class id, check info here
function ClassID: Cardinal;
There are no arguments
if ((User.ClassID = 27) or (User.ClassID = 103)) then Engine.UseSkill(1235);
MainClass Cardinal Main class identifier
function MainClass: Cardinal;
There are no arguments Examples not found
MountType Byte Type of mount
function MountType: Byte;
There are no arguments Examples not found
StoreType Byte Type of store, check TStoreType
function StoreType: Byte;
There are no arguments
Print(Integer(User.StoreType));
Sex Cardinal Char sex (0-male,1-female)
function Sex: Cardinal;
There are no arguments Examples not found
Race Cardinal Char race (0-human, 1-elf, 2-dark elf, 3-orc, 4-dwarf, 5-kamael; 6-ertheia), check TL2Race
function Race: Cardinal;
There are no arguments Examples not found
CubicCount Cardinal Number of cubics
function CubicCount: Cardinal;
There are no arguments Examples not found
Recom Cardinal Number of char recommendations
function Recom: Cardinal;
There are no arguments Examples not found
Premium Boolean Returns true if premium is activated
function Premium: Boolean;
There are no arguments Examples not found
L2Class TL2Class Type of ingame object
function L2Class: TL2Class; override;
There are no arguments Examples not found
BaseClass BaseClass
property BaseClass: TBaseClass read GetClassInfo;
There are no arguments Examples not found
Crest TL2Crest
propertyproper  Crest: TL2Crest read GetCrest;
There are no arguments Examples not found
L2Clan TL2Clan
property L2Clan: TL2Clan read GetClan;
There are no arguments Examples not found

Objects

Name Class Description
CharList TL2List из TL2Char List of players

Methods

Name Result Description
TParty.Leader TL2Char Returns party leader