faq/stealth/magery.txt · Last modified: 2020/10/16 14:41 by Shadowski
 

Magery

program Magery;
{$Include 'all.inc'}

var
i : Integer;

const
casttime = 1500; // Stand-by time before casting a spell
manalvl = 16;    // If mana's lower than this number - meditating starts. (Spell's cost + 1)
spellbook = 0;   //If 1 - from Spellbook with reagents, если 0 - casting spells from Earthbook

procedure castscrolls;
begin
  WaitTargetObject(FindType($0F51, backpack));
  UOSay('.scast gustofair'); // http://wiki.zuluhotel.com/info:commands:scast 
  Wait(casttime);
end;

Procedure Meditation;
Begin
  repeat
    waitconnection(5000);
    UseSkill('Meditation');
    Wait(10200);
  until ( (InJournal('You enter') > -1) or (not(Connected)) );
  repeat
    waitconnection(5000);
    wait(1000);
  until ( (InJournal('You stop m|lost|some time|at peace') > -1) or (not(Connected)) );
End;

Begin
  while (true) do
  begin
    SetARStatus(true);
    Hungry(1, backpack);
    for i := 0 to 100 do
    begin
      if (mana >= manalvl) then begin
        if spellbook = 1 then
        begin
          WaitTargetObject(FindType($0F51, backpack));
          if (GetSkillValue('Magery') >= 30.0) and (GetSkillValue('Magery') <= 39.9) then begin Cast('Fireball'); Wait(1500); end;
          if (GetSkillValue('Magery') >= 40.0) and (GetSkillValue('Magery') <= 49.9) then begin Cast('Lightning'); Wait(1500); end;
          if (GetSkillValue('Magery') >= 50.0) and (GetSkillValue('Magery') <= 59.9) then begin Cast('Paralyze'); Wait(1500); end;
          if (GetSkillValue('Magery') >= 60.0) and (GetSkillValue('Magery') <= 69.9) then begin Cast('Energy Bolt'); Wait(1500); end;
          if (GetSkillValue('Magery') >= 70.0) and (GetSkillValue('Magery') <= 79.9) then begin Cast('Flame Strike'); Wait(1500); end;
          if (GetSkillValue('Magery') >= 80.0) and (GetSkillValue('Magery') <= 104.9) then begin Cast('Resurrection'); Wait(1500); end;
        end
        else begin castscrolls; end;
      end;
      Wait(500);
      If  (mana < manalvl) then begin Meditation; end;
    end;
  end;
end.
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki