Admin - 2009-05-02 09:57:21

Zmiana butów z bohy na softboots i na odwrót w zależności od HP. Np, jeżeli ustawimy w const HPsoft = 1000 i HPboh = 1500 (tak jak jest teraz), to gdy HP nam spadnie poniżej 1000 to założy soft buty, a gdy będzie powyżej 1500 to założy bohy.
[hide]

Kod:

const
   BohID = 3079;
   SoftID = 6529;
   HPsoft = 1000;
   HPboh = 1500;
   
procedure changeBoots(id : integer);
var
  x,i:integer;
begin
   for x:=0 to self.containers.count-1 do
   begin   
      for i:=0 to self.containers.container[x].count -1 do
      begin
         if self.containers.container[x].item[i].id = id then
         begin
            self.containers.container[x].item[i].movetobody(self.feet,1);   
            exit;     
         end;   
      end;
   end;
end;

begin
   updateworld;
   if self.health > HPboh then
      if self.feet.ID = bohID then exit
         else changeBoots(BohID);
   else if self.health < HPsoft then
      if self.feet.ID = SoftID then exit
         else changeboots(softID);     
end;[/hide]
www.naruto-arena-x.pun.pl www.gossip-girl.pun.pl www.shinobiworld-pbf.pun.pl www.probleszno.pun.pl www.extreamsquad.pun.pl