Postado Outubro 9, 2015 9 anos Const NumberOfMonsters = 3 /// Numero de monstros pra colocar arma forte StrongWeapon = 3324 /// ID da arma FORTE WearWeapon = 3304 /// ID da arma FRACA function GetItemFromOpenBackpack(ID: integer): TItem; var y: integer; begin Result := nil; for x := 0 to Self.Containers.Count - 1 do begin if x >= Self.Containers.Count then Break; for y := 0 to Self.Containers.Container[x].Count - 1 do begin if y >= Self.Containers.Container[x].Count then Break; if Self.Containers.Container[x].Item[y].ID = ID then begin Result := Self.Containers.Container[x].Item[y]; Exit; end; end; end; end; function CountMonstersBesideYou:Integer; begin Result := 0; UpdateWorld; for i := 0 to creatures.Count -1 do begin if i >= Creatures.Count then break for x := -1 to 1 do begin if x >= 2 then break for y := -1 to 1 do begin if y > 1 then break; if Creatures.Creature[i].NPC then if (Creatures.Creature[i].x = Self.X +x) and (Creatures.Creature[i].y = Self.y + y) and (Creatures.Creature[i].Z = Self.Z) then Result := Result + 1; end; end; end; end; while not terminated do begin UpdateWorld; if CountMonstersBesideYou >= NumberOfMonsters then begin if Self.RightHand.ID <> StrongWeapon then begin Boots := GetItemFromOpenBackpack(StrongWeapon); if Boots <> nil then Boots.MoveToBody(Self.RightHand,0); else Self.Displaytext('Strong Weapon werent found in open backpack!'); end; end; if CountMonstersBesideYou < NumberOfMonsters then begin if Self.RightHand.ID <> WearWeapon then begin Boots := GetItemFromOpenBackpack(WearWeapon); if Boots <> nil then Boots.MoveToBody(Self.RightHand,0); else Self.Displaytext('Wear Weapon werent found in open backpack!'); end; end; End; Créditos: ngmax
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.