Рыцарь
Регистрация: 07.03.2009
Сообщений: 9,139
Сказал Спасибо: 70
Имеет 2,820 спасибок в 1,735 сообщенях
|
nab, function writemask and variable UseForConnectName available in 3.5.24.142+
http://l2phx.pp.ru/arhive/
Добавлено через 11 минут
for older ones :
Оффтоп
delphi Код:
const
BufferCharacterName = 'BufferNick!'; // fill this one
var
Names: TStrings;
Timer : ttimer;
ObjectID : integer;
step : integer;
Procedure FighterBuffs(Sender:tobject);
begin
inc(step);
//BuffList.
case step of
1:CastSkillAndWait(1392, 900); //HolyResistance
2:CastSkillAndWait(1393, 900); //UnholyResistance
3:CastSkillAndWait(1191, 900); //ResistFire
4:CastSkillAndWait(1189, 900); //ResistWind
5:CastSkillAndWait(1192, 900); //ResistAqua
6:CastSkillAndWait(1352, 900); //ElementalProtection
7:CastSkillAndWait(1353, 900); //DivineProtection
8:CastSkillAndWait(1354, 900); //ArcaneProtection
9:CastSkillAndWait(1035, 900); //MentalShield
10:CastSkillAndWait(1259, 900); //ResistShock
11:CastSkillAndWait(1499, 900); //ImproveCombat
12:CastSkillAndWait(1501, 900); //ImproveCondition
13:CastSkillAndWait(1504, 900); //ImproveMovement
14:CastSkillAndWait(1500, 900); //ImproveMagic
15:CastSkillAndWait(1390, 900); //WarChant
16:CastSkillAndWait(1356, 900); //ProphecyofFire
17:CastSkillAndWait(1323, 900); //NoblesseBlessing
18:CastSkillAndWait(1461, 900); //ChantofProtection
19:CastSkillAndWait(307, 900); //DanceofAquaGuard
20:CastSkillAndWait(306, 900); //SongofFlameGuard
21:CastSkillAndWait(529, 900); //SongofElemental
22:CastSkillAndWait(264, 900); //SongofEarth
23:CastSkillAndWait(267, 900); //SongofWarding
24:CastSkillAndWait(268, 900); //SongofWind
25:CastSkillAndWait(270, 900); //SongofInvocation
26:CastSkillAndWait(304, 900); //SongofVitality
27:CastSkillAndWait(275, 900); //DanceofFury
28:CastSkillAndWait(274, 900); //DanceofFire
29:CastSkillAndWait(271, 900); //DanceoftheWarrior
30:CastSkillAndWait(1240, 900); //Guidance
31:CastSkillAndWait(1502, 900); //ImproveCriticalAttack
32:CastSkillAndWait(1519, 900); //ChantofBloodAwakening
else
begin
LeavePartyAndUntarget;
timer.enabled := false;
end;
end;
end;
Procedure MageBuffs(Sender:tobject);
begin
inc(step);
//BuffList.
case step of
1:;//...
2:;//...
3:;//...
4:;//...
else
begin
LeavePartyAndUntarget;
timer.enabled := false;
end;
end;
end;
Procedure LeavePartyAndUntarget;
begin
buf := #44;
SendToServerEx(BufferCharacterName);
buf := #48;
SendToServerEx(BufferCharacterName);
end;
Procedure CastSkillAndWait(SkillId,DelayMsec:integer);
begin
buf := #$39;
writed(skillid);
writed(0);
writed(0);
SendToServerEx(BufferCharacterName);
timer.interval := DelayMsec;
end;
procedure init;
begin
Names := TStringList.Create;
Names.LoadFromFile('Names.txt');
timer := ttimer.create(nil);
timer.interval := 100;
timer.enabled := false;
end;
procedure free;
begin
Names.free; //what about memory leaks ?
timer.free;
end;
function CheckName(n: string) : Boolean;
begin
Result := (Names.IndexOf(n) > -1);
end;
var
name,pmsg:string;
n,i,y:integer;
begin
if connectname <> BufferCharacterName then exit;
if FromServer then begin
case pck[1] of
#$39 : begin
name:=ReadS(2);
if CheckName(name) then
begin
buf:=#$43#01#00#00#00; //reply "Yes"
SendToServerEx(BufferCharacterName);
buf:=#$49;
writes('PM "mage or "fighter');
writed(3);
SendToServerEx(BufferCharacterName);
end
else
begin
buf:=#$43#00#00#00#00;//reply "No"
SendToServerEx(BufferCharacterName);
end
end;
#$4A :
if not timer.enabled then //if we are casting skills right now - ignore that pm or whatever.
begin
i:=(10);
name:=ReadS(i);
pmsg:=ReadS(i);
if CheckName(name) then
begin
step := 0;
timer.interval := 100;
ObjectID:=ReadD(2);
case lowercase(Pmsg) of
'fighter':
begin
buf:=#$1F;
WriteD(ObjectID);
SendToServerEx(BufferCharacterName);
timer.ontimer := @FighterBuffs;
timer.enabled := true;
end;
'mage':
begin
buf:=#$1F;
WriteD(ObjectID);
SendToServerEx(BufferCharacterName);
timer.ontimer := @MageBuffs;
timer.enabled := true;
end;
end;
end;
end;
end;
end;
end.
__________________
L2Ext - project closed.
Последний раз редактировалось alexteam, 08.12.2009 в 23:05.
Причина: Добавлено сообщение
|