Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses sysutils;
- const
- //CONFIG
- usePremiumBook = false; //change to true, if you have premium book for buffs
- buffCheckID = 1040; //buff ID which will be checked for rebuff
- remainingSec = 60; //minimal buffs time left to start rebuffing (sec)
- buffSet = 'warrior'; //or change to: mage
- rDelay = 600; //delay between buffs (ms)
- procedure takeBuffs;
- begin
- if usePremiumBook then sendRequest else
- Case buffSet of
- 'warrior': begin //set of buffs for warrior class
- singleBuff('Shield');
- singleBuff('GreaterMight');
- singleBuff('BerserkerSpirit');
- singleBuff('ChantofVictory');
- singleBuff('Focus');
- singleBuff('WindWalk');
- singleBuff('VampiricRage');
- singleBuff('MagicBarrier');
- singleBuff('BlessedBody');
- singleBuff('BlessedSoul');
- singleBuff('Haste');
- singleBuff('Guidance');
- singleBuff('DeathWhisper');
- singleBuff('MentalShield');
- singleBuff('Clarity');
- singleBuff('DanceofFire');
- singleBuff('SongofWarding');
- singleBuff('SongofWind');
- singleBuff('SongofHunter');
- singleBuff('SongofEarth');
- singleBuff('DanceofWarrior');
- singleBuff('DanceofFury');
- singleBuff('SongofVitality');
- singleBuff('SongofRenewal');
- end;
- 'mage': begin //set of buffs for mage class
- singleBuff('Shield');
- singleBuff('Empower');
- singleBuff('GreaterShield');
- singleBuff('BerserkerSpirit');
- singleBuff('Concentration');
- singleBuff('MagnusChant');
- singleBuff('Acumen');
- singleBuff('WindWalk');
- singleBuff('WildMagic');
- singleBuff('MagicBarrier');
- singleBuff('BlessedBody');
- singleBuff('BlessedSoul');
- singleBuff('MentalShield');
- singleBuff('SongofWarding');
- singleBuff('SongofWind');
- singleBuff('DanceofMystic');
- singleBuff('DanceofCon');
- singleBuff('SongofEarth');
- singleBuff('SongofVitality');
- singleBuff('SongofMeditation');
- singleBuff('SirensDance');
- singleBuff('SongofRenewal');
- singleBuff('Regeneration');
- singleBuff('DecreaseWeight');
- end;
- end;
- end;
- procedure singleBuff(name:string);
- var id,id2: cardinal;
- begin
- Case name of
- 'Shield' : begin id := 266243; id2 := 1040; end;
- 'GreaterMight' : begin id := 355331; id2 := 1388; end;
- 'Empower' : begin id := 271107; id2 := 1059; end;
- 'GreaterShield' : begin id := 355587; id2 := 1389; end;
- 'BerserkerSpirit' : begin id := 271874; id2 := 1062; end;
- 'ProphecyofWater' : begin id := 346881; id2 := 1355; end;
- 'Might' : begin id := 273411; id2 := 1068; end;
- 'ProphecyofFire' : begin id := 347137; id2 := 1356; end;
- 'Focus' : begin id := 275715; id2 := 1077; end;
- 'ProphecyofWind' : begin id := 347393; id2 := 1357; end;
- 'Concentration' : begin id := 275974; id2 := 1078; end;
- 'MagnusChant' : begin id := 361729; id2 := 1413; end;
- 'Acumen' : begin id := 277763; id2 := 1085; end;
- 'VictoryofPaagrio' : begin id := 2631169; id2 := 10278; end;
- 'WindWalk' : begin id := 308226; id2 := 1204; end;
- 'ChantofVictory' : begin id := 2631425; id2 := 10279; end;
- 'WildMagic' : begin id := 333570; id2 := 1303; end;
- 'VampiricRage' : begin id := 324612; id2 := 1268; end;
- 'MagicBarrier' : begin id := 265218; id2 := 1036; end;
- 'BlessedBody' : begin id := 267526; id2 := 1045; end;
- 'BlessedSoul' : begin id := 268294; id2 := 1048; end;
- 'Haste' : begin id := 278018; id2 := 1086; end;
- 'Guidance' : begin id := 317443; id2 := 1240; end;
- 'DeathWhisper' : begin id := 317955; id2 := 1242; end;
- 'HolyWeapon' : begin id := 267009; id2 := 1043; end;
- 'MentalShield' : begin id := 264964; id2 := 1035; end;
- 'Clarity' : begin id := 357635; id2 := 1397; end;
- 'DanceofFire' : begin id := 70145; id2 := 274; end;
- 'SongofWarding' : begin id := 68353; id2 := 267; end;
- 'Invigor' : begin id := 264195; id2 := 1032; end;
- 'DanceofLight' : begin id := 70913; id2 := 277; end;
- 'SongofWind' : begin id := 68609; id2 := 268; end;
- 'KissofEva' : begin id := 274690; id2 := 1073; end;
- 'DanceofInspir' : begin id := 69633; id2 := 272; end;
- 'SongofHunter' : begin id := 68865; id2 := 269; end;
- 'Regeneration' : begin id := 267267; id2 := 1044; end;
- 'DanceofMystic' : begin id := 69889; id2 := 273; end;
- 'SongofLife' : begin id := 67841; id2 := 265; end;
- 'Agility' : begin id := 278275; id2 := 1087; end;
- 'DanceofCon' : begin id := 70657; id2 := 276; end;
- 'SongofEarth' : begin id := 67585; id2 := 264; end;
- 'DecreaseWeight' : begin id := 321795; id2 := 1257; end;
- 'DanceofWarrior' : begin id := 69377; id2 := 271; end;
- 'SongofWater' : begin id := 68097; id2 := 266; end;
- 'DanceofFury' : begin id := 70401; id2 := 275; end;
- 'SongofVitality' : begin id := 77825; id2 := 304; end;
- 'DanceofVampire' : begin id := 79361; id2 := 310; end;
- 'SongofMeditation' : begin id := 92929; id2 := 363; end;
- 'SirensDance' : begin id := 93441; id2 := 365; end;
- 'SongofRenewal' : begin id := 89345; id2 := 349; end;
- 'SongofChampion' : begin id := 93185; id2 := 364; end;
- end;
- sendRequest(id,id2);
- end;
- procedure sendRequest(id,id2: integer = 0);
- var cmd,book: string; buff: TL2Buff;
- begin
- book := v(usePremiumBook,'9981','9516');
- cmd := 'sb_r_'+v(usePremiumBook,'u','b')+'_p';
- if (id > 0) then cmd := cmd+'?id='+inttostr(id);
- cmd := cmd+'#'+book;
- if not engine.dlgtext.contains(cmd) then begin
- engine.useitem(strtoint(book));
- if (id > 0) and delay(100) then engine.bypasstoserver('buff_book_1.htm#9516',false);
- end;
- while not user.buffs.byid(id2,buff) and not user.dead do begin
- engine.bypasstoserver(cmd);
- delay(rDelay+random(300));
- if usePremiumBook then break;
- end;
- end;
- function v(test: boolean; v1,v2: string): string;
- begin
- if test then result := v1 else result := v2;
- end;
- function checkBuff: boolean;
- var buff: TL2Buff;
- begin
- result := (not user.buffs.ByID(buffCheckID,buff) or (buff.EndTime < remainingSec*1000));
- end;
- function checkAgro: boolean;
- var npc: TL2Npc;
- begin
- result := not user.dead and ((not user.target.dead and user.target.attackable) or Engine.FindEnemy(npc, user, 1100));
- end;
- procedure leaveCombat;
- begin
- engine.facecontrol(0,false);
- while not user.dead and user.incombat and delay(200) do begin
- if checkAgro then begin
- if not engine.getfacestate(0) then engine.facecontrol(0,true);
- end else if engine.getfacestate(0) then engine.facecontrol(0,false);
- end;
- end;
- begin
- while delay(2000) do begin
- if checkBuff then begin
- while checkAgro do delay(20);
- leaveCombat;
- takeBuffs;
- Engine.FaceControl(0,true);
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement